Skip to content

Conversation

@06wj
Copy link

@06wj 06wj commented Nov 28, 2025

Connections
No dependencies on other PRs. Please add related issues if any.

Description
This PR adds support for GLSL specialization constants (constant_id layout qualifier) in the Naga GLSL frontend and enables the WGSL backend to output override declarations.

  1. GLSL Frontend
  • Parse layout(constant_id = N) qualifier for const declarations
  • Convert these to Naga Override instead of Constant
  • Handle Override expressions in the constant evaluator
  1. WGSL Backend
  • Remove the "pipeline constants not supported" error
  • Add write_override() method to output @id(N) override declarations
  • Support Expression::Override in expression writers
  • Implement write_override in TypeContext
  1. Naming
  • Add NameKey::Override variant for override naming

Testing

  • Add spec-constant.frag test case with various specialization constant types

Squash or Rebase?

This branch contains a single functional commit and can be rebased directly.

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.

@06wj 06wj force-pushed the glsl-constant-id-support branch from ef924a2 to 35ab6a0 Compare November 28, 2025 09:14
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.

1 participant