v132 · graphics

WebGPU: Texture view usage

Adds an optional field to WebGPU texture view creation to request a subset of the usage flags from the source texture. By default, texture view usage inherits from the source texture but there are view formats which can be incompatible with the full set of inherited usages. Adding a usage field to texture view creation allows the user request a subset of

concepts

  1. Texture view usage

    GPUTextureView.createView() accepts a narrower usage mask than the parent texture. Validators can lock down view scope per binding.

  2. storage vs sample

    Real pipeline: one texture, two narrowed views — compute writes through STORAGE_BINDING-only, render samples through TEXTURE_BINDING-only.

  3. usage-flag builder

    Tick the texture's usage flags and the view's. Live validity check, generated createView() snippet. Spot the InvalidStateError combinations before they hit production.

  4. View Usage Validator

    Configure texture and view usage flags interactively. Validates all WebGPU rules: view must be a subset of texture usage, format/storage constraints, mip-level restrictions.

  5. Usage Compatibility Matrix

    Toggle which usage flags are set on the source texture and see a matrix of which view usages are valid (subset ✓) vs invalid (superset ✗). Build a GPUTextureViewDescriptor with any combination and get live validation feedback.

why it shipped

A usage field for texture view creation allows users to request more view formats that become valid with specific usage flags and allows the WebGPU implementation to create more performant views.

references