Skip to content

Remove variations of "read-only" usages? #296

@kvark

Description

@kvark

Given that buffer/texture usage belongs to an internal state of a resource (users don't set it explicitly), and we allow multiple read-only usages to co-exist, what is the point to distinguish between different read-only usages (from the specification point of view) at all?

Perhaps, we should write the specification in such a way that there is a single "Read" usage, and a resource can only be in one of the allowed usages at a time. I.e. the rules become simpler, and usage becomes purely exclusive.

For example, buffer usage rules would be rewritten as:

Buffers have the following usages (and commands inducing that usage):

  • READ for buffers that are read only by the following commands:
    • WebGPUCommandEncoder.setVertexBuffers parameter `buffers
    • WebGPUCommandEncoder.setIndexBuffer parameter buffer
    • WebGPUCommandEncoder.{draw|drawIndexed|dispatch}Indirect parameter indirectBuffer
    • setBindGroup parameter bindGroup created with one of the following types:
      • "uniform-buffer"
      • "dynamic-uniform-buffer"
    • copyBufferToBuffer parameter src
    • copyBufferToTexture parameter source.buffer
  • STORAGE for setBindGroup parameter bindGroup created with one the following types:
    • "storage-buffer"
    • "dynamic-storage-buffer"
  • TRANSFER for buffers used as the copy destination of copy{Buffer,Texture}ToBuffer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions