Skip to content

Conversation

@strandborg
Copy link
Contributor

RenderDoc generates SPIR-V that may reuse boolean specialization constants, resulting in invalid MSL being generated.

  • Updated emit_specialization_constants_and_structs to deduplicate function constants and handle boolean types correctly, avoiding illegal bitcasting in Metal.
  • Modified bitcast_glsl_op to prevent bitcasting to/from boolean types, ensuring compliance with Metal's restrictions.
  • Added a new test shader spec-constant-bool-mixed.asm.frag to validate the behavior of mixed specialization constants with the same SpecId for boolean and uint types.

- Updated `emit_specialization_constants_and_structs` to deduplicate function constants and handle boolean types correctly, avoiding illegal bitcasting in Metal.
- Modified `bitcast_glsl_op` to prevent bitcasting to/from boolean types, ensuring compliance with Metal's restrictions.
- Added a new test shader `spec-constant-bool-mixed.asm.frag` to validate the behavior of mixed specialization constants with the same SpecId for boolean and uint types.
@CLAassistant
Copy link

CLAassistant commented Aug 25, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@HansKristian-Work HansKristian-Work left a comment

Choose a reason for hiding this comment

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

Surprised this is even legal, but LGTM.

@HansKristian-Work HansKristian-Work merged commit 9ef5f50 into KhronosGroup:main Aug 29, 2025
10 checks passed
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