Skip to content

Move Features::PRIMITIVE_INDEX into the WebGPU group #9101

Draft
andyleiserson wants to merge 4 commits intogfx-rs:trunkfrom
andyleiserson:jj-push-vpyr
Draft

Move Features::PRIMITIVE_INDEX into the WebGPU group #9101
andyleiserson wants to merge 4 commits intogfx-rs:trunkfrom
andyleiserson:jj-push-vpyr

Conversation

@andyleiserson
Copy link
Contributor

@andyleiserson andyleiserson commented Feb 24, 2026

Renames Features::SHADER_PRIMITIVE_INDEX to Features::PRIMITIVE_INDEX (for consistency with the spec, which uses shader_f16 but not shader_primitive_index), and moves it to the WebGPU feature set.

Putting it in the WebGPU feature set results in it being exposed by Deno and available in CTS runs, so, enable the CTS tests for primitive_index. I've also added a cts_runner integration test that checks the feature is exposed, because the CTS silently skips the relevant tests if it is not.

I've also reworded the changelog entry related to enable primitive_index, but the actual functional change was in #8879.

CC @inner-daemons

Squash or Rebase? Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

Copy link
Collaborator

@inner-daemons inner-daemons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah LGTM for the most part.

/// This is a native only feature.
const SHADER_DRAW_INDEX = 1 << 59;

// Adding a new feature? Bit 35 (formerly SHADER_PRIMITIVE_INDEX) is available.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Free parking down the road 🗣

Comment on lines 1612 to 1616
/// Supported platforms:
/// - Vulkan
/// - DX12
/// - Metal (some)
/// - OpenGL (some)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW if we are explicitly saying that not all devices on the API will support it, Vulkan should probably also be (some) since it needs geometry shader support. HLSL is fine because this was added in SM4 (DX10).

@andyleiserson andyleiserson marked this pull request as draft February 24, 2026 18:53
@andyleiserson
Copy link
Contributor Author

I've marked this as draft because the CTS failures in CI appear real, and I don't have time to debug them right now.

#9105 is a failure related to primitive_index on DX12
#9106 is a failure elsewhere in the fragment_builtins suite on DX12 and Vulkan, doesn't necessarily need to be fixed if we enable only the primitive index tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants