Open
Description
Is your feature request related to a problem? Please describe.
When using Multi Draw Indirect, there is no way for the shader to know what draw it is a part of.
GLSL in OpenGL provides the gl_DrawID
built-in for this purpose. WGSL does not have an equivalent.
(AFAIK, the WebGPU spec does not have MDI at all? I am not sure. That would explain the lack of such builtin in WGSL.)
Describe the solution you'd like
Naga could add support for a draw_index
built-in, similar to vertex_index
and instance_index
. Even though this is not part of the upstream WGSL spec.
Describe alternatives you've considered
Depending on the use case, it may be possible to work around this by using the instance IDs instead.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo