KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
3.07k stars 844 forks source link

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

Open reduz opened 5 years ago

reduz commented 5 years ago

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

reduz commented 5 years ago

Sorry, edited issue, if you are reading from mail, re-open on Github.

reduz commented 5 years ago

At least, if you are using two outputs for a GLSL fragment program, I can imagine the number matches program.getNumPipeOutputs() right?