[Piglit] [PATCH] sso: Add compile tests for the location layout qualifier
Ian Romanick
idr at freedesktop.org
Fri Oct 4 09:06:12 PDT 2013
On 10/03/2013 04:33 PM, Wen Su wrote:
> Piers and I reviewed the glsl spec v1.3 and v1.4. The layout qualifier was not added until v1.4. See page 18 in the pdf below.
> http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.40.05.pdf
That is true. It is also added by GL_ARB_fragment_coord_conventions,
GL_ARB_explicit_attrib_layout, and GL_ARB_separate_shader_objects. Our
experiments have shown that the NVIDIA driver enables the layout keyword
only when GL_ARB_fragment_coord_conventions is enabled.
See also Khronos internal bug #6924.
> Wen
>
> -----Original Message-----
> From: Ian Romanick [mailto:idr at freedesktop.org]
> Sent: Wednesday, October 02, 2013 11:05 AM
> To: piglit at lists.freedesktop.org
> Cc: Ian Romanick; Wen Su; Paul Berry
> Subject: [PATCH] sso: Add compile tests for the location layout qualifier
>
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> NVIDIA (304.64 on GTX 260) fails all of the 1.10, 1.20, and 1.30 tests
> because they fail to recognize the layout keyword at all. Paul has
> suggested that adding
>
> #extension GL_ARB_fragment_coord_conventions: require
>
> may work around this issue in some cases.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Wen Su <WSu at nvidia.com>
> Cc: Paul Berry <stereotype441 at gmail.com>
> ---
> Paul,
>
> Are there other geometry shader tests that I should add?
>
> .../compiler/1.10/layout-location.frag | 14 ++++++++++++++
> .../compiler/1.10/layout-location.vert | 15 +++++++++++++++
> .../compiler/1.20/layout-location.frag | 14 ++++++++++++++
> .../compiler/1.20/layout-location.vert | 15 +++++++++++++++
> .../compiler/1.30/layout-location.frag | 14 ++++++++++++++
> .../compiler/1.30/layout-location.vert | 15 +++++++++++++++
> .../compiler/1.40/layout-location.frag | 15 +++++++++++++++
> .../compiler/1.40/layout-location.vert | 16 ++++++++++++++++
> .../compiler/1.50/layout-location.frag | 15 +++++++++++++++
> .../compiler/1.50/layout-location.geom | 22 ++++++++++++++++++++++
> .../compiler/1.50/layout-location.vert | 16 ++++++++++++++++
> 11 files changed, 171 insertions(+)
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.frag
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.vert
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.frag
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.vert
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.frag
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.vert
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.frag
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.vert
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.frag
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.geom
> create mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.vert
>
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.frag b/tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.frag
> new file mode 100644
> index 0000000..b91faa1
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.frag
> @@ -0,0 +1,14 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.10
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 110
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(location = 0) in vec4 a;
> +
> +void main()
> +{
> + gl_FragColor = a;
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.vert b/tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.vert
> new file mode 100644
> index 0000000..ecc8e78
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.10/layout-location.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.10
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 110
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(location = 0) out vec4 a;
> +
> +void main()
> +{
> + gl_Position = gl_Vertex;
> + a = vec4(0);
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.frag b/tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.frag
> new file mode 100644
> index 0000000..0090a9f
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.frag
> @@ -0,0 +1,14 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.20
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 120
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(location = 0) in vec4 a;
> +
> +void main()
> +{
> + gl_FragColor = a;
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.vert b/tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.vert
> new file mode 100644
> index 0000000..d432b81
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.20/layout-location.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.20
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 120
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(location = 0) out vec4 a;
> +
> +void main()
> +{
> + gl_Position = gl_Vertex;
> + a = vec4(0);
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.frag b/tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.frag
> new file mode 100644
> index 0000000..a0dde35
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.frag
> @@ -0,0 +1,14 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.30
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 130
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(location = 0) in vec4 a;
> +
> +void main()
> +{
> + gl_FragColor = a;
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.vert b/tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.vert
> new file mode 100644
> index 0000000..104dc71
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.30/layout-location.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.30
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 130
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(location = 0) out vec4 a;
> +
> +void main()
> +{
> + gl_Position = gl_Vertex;
> + a = vec4(0);
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.frag b/tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.frag
> new file mode 100644
> index 0000000..683892d
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.frag
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 140
> +#extension GL_ARB_separate_shader_objects: require
> +
> +out vec4 fragcolor;
> +layout(location = 0) in vec4 a;
> +
> +void main()
> +{
> + fragcolor = a;
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.vert b/tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.vert
> new file mode 100644
> index 0000000..8c55c4a
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.40/layout-location.vert
> @@ -0,0 +1,16 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 140
> +#extension GL_ARB_separate_shader_objects: require
> +
> +in vec4 piglit_vertex;
> +layout(location = 0) out vec4 a;
> +
> +void main()
> +{
> + gl_Position = piglit_vertex;
> + a = vec4(0);
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.frag b/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.frag
> new file mode 100644
> index 0000000..63fafe7
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.frag
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 150
> +#extension GL_ARB_separate_shader_objects: require
> +
> +out vec4 fragcolor;
> +layout(location = 0) in vec4 a;
> +
> +void main()
> +{
> + fragcolor = a;
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.geom b/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.geom
> new file mode 100644
> index 0000000..f34cf2e
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.geom
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 150
> +#extension GL_ARB_separate_shader_objects: require
> +
> +layout(points) in;
> +layout(points) out;
> +
> +layout(location = 0) in vec4 in_position;
> +
> +layout(location = 0) out vec4 position;
> +layout(location = 1) out vec4 color;
> +
> +void main()
> +{
> + position = in_position;
> + color = vec4(0);
> + EmitVertex();
> +}
> diff --git a/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.vert b/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.vert
> new file mode 100644
> index 0000000..9885718
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/compiler/1.50/layout-location.vert
> @@ -0,0 +1,16 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_separate_shader_objects
> +// [end config]
> +#version 150
> +#extension GL_ARB_separate_shader_objects: require
> +
> +in vec4 piglit_vertex;
> +layout(location = 0) out vec4 a;
> +
> +void main()
> +{
> + gl_Position = piglit_vertex;
> + a = vec4(0);
> +}
>
More information about the Piglit
mailing list