Skip to content

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 24, 2025

Adds support for new WebGPU features:

  • Request texture-format-tier1 and texture-format-tier2 GPU features for extended texture format support
  • Request primitive-index feature and expose pcPrimitiveIndex built-in in fragment shaders
  • Add supportsPrimitiveIndex public property to GraphicsDevice
  • Add CAPS_PRIMITIVE_INDEX shader define when the feature is supported
  • Reorder WGSL shader assembly to place defines before preamble chunks (order matches WebGL now)

When primitive-index is supported, fragment shaders can access pcPrimitiveIndex which uniquely identifies the current primitive being processed.

based on https://developer.chrome.com/blog/new-in-webgpu-142

@mvaligursky mvaligursky self-assigned this Dec 24, 2025
@mvaligursky mvaligursky added enhancement Request for a new feature area: graphics Graphics related issue labels Dec 24, 2025
@mvaligursky mvaligursky requested a review from a team December 24, 2025 11:47
@mvaligursky mvaligursky merged commit d650e0b into main Dec 24, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-primitive-index branch December 24, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants