这是indexloc提供的服务,不要输入任何密码
Skip to content

Relax the null buffer check for zero-attribute vertex buffers in "valid to draw with GPURenderCommandsMixin"  #2864

@takahirox

Description

@takahirox

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|.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions