Add linear_indexing language feature#5554
Conversation
|
Previews, as seen when this build job started (f0b15af): |
mehmetoguzderin
left a comment
There was a problem hiding this comment.
I had a brief look and a minor question came to mind: was linear_indexing or linear_indices also considered as a name, given the technical nature of the specification? Apologies if this was already raised during the call and I missed the decision.
|
|
Understood, |
* Two new builtins: * `global_invocation_index` - linearized `global_invocation_id` * `workgroup_index` - linearized `workgroup_id`
0c225ce to
d5d2103
Compare
|
I'll put this on the WGSL agenda once it comes out of draft. |
|
Draft CTS: gpuweb/cts#4595 |
dneto0
left a comment
There was a problem hiding this comment.
approved with suggested wording tweaks, and optional notes.
| [=built-in values/global_invocation_id=].x +<br> | ||
| ([=built-in values/global_invocation_id=].y * [=attribute/workgroup_size=].x * [=built-in values/num_workgroups=].x) +<br> | ||
| ([=built-in values/global_invocation_id=].z * [=attribute/workgroup_size=].x * [=built-in values/num_workgroups=].x * [=attribute/workgroup_size=].y * [=built-in values/num_workgroups=].y) | ||
| </table> |
There was a problem hiding this comment.
optionally add a note here about overflow cases.
Note: If the number of workgroups in the dispatch would cause this index to exceed the range of the
u32type, then the dispatch will fail and invalidate the GPUComputePassEncoder.
?
There was a problem hiding this comment.
Take a look at the notes added and see what you think.
global_invocation_index- linearizedglobal_invocation_idworkgroup_index- linearizedworkgroup_idFixes #5154