Skip to content

Sized Binding Arrays: Decide what can be arrayed and the syntax. #5084

@Kangz

Description

@Kangz

See the proposal.

We need to decide what will be arrayable, and the syntax to do so. There was consensus on the binding_array<T, N> type. For the various binding types here is the proposed syntax and discussion on arrayability:

  • Sampled textures, var a : binding_array<texture_2d<t32>, 2>, arrayable.
  • Storage textures, var a : binding_array<texture_storage<r32uint, read_write>, 2>, arrayable.
  • Samplers, var a : binding_array<sampler, 2>, arrayable.
  • External textures, non-arrayable (we could do it, but difficult for unsized array in the future, and it's overall a hassle)
  • Uniform buffers var<uniform> a : binding_array<Uniforms, 2>, arrayable TBD
  • Storage buffers var<storage, read_write> a : binding_array<Uniforms, 2>, arrayable TBD
  • texel buffers var a : binding_array<texel_buffer<r8uint, read_write>, 2>, arrayable TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specification

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions