KhronosGroup / KhronosGroup/glslang

Pointer to TType is NULL on shader reflection for pipe output.

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

Description

The following code
```
for (int j = 0; j < program.getNumPipeOutputs(); j++) {
if (program.getPipeOutput(i).getType()->getQualifier().hasLocation()) {

```
crashes on null getType().
For this shader:
```
layout (location = 0) out vec4 uFragColor;
void main() { uFragColor=vec4(1.0); }
```
I want to obtain the layout locations for the fragment outputs, but seems to be not possible

Contributor guide

Open the contributing guide

Research direction

Reproduce the shader-reflection crash with the provided fragment shader and the loop over pipe outputs, starting from getPipeOutput() and getType(). Determine why the pipe output has no type and whether reflection can expose its layout location; done means the null dereference is addressed and the location can be obtained or the limitation is clearly defined.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.