From: https://dawn-review.googlesource.com/c/dawn/+/89340
Currently the validation of drawing with GPURenderCommandsMixin encoder in WebGPU spec requires
- For each GPUIndex32 slot 0 to pipelineDescriptor.vertex.buffers.length:
- If pipelineDescriptor.vertex.buffers[slot] is not null, encoder.[[vertex_buffers]] must [=map/contain=] |slot|.
And validating GPUVertexBufferLayout in the spec doesn't state zero-attribute buffer should be ignored.
So, buffers must be set even for zero-attribute vertex buffer slots with GPURenderCommandsMixin.setVertexBuffer(). But this may sound a bit weird because buffers are not used in practice.
It may be worth to consider to relax the validation of drawing with GPURenderCommandsMixin encoder to skip the null buffer check for zero-attribute vertex buffer slots.
- For each GPUIndex32 slot 0 to pipelineDescriptor.vertex.buffers.length:
- If pipelineDescriptor.vertex.buffers[slot] is not null and pipelineDescriptor.vertex.buffers[slot].attributes.length is not zero, encoder.[[vertex_buffers]] must [=map/contain=] |slot|.