1 # Test that the gl_PrimitiveID input in the TES is correctly set up and starts
2 # at 0 for each instance in instanced draws.
6 GL_ARB_tessellation_shader
12 out int vs_tes_instance;
16 vs_tes_id = gl_VertexID;
17 vs_tes_instance = gl_InstanceID;
20 [tessellation evaluation shader]
22 #extension GL_ARB_tessellation_shader : require
24 layout(quads, equal_spacing) in;
27 in int vs_tes_instance[];
31 gl_Position = vec4(-1.0 + vs_tes_id[0] + gl_TessCoord.x,
32 -1.0 + vs_tes_instance[0] + gl_TessCoord.y,
40 layout(triangle_strip, max_vertices = 3) out;
45 vec4 tmp_color = vec4(0.0, 1.0, gl_PrimitiveIDIn * 0.1, 1.0);
48 gl_Position = gl_in[0].gl_Position;
52 gl_Position = gl_in[1].gl_Position;
56 gl_Position = gl_in[2].gl_Position;
72 clear color 0.0 0.0 0.0 0.0
75 patch parameter default level inner 1 1
76 patch parameter default level outer 1 1 1 1
78 patch parameter vertices 1
79 draw arrays instanced GL_PATCHES 0 2 2
82 relative probe rect rgba (0.0, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0, 1.0)
83 relative probe rect rgba (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.1, 1.0)
86 relative probe rect rgba (0.0, 0.5, 0.5, 0.5) (0.0, 1.0, 0.0, 1.0)
87 relative probe rect rgba (0.5, 0.5, 0.5, 0.5) (0.0, 1.0, 0.1, 1.0)