KhronosGroup / KhronosGroup/glslang

HLSL: Using SV_ClipDistance in Geometry Shader - Crash

Open
#2,392 4 comments 0 reactions 0 assignees View on GitHub
bug HLSL
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

I have a code like this:
```
[maxvertexcount(4)]
void main(point VSO si[1], inout TriangleStream 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)

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with the HLSL geometry-shader example using SV_ClipDistance, then inspect HlslParseContext::handleAssign, map, and assignClipCullDistance. Trace the null access reported at that path and verify that the example is handled without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.