← Back to release summary

WebGPU: 'primitive_index' feature

Category
Graphics
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

This feature adds a new optional capability to WebGPU that exposes a new WGSL shader builtin, 'primitive_index'. This builtin provides a per-primitive index to fragment shaders on supported hardware, similar to the existing vertex_index and instance_index builtins. The primitive index is useful for advanced graphical techniques, such as virtualized geometry.

Standards & signals

Explainers: https://github.com/gpuweb/gpuweb/blob/main/proposals/primitive-index.md

View on chromestatus.com