Infinite loop related to struct inheritance and empty struct
I'm hitting an infinite loop when compiling a shader with a particular pattern of inheritance and function calls to a helper struct. From reducing the repro case the problem appears to occur when a parent struct declares a member of an empty helper struct, then a child struct derives from that and also declares its own member var (not zero-sized). Then calling a method on that helper struct from a function on the child will trigger the infinite loop.
The hang looks to be in the SROA pass, which suggestions a connection to #3770 (which also dealt with empty structs). However the fix for that does not seem to have fixed this issue, sadly.
Here's the minimal repro I came up with. Confirmed still occurs with the current-head e65a981. Compile with -T ps_6_7 -E main
struct Helper
{
float getColor() { return 0; }
};
struct Parent
{
Helper helper;
};
struct Child : Parent
{
float memberVar;
float color()
{
return helper.getColor();
}
};
float main() : SV_Target
{
Child instance;
return instance.color();
}
Has there been any movement on this one? I just hit it again in a different place, this time a bit less easy to workaround :)