The following program crashes on dxc but works on fxc.
// dxc /Tgs_6_0 t.hlsl
struct VSOutGSIn
{
float4 clr : COLOR0;
float4 pos : SV_Position;
};
struct GSOutPSIn
{
float4 clr : COLOR0;
float4 pos : SV_Position;
};
[maxvertexcount(3)]
void main(triangle VSOutGSIn tri[3], inout TriangleStream<GSOutPSIn> stream)
{
//#define WORKAROUND
#if !defined(WORKAROUND)
stream.Append(tri[0]);
stream.Append(tri[1]);
stream.Append(tri[2]);
#else
GSOutPSIn t0;
t0.clr = tri[0].clr;
t0.pos = tri[0].pos;
GSOutPSIn t1;
t1.clr = tri[1].clr;
t1.pos = tri[1].pos;
GSOutPSIn t2;
t2.clr = tri[2].clr;
t2.pos = tri[2].pos;
stream.Append(t0);
stream.Append(t1);
stream.Append(t2);
#endif
}
If I copy the fields manually it works correctly on dxc. Seems to be some issue with casting between structurally equivalent types.
The following program crashes on dxc but works on fxc.
If I copy the fields manually it works correctly on dxc. Seems to be some issue with casting between structurally equivalent types.