glslang icon indicating copy to clipboard operation
glslang copied to clipboard

HLSL: Using SV_ClipDistance in Geometry Shader - Crash

Open dmaluev opened this issue 5 years ago • 4 comments

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)

dmaluev avatar Sep 11 '20 23:09 dmaluev

Could you attach a complete example HLSL file that demonstrates the issue?

arcady-lunarg avatar Feb 01 '23 18:02 arcady-lunarg

This fails because TIntermSymbol* sym = clipCullNode->getAsSymbolNode(); is NULL.

misyltoad avatar Apr 29 '25 20:04 misyltoad

This is just used for the debug name, so I just removed that in my build and hardcoded the debug name.

misyltoad avatar Apr 29 '25 20:04 misyltoad

@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.

arcady-lunarg avatar May 06 '25 02:05 arcady-lunarg