Skip to content

Skip static cbuffer variables in explicit layout indexing - #8538

Closed
Lucas (fall2019) wants to merge 1 commit into
microsoft:mainfrom
fall2019:fix_spirv_static_cbuffer_index
Closed

Skip static cbuffer variables in explicit layout indexing#8538
Lucas (fall2019) wants to merge 1 commit into
microsoft:mainfrom
fall2019:fix_spirv_static_cbuffer_index

Conversation

@fall2019

Copy link
Copy Markdown

This fixes invalid SPIR-V generation when a cbuffer contains interleaved static const declarations.

Fixes #8537

@fall2019

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@hekota Helena Kotas (hekota) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@fall2019

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 8538 in repo microsoft/DirectXShaderCompiler

@fall2019

Copy link
Copy Markdown
Author

Helena Kotas (@hekota) Hello! Thanks for the approval. I don't have permission to trigger the Azure Pipelines. Could you run /azp so the checks can complete? Thanks!

@dnovillo Diego Novillo (dnovillo) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@damyanp

Copy link
Copy Markdown
Member

[Auto-generated note from Damyan Pepper (@damyanp)]

This looks like a user-visible bug fix/feature change. Please add (or point to) the corresponding entry in docs/ReleaseNotes.md.

If release-note coverage is planned in a related PR (including one that hasn’t been submitted yet), please mention that plan/link so we can avoid duplicate notes.

@llvm-beanz

Copy link
Copy Markdown
Collaborator

A separate PR is a more complete fix of this issue (see #8731). The fix in this PR drops the static members, which isn't ideal, so we should take the other solution.

@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Aug 7, 2026
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.

[SPIR-V] Static const declarations inside cbuffer can corrupt member indices and generate invalid OpAccessChain.

5 participants