Commit 24372457 authored by Timothy Arceri's avatar Timothy Arceri

arb_tessellation_shader: add basic display list test for glPatchParameteri()

Reviewed-by: 's avatarMarek Olšák <marek.olsak@amd.com>
parent e5ad009b
[require]
GL COMPAT >= 3.2
GLSL >= 1.50
GL_ARB_tessellation_shader
[vertex shader passthrough]
[tessellation control shader]
#extension GL_ARB_tessellation_shader: require
layout(vertices = 3) out;
out vec4 color[];
void main() {
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
gl_TessLevelInner = float[2](0.0, 0.0);
color[gl_InvocationID] = vec4(0, 1, 0, 1);
}
[tessellation evaluation shader]
#extension GL_ARB_tessellation_shader: require
layout(triangles) in;
in vec4 color[];
out vec4 color_fs;
void main() {
gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+ gl_in[1].gl_Position * gl_TessCoord[1]
+ gl_in[2].gl_Position * gl_TessCoord[2];
color_fs = color[0] * gl_TessCoord[0]
+ color[1] * gl_TessCoord[1]
+ color[2] * gl_TessCoord[2];
}
[fragment shader]
in vec4 color_fs;
void main()
{
gl_FragColor = color_fs;
}
[vertex data]
piglit_vertex/float/2
-1.0 -1.0
1.0 -1.0
-1.0 1.0
-1.0 1.0
1.0 -1.0
1.0 1.0
[test]
clear color 0.1 0.1 0.1 0.1
clear
newlist GL_COMPILE
patch parameter vertices 3
draw arrays GL_PATCHES 0 6
endlist
# make sure we haven't drawn anything yet
probe all rgba 0.1 0.1 0.1 0.1
# Set wrong patch param to make sure the call list is respected
patch parameter vertices 4
calllist
probe all rgba 0.0 1.0 0.0 1.0
deletelist
clear color 0.1 0.1 0.1 0.1
clear
# make sure we haven't drawn anything yet
probe all rgba 0.1 0.1 0.1 0.1
newlist GL_COMPILE_AND_EXECUTE
patch parameter vertices 3
draw arrays GL_PATCHES 0 6
endlist
probe all rgba 0.0 1.0 0.0 1.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment