Skip to content

primitive-index

Adds the primitive_index builtin so fragment shaders can read which primitive in the current draw produced the fragment. A primitive is one triangle, line, or point from the draw call.

Check your device: WebGPU Capabilities Report.

More details: Developer Docs (MDN) Specification (W3C)

Overall Support

Percentage supporting this feature among reports tested for it.

82.52%
of browsers tested for this feature

Platform Support

PlatformSupport
Android97.82%
Chromium OS98.87%
iOS33.47%
Linux84.55%
Mac OS70.14%
Windows90.2%

Browser Support

BrowserSupport
Chrome/Chromium94.96%
Edge97.91%
Firefox0.34%
Opera97.45%
Other70.83%
Safari31.23%
Samsung Internet96.5%

Vendor Support

VendorSupport
amd93.49%
apple66.01%
arm97.99%
google0%
img-tec100%
intel95.63%
intelr41.67%
microsoft100%
nvidia98.59%
qualcomm96.75%
samsung100%
venus0%

Vendor Architecture Support

Vendor - ArchitectureSupport
amd - gcn-471.07%
amd - gcn-596.86%
amd - rdna-135.52%
amd - rdna-299.09%
amd - rdna-399.73%
apple - apple33.73%
apple - metal-399.66%
arm - bifrost98.29%
arm - valhall97.81%
intel - gen-1193.75%
intel - gen-12lp99%
intel - gen-84.23%
intel - gen-992.97%
intel - xe-2lpg100%
intel - xe-lpg99.58%
nvidia - ampere98.68%
nvidia - blackwell99.63%
nvidia - kepler90.44%
nvidia - lovelace99.14%
nvidia - maxwell97.77%
nvidia - pascal98.93%
nvidia - turing98.46%
qualcomm - adreno-6xx96.41%
qualcomm - adreno-7xx97.6%
qualcomm - adreno-8xx97.94%