microsoft / microsoft/DirectXShaderCompiler

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

Open
#5,823 11 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug spirv
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
When compiling with -HV 202x -T ps_6_7 -E PSMain it works and produces DXIL, when adding -spirv it SIGSEGVs the compiler.

Steps to Reproduce
https://godbolt.org/z/WasWzsq4E

If you strip all my C++ compat code then you have
https://godbolt.org/z/dWMfjxza1

Actual Behavior
SIGSEGV of the compiler.

I think this is because static outside of the class makes no sense in C++ (and for LLVM), but I cannot use const on its own because I get a different problem.

Environment

  • DXC version Latest trunk according to Godbolt
  • Host Operating System Linux I guess

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.