HLSL: Using SV_ClipDistance in Geometry Shader - Crash
I have a code like this:
[maxvertexcount(4)]
void main(point VSO si[1], inout TriangleStream<VSO> stream)
{
VSO so;
so = si[0];
for (int i = 0; i < 4; ++i)
{
... // modify position and texture coordinates for this point sprite
so.clipDistance = some_value; // float clipDistance : SV_ClipDistance;
stream.Append(so);
}
}
And it crashes somewhere in HlslParseContext::handleAssign -> map -> HlslParseContext::assignClipCullDistance (reading location 0x0)
Could you attach a complete example HLSL file that demonstrates the issue?
This fails because TIntermSymbol* sym = clipCullNode->getAsSymbolNode(); is NULL.
This is just used for the debug name, so I just removed that in my build and hardcoded the debug name.
@misyltoad Since you can apparently reproduce the issue, could you attach a complete example shader that reproduces the issue? Alternatively, if you want to make a patch to fix it that would also be great.