Skip to content

[SPIR-V] Fix crash with out-of-line template decl - #8079

Merged
Nathan Gauër (Keenuts) merged 3 commits into
microsoft:mainfrom
Keenuts:fix-5823
Jan 26, 2026
Merged

Nathan Gauër (Keenuts) merged 3 commits into
microsoft:mainfrom
Keenuts:fix-5823

Conversation

@Keenuts

Copy link
Copy Markdown
Collaborator

The SPIR-V backend made no differentence between VarDecl from template declaration and VarDecl from template instantiation. Fixing this by not creating a SPIR-V variable for template declaration (and waiting for the final instantiation).

Fixes #5823

@s-perron Steven Perron (s-perron) 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.

I have an alternative. I don't know the best way. How hard is it to implement what I suggested? do you know how it is handled for DXIL?

Comment thread tools/clang/lib/SPIRV/SpirvEmitter.cpp Resolved
Comment thread tools/clang/lib/SPIRV/SpirvEmitter.cpp Resolved
The SPIR-V backend made no differentence between VarDecl from
template declaration and VarDecl from template instantiation.
Fixing this by not creating a SPIR-V variable for template
declaration (and waiting for the final instantiation).

Fixes microsoft#5823
@Keenuts
Nathan Gauër (Keenuts) merged commit df50f51 into microsoft:main Jan 26, 2026
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Jan 26, 2026
@Keenuts
Nathan Gauër (Keenuts) deleted the fix-5823 branch January 26, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Out-of-line initialization of static const member arrays doesn't work, and wrongly requires static const at definition site

2 participants