microsoft / microsoft/DirectXShaderCompiler
Assert/hang in SROA_HLSL pass related to empty base struct regression
Open
Nobody has claimed this yet.
crash
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
#3016 seems to have reappeared. Unknown if it is exact same issue or just similar, but symptoms and general area of code are the same, at least.
Repro is unchanged:
Compile the following with -E main -T vs_6_0:
struct EmptyStruct
{
};
struct BaseStruct
{
EmptyStruct emptyStructMember;
//float makeMeNotEmpty; // Uncomment to prevent assert
};
struct ChildStruct : BaseStruct
{
float4 m_childMember;
float4 func() { return m_childMember; }
};
float4 main() : SV_Position
{
ChildStruct var_1;
EmptyStruct var_2;
var_1.emptyStructMember = var_2; // Comment out to prevent assert
var_1.m_childMember = 0;
return var_1.func();
}
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 assertion with the supplied HLSL input using -E main -T vs_6_0, then inspect the SROA_HLSL pass and compare the behavior with issue #3016. The fix should allow this empty-base-struct case to compile without an assertion while preserving the existing shader output behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100