Skip to content

Validate Builtin decorations for WebGPU #2276

@zoddicus

Description

@zoddicus

From the spec:

Built-In Variables

When decorating with the Builtin decoration, only the following are valid, and these are further restricted as indicated by the table.

Builtin Allowed types Allowed execution models for the Input storage class Allowed execution models for the Output storage class
Position Vector of 4 32-bit floats Vertex
VertexIndex Scalar 32-bit integer Vertex
InstanceIndex Scalar 32-bit integer Vertex
FrontFacing Boolean Fragment
FragCoord Vector of 4 32-bit floats Fragment
FragDepth 32-bit float Fragment
NumWorkgroups Vector of 3 32-bit ints GLCompute
WorkgroupSize Vector of 3 32-bit ints GLCompute
LocalInvocationId Vector of 3 32-bit ints GLCompute
GlobalInvocationId Vector of 3 32-bit ints GLCompute
LocalInvocationIndex 32-bit int GLCompute

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions