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.

80.9%
of browsers tested for this feature

Platform Support

PlatformSupport
Android97.74%
Chromium OS98.09%
iOS11.16%
Linux84.6%
Mac OS65.52%
Windows90.66%

Browser Support

BrowserSupport
Chrome/Chromium94.53%
Edge97.73%
Firefox0.22%
Opera96.37%
Other56.11%
Safari12.4%
Samsung Internet95.74%

Vendor Support

VendorSupport
amd92.88%
apple59.15%
arm98.16%
google0%
img-tec99.15%
intel95.33%
intelr0%
mesa100%
microsoft80%
nvidia97.64%
qualcomm97.27%
samsung100%

Vendor Architecture Support

Vendor - ArchitectureSupport
amd - gcn-474.28%
amd - gcn-596.33%
amd - rdna-135.06%
amd - rdna-298.33%
amd - rdna-399.58%
apple - apple14.6%
apple - metal-399.53%
arm - bifrost98.48%
arm - valhall97.92%
intel - gen-1193.05%
intel - gen-12lp98.57%
intel - gen-86.62%
intel - gen-993.12%
intel - xe-2lpg100%
intel - xe-lpg99.12%
nvidia - ampere97.55%
nvidia - blackwell98.91%
nvidia - kepler93.84%
nvidia - lovelace97.52%
nvidia - maxwell99.35%
nvidia - pascal97.15%
nvidia - turing98%
qualcomm - adreno-6xx97.69%
qualcomm - adreno-7xx97.22%
qualcomm - adreno-8xx99.31%