Bug 190029 - [WHLSL] Add casts between vector types
Summary: [WHLSL] Add casts between vector types
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 176199
  Show dependency treegraph
 
Reported: 2018-09-26 22:30 PDT by Thomas Denney
Modified: 2018-10-13 14:50 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Denney 2018-09-26 22:30:39 PDT
There are no cast operators that allow you to cast a vector (or matrix, for that matter) element-wise. For example:

operator int4(uint4 v)
{
    return int4(int(v.x), int(v.y), int(v.z), int(v.w));
}

Metal supports these; I think they would be a useful utility to add to the standard library.
Comment 1 Myles C. Maxfield 2018-09-28 16:58:42 PDT
HLSL doesn't have these; I'm not sure we should either.
Comment 2 Myles C. Maxfield 2018-10-13 14:22:57 PDT
Migrated to https://api.github.com/repos/gpuweb/WHLSL/issues/20
Comment 3 Myles C. Maxfield 2018-10-13 14:50:36 PDT
https://github.com/gpuweb/WHLSL/issues/20