[Piglit] [PATCH 17/18] arb_geometry_shader4: Test gl_TexCoordIn indexing.

Paul Berry stereotype441 at gmail.com
Sun Jun 16 22:06:08 PDT 2013


On 26 May 2013 15:49, Fabian Bieler <fabianbieler at fastmail.fm> wrote:

> >From the ARB_geometry_shader4 spec (section ):
> "Indices used to subscript gl_TexCoord must either be an integral constant
> expressions, or this array must be re-declared by the shader with a size."
>
> And from the GLSL 1.1 spec page 99 (page 105 of the PDF):
> "Multiple modules can declare it [gl_TexCoord] with different sizes, the
> maximum will be used at link time."
>
> Presumably, this also applies to gl_TexCoordIn.
>

Can we beef up this test so that the VS assigns different values to each
element of gl_TexCoord for each vertex, and the GS checks that the values
it receives are correct?


> ---
>  .../execution/texcoord01.shader_test               | 56
> ++++++++++++++++++++
>  .../execution/texcoord02.shader_test               | 60
> ++++++++++++++++++++++
>  2 files changed, 116 insertions(+)
>  create mode 100644
> tests/spec/arb_geometry_shader4/execution/texcoord01.shader_test
>  create mode 100644
> tests/spec/arb_geometry_shader4/execution/texcoord02.shader_test
>
> diff --git
> a/tests/spec/arb_geometry_shader4/execution/texcoord01.shader_test
> b/tests/spec/arb_geometry_shader4/execution/texcoord01.shader_test
> new file mode 100644
> index 0000000..70c4eb2
> --- /dev/null
> +++ b/tests/spec/arb_geometry_shader4/execution/texcoord01.shader_test
> @@ -0,0 +1,56 @@
> +# Test accessing glTexCoordIn without redeclaration but with constant
> indices.
> +[require]
> +GL >= 2.0
> +GLSL >= 1.10
> +GL_ARB_geometry_shader4
> +
> +[vertex shader]
> +#version 110
> +
> +attribute vec4 vertex;
> +
> +void main()
> +{
> +       gl_TexCoord[0] = vertex;
> +       gl_TexCoord[1] = vertex;
> +       gl_TexCoord[2] = vertex;
> +       gl_Position = vec4(0);
> +}
> +
> +[geometry shader]
> +#version 110
> +#extension GL_ARB_geometry_shader4: enable
> +
> +void main()
> +{
> +       gl_Position = gl_TexCoordIn[0][2];
> +       EmitVertex();
> +       gl_Position = gl_TexCoordIn[1][1];
> +       EmitVertex();
> +       gl_Position = gl_TexCoordIn[2][0];
> +       EmitVertex();
> +}
> +
> +[geometry layout]
> +input type GL_TRIANGLES
> +output type GL_TRIANGLE_STRIP
> +vertices out 3
> +
> +[fragment shader]
> +#version 110
> +
> +void main()
> +{
> +       gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgb 1.0 1.0 1.0
> diff --git
> a/tests/spec/arb_geometry_shader4/execution/texcoord02.shader_test
> b/tests/spec/arb_geometry_shader4/execution/texcoord02.shader_test
> new file mode 100644
> index 0000000..7a7a751
> --- /dev/null
> +++ b/tests/spec/arb_geometry_shader4/execution/texcoord02.shader_test
> @@ -0,0 +1,60 @@
> +# Test accessing glTexCoordIn with redeclaration (with explicit size) and
> with non-constant indices.
> +[require]
> +GL >= 2.0
> +GLSL >= 1.10
> +GL_ARB_geometry_shader4
> +
> +[vertex shader]
> +#version 110
> +
> +uniform int one;
> +attribute vec4 vertex;
> +varying vec4 gl_TexCoord[2];
> +
> +void main()
> +{
> +       gl_TexCoord[one] = vertex;
> +       gl_Position = vec4(0);
> +}
> +
> +[geometry shader]
> +#version 110
> +#extension GL_ARB_geometry_shader4: enable
> +
> +uniform int one;
> +varying in vec4 gl_TexCoordIn[][3];
> +
> +void main()
> +{
> +       gl_Position = gl_TexCoordIn[0][one];
> +       EmitVertex();
> +       gl_Position = gl_TexCoordIn[1][one];
> +       EmitVertex();
> +       gl_Position = gl_TexCoordIn[2][one];
> +       EmitVertex();
> +}
> +
> +[geometry layout]
> +input type GL_TRIANGLES
> +output type GL_TRIANGLE_STRIP
> +vertices out 3
> +
> +[fragment shader]
> +#version 110
> +
> +void main()
> +{
> +       gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +uniform int one 1
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgb 1.0 1.0 1.0
> --
> 1.8.1.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130617/324a3204/attachment-0001.html>


More information about the Piglit mailing list