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

Asynchronous shader reflection information #624

@litherum

Description

@litherum

During the last F2F, the idea of exposing reflection information came up. There are a few different use cases:

  1. Something like Shadertoy, where the JS might not know the content of the shaders it's ingesting. (Shadertoy specifically solves this by requiring a particular interface to every shader, but it's not unrealistic to imagine there are places which wouldn't have this requirement.)
  2. During the last F2F, the D3D team indicates that many AAA games create giant shaders with tons of unused inputs/outputs, and then ask the shader compiler which inputs/outputs are actually used, so they can hook up only those resources.
  3. Could be used to solve the concerns in [wgsl] Offset decorations on Structs #561

As far as I know, all the native APIs provide some sort of shader reflection information.

(There's no "API" GitHub tag, so I don't know how to tag this issue as both "relevant to WGSL" but also "relevant to the API")

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIfeature requestA request for a new GPU feature exposed in the API

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions