Base instance semantics on GLES backend #1573
Labels
api: gles
Issues with GLES or WebGL
help required
We need community help to make this happen.
type: bug
Something isn't working
Is your feature request related to a problem? Please describe.
GLES3 doesn't support the base instance natively. We work around it by re-binding the instance-rate vertex buffers and applying the offset. But this doesn't affect
gl_InstanceIndex
, which also needs to be adjusted.Describe the solution you'd like
We'd need Naga to detect the use of "instance_index" semantics and emit a
uniform uint _base_instance" uniform. Then for any access of "instance_index" we'd append this value of "_base_instance
.hal/gles needs to detect this and provide the value for this uniform whenever a draw call requires it.
Describe alternatives you've considered
Adding a downlevel flag for the base instance and not bothering to fix it.
Additional context
Follows #1510
The text was updated successfully, but these errors were encountered: