Skip to content

[SPIRV] Add diagnostic for boolean bitfields#7822

Merged
s-perron merged 2 commits intomicrosoft:mainfrom
s-perron:i7790
Oct 22, 2025
Merged

[SPIRV] Add diagnostic for boolean bitfields#7822
s-perron merged 2 commits intomicrosoft:mainfrom
s-perron:i7790

Conversation

@s-perron
Copy link
Collaborator

Adds a diagnostic to flag the use of boolean bitfields in structs when targeting SPIR-V. This is not supported for variables that are not externally visible.

This change introduces a new error message in SemaHLSL to detect and report this unsupported usage for:

  • Local variables
  • Function parameters
  • Static global variables

A new test file is added to verify the diagnostic is triggered in these cases and not for externally visible global variables.

Avoid the segfault reported in
#7790.

Adds a diagnostic to flag the use of boolean bitfields in structs when targeting
SPIR-V. This is not supported for variables that are not externally visible.

This change introduces a new error message in SemaHLSL to detect and report this
unsupported usage for:
- Local variables
- Function parameters
- Static global variables

A new test file is added to verify the diagnostic is triggered in these cases
and not for externally visible global variables.

Avoid the segfault reported in
microsoft#7790.
Copy link
Collaborator

@Keenuts Keenuts left a comment

Choose a reason for hiding this comment

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

Ah that's unfortunate... LGTM

@s-perron
Copy link
Collaborator Author

@llvm-beanz Ping

@s-perron s-perron merged commit d2f9d80 into microsoft:main Oct 22, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Oct 22, 2025
damyanp added a commit that referenced this pull request Oct 29, 2025
#7822 added a new test for spirv. This needs a `REQUIRES: spirv` to
prevent it running in cases where the compiler doesn't support spirv.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants