[Piglit] [PATCH V2 2/2] glsl-1.50: Add shader tests to verify gl_FragCoord redeclarations

Jordan Justen jljusten at gmail.com
Fri May 16 16:59:24 PDT 2014


On Thu, Mar 6, 2014 at 4:11 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> V2: Add few more shader tests and do minor changes in tests added in V1.
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  ...ayout-qualifiers-conflicting-case-5.shader_test | 62 ++++++++++++++++++++++
>  ...ayout-qualifiers-conflicting-case-6.shader_test | 61 +++++++++++++++++++++
>  ...ayout-qualifiers-conflicting-case-7.shader_test | 50 +++++++++++++++++
>  ...ayout-qualifiers-conflicting-case-8.shader_test | 61 +++++++++++++++++++++
>  ...ayout-qualifiers-conflicting-case-9.shader_test | 49 +++++++++++++++++
>  5 files changed, 283 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-5.shader_test
>  create mode 100644 tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-6.shader_test
>  create mode 100644 tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-7.shader_test
>  create mode 100644 tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-8.shader_test
>  create mode 100644 tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-9.shader_test
<snip>
> diff --git a/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-7.shader_test b/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-7.shader_test
> new file mode 100644
> index 0000000..259e095
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-7.shader_test
> @@ -0,0 +1,50 @@
> +/* Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says:
> + *
> + *     "Fragment shaders can have an input layout only for redeclaring the
> + *     built-in variable gl_FragCoord (see section 7.2 Fragment Shader
> + *     Special Variables). The layout qualifier identifiers for
> + *     gl_FragCoord are
> + *
> + *     layout-qualifier-id:
> + *         origin_upper_left
> + *         pixel_center_integer"
> + *
> + *
> + *     "If gl_FragCoord is redeclared in any fragment shader in a program,
> + *      it must be redeclared in all the fragment shaders in that program
> + *      that have a static use gl_FragCoord. All redeclarations of
> + *      gl_FragCoord in all fragment shaders in a single program must have
> + *      the same set of qualifiers."
> + *
> + * Tests the case when one fragment shader redeclares gl_FragCoord without
> + * any qualifiers and other one has missing redeclaration. Spec is not very
> + * clear about this case but making this case fail to link would be wrong.

If the spec is not clear, then does this pass with most drivers then?

Series Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

> + */
> +[require]
> +GLSL >= 1.50
> +
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +
> +in vec4 gl_FragCoord;
> +out vec4 fragcolor;
> +void alpha();
> +void main()
> +{
> +     fragcolor = vec4(gl_FragCoord.xyz, 1.0);
> +     alpha();
> +}
> +
> +[fragment shader]
> +
> +out vec4 fragcolor;
> +void alpha()
> +{
> +     fragcolor.a = gl_FragCoord.z;
> +}
> +
> +
> +[test]
> +link success


More information about the Piglit mailing list