GLSL source for geometry shader 3: #version 330 layout(triangles) in; layout(triangle_strip, max_vertices = 3) out; in gl_PerVertex { vec4 gl_Position; } gl_in[]; in vec4 v_colour[]; out gl_PerVertex { vec4 gl_Position; }; out vec4 g_colour; void main(void) { for (int i = 0; i < gl_in.length(); ++i) { gl_Position = gl_in[i].gl_Position; g_colour = v_colour[i]; EmitVertex(); } EndPrimitive(); } GLSL IR for shader 3: ( (declare (shader_out flat) int gl_PrimitiveID) (declare (shader_in flat) int gl_PrimitiveIDIn) (declare (shader_out ) int gl_Layer) (declare (shader_out ) vec4 gl_Position) (declare (shader_in ) (array gl_PerVertex 3) gl_in) (declare (uniform ) (array vec4 56) gl_CurrentAttribFragMESA) (declare (uniform ) (array vec4 33) gl_CurrentAttribVertMESA) (declare (uniform ) gl_DepthRangeParameters gl_DepthRange) (declare (uniform ) int gl_NumSamples) (declare () int gl_MaxGeometryVaryingComponents) (declare () int gl_MaxGeometryUniformComponents) (declare () int gl_MaxGeometryTotalOutputComponents) (declare () int gl_MaxGeometryOutputVertices) (declare () int gl_MaxGeometryTextureImageUnits) (declare () int gl_MaxFragmentInputComponents) (declare () int gl_MaxGeometryOutputComponents) (declare () int gl_MaxGeometryInputComponents) (declare () int gl_MaxVertexOutputComponents) (declare () int gl_MaxVaryingComponents) (declare () int gl_MaxClipDistances) (declare () int gl_MaxFragmentUniformComponents) (declare () int gl_MaxVaryingFloats) (declare () int gl_MaxVertexUniformComponents) (declare () int gl_MaxDrawBuffers) (declare () int gl_MaxTextureImageUnits) (declare () int gl_MaxCombinedTextureImageUnits) (declare () int gl_MaxVertexTextureImageUnits) (declare () int gl_MaxVertexAttribs) (declare (shader_in ) (array vec4 3) v_colour) (declare (shader_out ) vec4 g_colour) (function main (signature void (parameters ) ( (declare () int i) (assign (x) (var_ref i) (constant int (0)) ) (loop ( (if (expression bool >= (var_ref i) (constant int (3)) ) ( break ) ()) (assign (xyzw) (var_ref gl_Position) (record_ref (array_ref (var_ref gl_in) (var_ref i) ) gl_Position) ) (assign (xyzw) (var_ref g_colour) (array_ref (var_ref v_colour) (var_ref i) ) ) (call EmitVertex ()) (assign (x) (var_ref i) (expression int + (var_ref i) (constant int (1)) ) ) )) (call EndPrimitive ()) )) ) (function EmitVertex (signature void (parameters ) ( )) ) (function EndPrimitive (signature void (parameters ) ( )) ) ) ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:2157:visit: Assertion `var->data.location != -1' failed. Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff21613b6 in _debug_assert_fail (expr=, file=, line=, function=) at ../../../../src/gallium/auxiliary/util/u_debug.c:309 309 os_abort(); (gdb) bt #0 0x00007ffff21613b6 in _debug_assert_fail (expr=, file=, line=, function=) at ../../../../src/gallium/auxiliary/util/u_debug.c:309 #1 0x00007ffff1fd4a85 in glsl_to_tgsi_visitor::visit (this=0x7b8680, ir=) at ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:2157 #2 0x00007ffff1fd709c in glsl_to_tgsi_visitor::visit (this=0x7b8680, ir=0x7c2b90) at ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:2205 #3 0x00007ffff1fe68ce in glsl_to_tgsi_visitor::visit (this=0x7b8680, ir=0x7c2c00) at ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:2458 #4 0x00007ffff1fd2d27 in glsl_to_tgsi_visitor::visit (this=0x7b8680, ir=) at ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:1202 #5 0x00007ffff2096955 in visit_exec_list (list=, visitor=visitor@entry=0x7b8680) at ../../../src/glsl/ir.cpp:1738 #6 0x00007ffff1ff2a46 in get_mesa_program (shader=0x7c18a0, shader_program=0x7bf120, ctx=0x7729c0) at ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:5240 #7 st_link_shader (ctx=0x7729c0, prog=0x7bf120) at ../../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:5474 #8 0x00007ffff200e737 in _mesa_glsl_link_shader (ctx=0x7729c0, prog=0x7bf120) at ../../../src/mesa/program/ir_to_mesa.cpp:3082 #9 0x00007ffff1f0cd29 in link_program (program=4, ctx=0x7729c0) at ../../../src/mesa/main/shaderapi.c:915 #10 _mesa_create_shader_program (separate=1 '\001', strings=, count=, type=, ctx=0x7729c0) at ../../../src/mesa/main/shaderapi.c:1847 #11 _mesa_CreateShaderProgramv (type=, count=, strings=) at ../../../src/mesa/main/shaderapi.c:1920 #12 0x000000000040189d in main () at main.c:113