[Piglit] [PATCH 2/3] arb_tessellation_shader: add basic display list test for glPatchParameteri()
Timothy Arceri
tarceri at itsqueeze.com
Mon May 28 11:22:54 UTC 2018
This and the following patch should have:
GL COMPAT >= 3.2
I've fixed this locally.
On 28/05/18 20:36, Timothy Arceri wrote:
> ---
> .../tcs-tes-vertex-dlist.shader_test | 89 +++++++++++++++++++
> 1 file changed, 89 insertions(+)
> create mode 100644 tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex-dlist.shader_test
>
> diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex-dlist.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex-dlist.shader_test
> new file mode 100644
> index 000000000..bcae48cd4
> --- /dev/null
> +++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex-dlist.shader_test
> @@ -0,0 +1,89 @@
> +[require]
> +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
>
More information about the Piglit
mailing list