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.

84.23%
of browsers tested for this feature

Platform Support

PlatformSupport
Android97.24%
Chromium OS99.49%
iOS40.24%
Linux85%
Mac OS73.15%
Windows90.81%

Browser Support

BrowserSupport
Chrome/Chromium95.37%
Edge97.57%
Firefox0.47%
Opera98.44%
Other69.97%
Safari38.64%
Samsung Internet95.25%

Vendor Support

VendorSupport
0x10de0%
0x80860%
amd93.88%
apple71.76%
arm96.8%
google0%
huawei100%
img-tec100%
intel95.91%
intelr18.18%
microsoft100%
nvidia98.02%
qualcomm97.26%
samsung100%

Vendor Architecture Support

Vendor - ArchitectureSupport
amd - gcn-473.82%
amd - gcn-596.97%
amd - rdna-138.14%
amd - rdna-298.8%
amd - rdna-399.78%
apple - apple45.19%
apple - metal-399.48%
arm - bifrost95.62%
arm - valhall97.74%
intel - gen-1195.3%
intel - gen-12lp98.89%
intel - gen-80.86%
intel - gen-993.52%
intel - xe-2lpg99.8%
intel - xe-lpg99.46%
nvidia - ampere98.41%
nvidia - blackwell99.19%
nvidia - kepler91.09%
nvidia - lovelace98.54%
nvidia - maxwell97.01%
nvidia - pascal96.79%
nvidia - turing97.86%
qualcomm - adreno-6xx97.17%
qualcomm - adreno-7xx97.67%
qualcomm - adreno-8xx98.93%