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.

85.11%
of browsers tested for this feature

Platform Support

PlatformSupport
Android97.17%
Chromium OS99.52%
iOS56.89%
Linux81.82%
Mac OS75.45%
Windows90.08%

Browser Support

BrowserSupport
Chrome/Chromium95.65%
Edge97.87%
Firefox0.69%
Opera98.48%
Other75.71%
Safari52.05%
Samsung Internet94.99%

Vendor Support

VendorSupport
0x10de0%
0x80860%
adreno100%
amd94.33%
AMD0%
apple75.29%
arm97.39%
google0%
huawei100%
img-tec100%
intel95.73%
intelr52.38%
microsoft94.12%
nvidia98.22%
qualcomm97.03%
samsung83.33%

Vendor Architecture Support

Vendor - ArchitectureSupport
amd - gcn-477.47%
amd - gcn-596.9%
amd - rdna-143.75%
amd - rdna-298.77%
amd - rdna-399.45%
apple - apple53.37%
apple - metal-399.56%
arm - bifrost95.88%
arm - valhall98.17%
intel - gen-1195.02%
intel - gen-12lp98.9%
intel - gen-82.78%
intel - gen-993.18%
intel - xe-2lpg99.4%
intel - xe-lpg99.6%
nvidia - ampere98.1%
nvidia - blackwell99.32%
nvidia - kepler93.33%
nvidia - lovelace98.64%
nvidia - maxwell97.1%
nvidia - pascal98%
nvidia - turing98.26%
qualcomm - adreno-6xx96.17%
qualcomm - adreno-7xx98%
qualcomm - adreno-8xx99.12%