-
Notifications
You must be signed in to change notification settings - Fork 345
Closed
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Description
WGSL should have the analog of OpenCL C's "shuffle2" where the selector mask is a compile-time constant (or literal vector).
This has a close analog in LLVM IR in as "shufflevector" and in SPIR-V as OpVectorShuffle.
The operate on vectors as values, not as a vector-valued variable (storage).
Assuming v is a 4-element vector, Glslang implements v.xz = foo in SPIR-V as the following:
%initial = load from v
%newvalue = OpVectorShuffle %v_type %initial %foo 4 1 5 3
OpStore %v %newvalue
johnkslang
Metadata
Metadata
Assignees
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues