[Piglit] [PATCH v2] arb_tessellation_shader: add simple data passing tests

Chris Forbes chrisf at ijw.co.nz
Wed Aug 27 20:37:02 PDT 2014


Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

On Thu, Aug 28, 2014 at 3:33 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>
> v1 -> v2:
>  - use passthrough vertex shader where possible
>  - add a test without tcs
>
> These all pass on nvidia blob
>
>  .../execution/tcs-tes-patch.shader_test            | 58 ++++++++++++++++++
>  .../execution/tcs-tes-vertex.shader_test           | 61 +++++++++++++++++++
>  .../execution/tes-fs.shader_test                   | 54 +++++++++++++++++
>  .../execution/vs-tcs-tes-vertex.shader_test        | 70 ++++++++++++++++++++++
>  .../execution/vs-tes-vertex.shader_test            | 55 +++++++++++++++++
>  5 files changed, 298 insertions(+)
>  create mode 100644 tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test
>  create mode 100644 tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test
>  create mode 100644 tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test
>  create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test
>  create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test
>
> diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test
> new file mode 100644
> index 0000000..a902c00
> --- /dev/null
> +++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test
> @@ -0,0 +1,58 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_tessellation_shader
> +
> +
> +[vertex shader passthrough]
> +
> +[tessellation control shader]
> +#extension GL_ARB_tessellation_shader: require
> +layout(vertices = 3) out;
> +
> +patch 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 = vec4(0, 1, 0, 1);
> +}
> +
> +
> +[tessellation evaluation shader]
> +#extension GL_ARB_tessellation_shader: require
> +layout(triangles) in;
> +
> +patch 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;
> +}
> +
> +
> +[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]
> +patch parameter vertices 3
> +draw arrays GL_PATCHES 0 6
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test
> new file mode 100644
> index 0000000..a7dacba
> --- /dev/null
> +++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test
> @@ -0,0 +1,61 @@
> +[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]
> +patch parameter vertices 3
> +draw arrays GL_PATCHES 0 6
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test b/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test
> new file mode 100644
> index 0000000..73632d1
> --- /dev/null
> +++ b/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test
> @@ -0,0 +1,54 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_tessellation_shader
> +
> +
> +[vertex shader passthrough]
> +
> +[tessellation control shader]
> +#extension GL_ARB_tessellation_shader: require
> +layout(vertices = 3) out;
> +
> +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);
> +}
> +
> +
> +[tessellation evaluation shader]
> +#extension GL_ARB_tessellation_shader: require
> +layout(triangles) in;
> +
> +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 = vec4(0, 1, 0, 1);
> +}
> +
> +
> +[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]
> +patch parameter vertices 3
> +draw arrays GL_PATCHES 0 6
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test
> new file mode 100644
> index 0000000..550ff25
> --- /dev/null
> +++ b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test
> @@ -0,0 +1,70 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_tessellation_shader
> +
> +
> +[vertex shader]
> +in vec4 vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +       gl_Position = vertex;
> +       color = vec4(0, 1, 0, 1);
> +}
> +
> +
> +[tessellation control shader]
> +#extension GL_ARB_tessellation_shader: require
> +layout(vertices = 3) out;
> +
> +in vec4 color[];
> +out vec4 color_tes[];
> +
> +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_tes[gl_InvocationID] = color[gl_InvocationID];
> +}
> +
> +
> +[tessellation evaluation shader]
> +#extension GL_ARB_tessellation_shader: require
> +layout(triangles) in;
> +
> +in vec4 color_tes[];
> +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_tes[0] * gl_TessCoord[0]
> +                  + color_tes[1] * gl_TessCoord[1]
> +                  + color_tes[2] * gl_TessCoord[2];
> +}
> +
> +
> +[fragment shader]
> +in vec4 color_fs;
> +
> +void main()
> +{
> +       gl_FragColor = color_fs;
> +}
> +
> +[vertex data]
> +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]
> +patch parameter vertices 3
> +draw arrays GL_PATCHES 0 6
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test
> new file mode 100644
> index 0000000..9bf5098
> --- /dev/null
> +++ b/tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test
> @@ -0,0 +1,55 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_tessellation_shader
> +
> +
> +[vertex shader]
> +in vec4 vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +       gl_Position = vertex;
> +       color = 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]
> +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]
> +patch parameter vertices 3
> +draw arrays GL_PATCHES 0 6
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 1.8.5.5
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list