Skip to content

CL: Support work ID/index/offset queries

Jesse Natalie requested to merge jenatali/mesa:cl-system-semantics into msclc-d3d12

This series adds a bunch of new system values, which are used by VTN for kernels, and can be lowered away down to normal CS system values by nir_lower_system_values. The new system values deal with the fact that CL might have offsets, both at the global level (passed in by users of the API) as well as at the local level, in case the work couldn't all be scheduled in a single dispatch. All queries should return values that make sense with the number of threads/groups that were supposed to be launched, which means some internal fudging to make that look right.

For CLC, we publish a struct that we expect API consumers to put into a constant buffer with the various values we need. New tests verify that the global/local offsets are applied correctly to all get functions exposed in CL 1.2 (note that this doesn't include the "linear ID" functions).

/cc @daniels @bbrezillon @karolherbst

Edited by Jesse Natalie

Merge request reports