Open n3b opened 1 week ago
It would be helpful if a shader that reproduces the described problem is shared
@ArielG-NV sorry about that, here is an example.
The HscOut::instanceId
is being bound to the same slot as the HsOut::pos
.
struct HsOut
{
float2 pos;
float2 hm;
};
struct HscOut
{
float EdgeTessFactor[4] : SV_TessFactor;
float InsideTessFactor[2] : SV_InsideTessFactor;
uint instanceId;
};
[domain("quad")]
[partitioning("integer")]
[outputtopology("triangle_ccw")]
[outputcontrolpoints(4)]
[patchconstantfunc("constants")]
HsOut main()
{
HsOut o;
o.pos = 1;
o.hm = 2;
return o;
}
HscOut constants()
{
HscOut o;
o.instanceId = 123;
o.EdgeTessFactor[0] = 1;
o.EdgeTessFactor[1] = 2;
o.EdgeTessFactor[2] = 3;
o.EdgeTessFactor[3] = 4;
o.InsideTessFactor[0] = 0.5;
o.InsideTessFactor[1] = 0.5;
return o;
}
Thank you for passing along an example shader.
When custom data added to constant function output that is expected to be accessible in evaluation (domain) shader, the wrong location is generated.
Decompiled GLSL generated by SPIRV-Cross: