microsoft / microsoft/DirectXShaderCompiler
Warning for mix packoffset for static variable.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
cbuffer A
{
uint a: packoffset(c0);
uint4 b[1] : packoffset(c2);
static uint c[3] = (uint[3])b;
};
will get warning: cannot mix packoffset elements with nonpackoffset elements in a cbuffer
Steps to Reproduce
dxc -Tlib_6_3
Expected Behavior
No warning.
Actual Behavior
Warning (cannot mix packoffset elements with nonpackoffset elements in a cbuffer) is reported.
Environment
- DXC version : 1.8.2405
- Host Operating System: Windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warning with dxc -Tlib_6_3 using the cbuffer example from the issue, or run it through the linked Godbolt case. Investigate how static variables and packoffset elements are classified during cbuffer validation; done means the example compiles without the cannot-mix warning while invalid mixtures still warn.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100