Re: [Piglit] [PATCH 4/4] ext_shader_samples_identical: Simple fragment shader rendering test

2015-11-18 Thread Ian Romanick
On 11/18/2015 05:46 PM, Ian Romanick wrote:
> From: Ian Romanick 
> 
> Render a simple image.  Scan the image.  At each texel, render blue if
> textureSamplesIdenticalEXT returns false.  If textureSamplesIdenticalEXT
> returns true, examine each sample.  If the samples are all the same
> color, render green.  Render red otherwise.  The test passes if there
> are zero red pixels and non-zero green pixels.

This (and the similar text in the code) were a little backwards.

It renders *green* if textureSamplesIdenticalEXT returns false.

It renders *blue* textureSamplesIdenticalEXT returns true and all the
samples match.

There still must be some green pixels... because there are edges in the
image drawn, and at least one of those must (statistically) have only
partial coverage.  This could probably be made more robust by modifying
the output sample coverage during rendering of some pixels.  Not sure
it's worth the effort.

Anyway... I've fixed the text locally.

> Much code borrowed from tests/spec/arb_texture_multisample/texelfetch.c.
> 
> Note: This is a pretty weak test.  A stronger test would read back the
> original multisampled image and verify the sample-indenticalness using
> that.
> 
> Signed-off-by: Ian Romanick 
> ---
>  tests/all.py   |   9 +
>  .../ext_shader_samples_identical/CMakeLists.gl.txt |  13 +
>  .../ext_shader_samples_identical/CMakeLists.txt|   1 +
>  .../spec/ext_shader_samples_identical/simple-fs.c  | 268 
> +
>  4 files changed, 291 insertions(+)
>  create mode 100644 tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt
>  create mode 100644 tests/spec/ext_shader_samples_identical/CMakeLists.txt
>  create mode 100644 tests/spec/ext_shader_samples_identical/simple-fs.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index e7cbddd..54281a9 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -4528,5 +4528,14 @@ with profile.group_manager(
>  g(['oes_draw_elements_base_vertex-multidrawelements'],
>run_concurrent=False)
>  
> +# Group EXT_shader_samples_identical
> +with profile.group_manager(
> +PiglitGLTest,
> +grouptools.join('spec', 'EXT_shader_samples_identical')) as g:
> +g(['ext_shader_samples_identical', '2'])
> +g(['ext_shader_samples_identical', '4'])
> +g(['ext_shader_samples_identical', '8'])
> +g(['ext_shader_samples_identical', '16'])
> +
>  if platform.system() is 'Windows':
>  profile.filter_tests(lambda p, _: not p.startswith('glx'))
> diff --git a/tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt 
> b/tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt
> new file mode 100644
> index 000..0752483
> --- /dev/null
> +++ b/tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt
> @@ -0,0 +1,13 @@
> +include_directories(
> + ${GLEXT_INCLUDE_DIR}
> + ${OPENGL_INCLUDE_PATH}
> + ${piglit_SOURCE_DIR}/tests/spec/arb_texture_multisample
> +)
> +
> +link_libraries (
> + piglitutil_${piglit_target_api}
> + ${OPENGL_gl_LIBRARY}
> +)
> +
> +piglit_add_executable (ext_shader_samples_identical-simple-fs simple-fs.c)
> +# vim: ft=cmake:
> diff --git a/tests/spec/ext_shader_samples_identical/CMakeLists.txt 
> b/tests/spec/ext_shader_samples_identical/CMakeLists.txt
> new file mode 100644
> index 000..144a306
> --- /dev/null
> +++ b/tests/spec/ext_shader_samples_identical/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> diff --git a/tests/spec/ext_shader_samples_identical/simple-fs.c 
> b/tests/spec/ext_shader_samples_identical/simple-fs.c
> new file mode 100644
> index 000..c6cbfac
> --- /dev/null
> +++ b/tests/spec/ext_shader_samples_identical/simple-fs.c
> @@ -0,0 +1,268 @@
> +/*
> + * Copyright (c) 2015 Intel Corporation
> + * Copyright 2014 VMware, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
>

Re: [Piglit] [PATCH 1/4] arb_texture_multisample: Use piglit_vertex and piglit_texcoord to avoid glGetAttribLocation

2015-11-18 Thread Ian Romanick
On 11/18/2015 06:12 PM, Ilia Mirkin wrote:
> On Wed, Nov 18, 2015 at 8:46 PM, Ian Romanick  wrote:
>> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
>> index a5c42dc..408649d 100644
>> --- a/tests/spec/CMakeLists.txt
>> +++ b/tests/spec/CMakeLists.txt
>> @@ -76,6 +76,7 @@ add_subdirectory (ext_framebuffer_multisample)
>>  add_subdirectory (ext_framebuffer_multisample_blit_scaled)
>>  add_subdirectory (ext_packed_depth_stencil)
>>  add_subdirectory (ext_packed_float)
>> +add_subdirectory (ext_shader_samples_identical)
>>  add_subdirectory (ext_texture_swizzle)
>>  add_subdirectory (ext_timer_query)
>>  add_subdirectory (ext_transform_feedback)
> 
> Not that it *super* matters, but this probably belongs in 4/4...

It would super matter if you were bisecting and happened to hit one of
the commits that (I think) wouldn't build. :(  Fixed locally.


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] arb_texture_multisample: Use piglit_vertex and piglit_texcoord to avoid glGetAttribLocation

2015-11-18 Thread Ilia Mirkin
On Wed, Nov 18, 2015 at 8:46 PM, Ian Romanick  wrote:
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> index a5c42dc..408649d 100644
> --- a/tests/spec/CMakeLists.txt
> +++ b/tests/spec/CMakeLists.txt
> @@ -76,6 +76,7 @@ add_subdirectory (ext_framebuffer_multisample)
>  add_subdirectory (ext_framebuffer_multisample_blit_scaled)
>  add_subdirectory (ext_packed_depth_stencil)
>  add_subdirectory (ext_packed_float)
> +add_subdirectory (ext_shader_samples_identical)
>  add_subdirectory (ext_texture_swizzle)
>  add_subdirectory (ext_timer_query)
>  add_subdirectory (ext_transform_feedback)

Not that it *super* matters, but this probably belongs in 4/4...
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 3/4] ext_shader_samples_identical: Verify that every function overload exists

2015-11-18 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 .../glsl-1.10/compiler/all-functions.frag  | 21 +
 .../glsl-1.10/compiler/all-functions.vert  | 21 +
 .../glsl-1.50/compiler/all-functions.frag  | 30 +++
 .../glsl-1.50/compiler/all-functions.geom  | 34 ++
 .../glsl-1.50/compiler/all-functions.vert  | 32 
 .../glsl-es-3.10/compiler/all-functions.frag   | 31 
 .../glsl-es-3.10/compiler/all-functions.vert   | 32 
 7 files changed, 201 insertions(+)
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.frag
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.vert
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.frag
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.geom
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.vert
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-es-3.10/compiler/all-functions.frag
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-es-3.10/compiler/all-functions.vert

diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.frag 
b/tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.frag
new file mode 100644
index 000..7b81832
--- /dev/null
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// require_extensions: GL_ARB_texture_multisample 
GL_EXT_shader_samples_identical
+// [end config]
+
+#extension GL_ARB_texture_multisample: require
+#extension GL_EXT_shader_samples_identical: require
+
+uniform sampler2DMS s1;
+uniform sampler2DMSArray s4;
+
+void main()
+{
+   const ivec2 p2 = ivec2(10, 10);
+   const ivec3 p3 = ivec3(15, 11, 0);
+
+   gl_FragColor = vec4(float(textureSamplesIdenticalEXT(s1, p2)),
+   float(textureSamplesIdenticalEXT(s4, p3)),
+   0.0, 1.0);
+}
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.vert 
b/tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.vert
new file mode 100644
index 000..739a4df
--- /dev/null
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-1.10/compiler/all-functions.vert
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// require_extensions: GL_ARB_texture_multisample 
GL_EXT_shader_samples_identical
+// [end config]
+
+#extension GL_ARB_texture_multisample: require
+#extension GL_EXT_shader_samples_identical: require
+
+uniform sampler2DMS s1;
+uniform sampler2DMSArray s4;
+
+void main()
+{
+   const ivec2 p2 = ivec2(10, 10);
+   const ivec3 p3 = ivec3(15, 11, 0);
+
+   gl_Position = vec4(float(textureSamplesIdenticalEXT(s1, p2)),
+  float(textureSamplesIdenticalEXT(s4, p3)),
+  0.0, 1.0);
+}
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.frag 
b/tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.frag
new file mode 100644
index 000..ede552c
--- /dev/null
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.frag
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_EXT_shader_samples_identical
+// [end config]
+
+#version 150
+#extension GL_EXT_shader_samples_identical: require
+
+uniform sampler2DMS s1;
+uniform isampler2DMS s2;
+uniform usampler2DMS s3;
+uniform sampler2DMSArray s4;
+uniform isampler2DMSArray s5;
+uniform usampler2DMSArray s6;
+
+out vec2 data;
+
+void main()
+{
+   const ivec2 p2 = ivec2(10, 10);
+   const ivec3 p3 = ivec3(15, 11, 0);
+
+   data = vec2(float(textureSamplesIdenticalEXT(s1, p2)) +
+   float(textureSamplesIdenticalEXT(s2, p2)) +
+   float(textureSamplesIdenticalEXT(s3, p2)),
+   float(textureSamplesIdenticalEXT(s4, p3)) +
+   float(textureSamplesIdenticalEXT(s5, p3)) +
+   float(textureSamplesIdenticalEXT(s6, p3)));
+}
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.geom 
b/tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.geom
new file mode 100644
index 000..8247e1d
--- /dev/null
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-1.50/compiler/all-functions.geom
@@ -0,0 +1,34 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_texture_multisample 
GL_EXT_shader_samples_identical
+// [end config]
+
+#version 150
+#extension GL_ARB_texture_multisample: require
+#extension GL_EXT_shader_

[Piglit] [PATCH 1/4] arb_texture_multisample: Use piglit_vertex and piglit_texcoord to avoid glGetAttribLocation

2015-11-18 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 tests/spec/CMakeLists.txt   |  1 +
 tests/spec/arb_texture_multisample/texelfetch.c | 34 +++--
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index a5c42dc..408649d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -76,6 +76,7 @@ add_subdirectory (ext_framebuffer_multisample)
 add_subdirectory (ext_framebuffer_multisample_blit_scaled)
 add_subdirectory (ext_packed_depth_stencil)
 add_subdirectory (ext_packed_float)
+add_subdirectory (ext_shader_samples_identical)
 add_subdirectory (ext_texture_swizzle)
 add_subdirectory (ext_timer_query)
 add_subdirectory (ext_transform_feedback)
diff --git a/tests/spec/arb_texture_multisample/texelfetch.c 
b/tests/spec/arb_texture_multisample/texelfetch.c
index 96723a9..9e3d8ec 100644
--- a/tests/spec/arb_texture_multisample/texelfetch.c
+++ b/tests/spec/arb_texture_multisample/texelfetch.c
@@ -53,9 +53,9 @@ PIGLIT_GL_TEST_CONFIG_END
 
 static const char *vs_src_draw =
"#version 130 \n"
-   "in vec4 pos;\n"
+   "in vec4 piglit_vertex;\n"
"void main() { \n"
-   "   gl_Position = pos; \n"
+   "   gl_Position = piglit_vertex; \n"
"} \n";
 
 static const char *fs_src_draw =
@@ -67,12 +67,12 @@ static const char *fs_src_draw =
 
 static const char *vs_src_readback =
"#version 130 \n"
-   "in vec4 pos; \n"
-   "in vec2 coord_vs;\n"
+   "in vec4 piglit_vertex; \n"
+   "in vec2 piglit_texcoord;\n"
"out vec2 coord_fs;\n"
"void main() { \n"
-   "   gl_Position = pos; \n"
-   "   coord_fs = coord_vs; \n"
+   "   gl_Position = piglit_vertex; \n"
+   "   coord_fs = piglit_texcoord; \n"
"} \n";
 
 static const char *fs_src_readback =
@@ -98,7 +98,6 @@ static GLuint tex;
 static GLuint fbo;
 static GLuint readback_prog, draw_prog;
 static GLint sample_pos_uniform;
-static GLint draw_pos_attr, readback_pos_attr, readback_texcoord_attr;
 static int num_samples = 0;
 
 
@@ -139,11 +138,11 @@ piglit_display(void)
piglit_check_gl_error(GL_NO_ERROR);
 
glUseProgram(draw_prog);
-   glVertexAttribPointer(draw_pos_attr, 2, GL_FLOAT,
+   glVertexAttribPointer(PIGLIT_ATTRIB_POS, 2, GL_FLOAT,
  GL_FALSE, 0, tri_verts);
-   glEnableVertexAttribArray(draw_pos_attr);
+   glEnableVertexAttribArray(PIGLIT_ATTRIB_POS);
glDrawArrays(GL_TRIANGLES, 0, 3);
-   glDisableVertexAttribArray(draw_pos_attr);
+   glDisableVertexAttribArray(PIGLIT_ATTRIB_POS);
 
piglit_check_gl_error(GL_NO_ERROR);
 
@@ -168,15 +167,15 @@ piglit_display(void)
/* fetch the i-th sample */
glUniform1i(sample_pos_uniform, i);
 
-   glVertexAttribPointer(readback_pos_attr, 2, GL_FLOAT,
+   glVertexAttribPointer(PIGLIT_ATTRIB_POS, 2, GL_FLOAT,
  GL_FALSE, 0, quad_verts);
-   glVertexAttribPointer(readback_texcoord_attr, 2, GL_FLOAT,
+   glVertexAttribPointer(PIGLIT_ATTRIB_TEX, 2, GL_FLOAT,
  GL_FALSE, 0, quad_texcoords);
-   glEnableVertexAttribArray(readback_pos_attr);
-   glEnableVertexAttribArray(readback_texcoord_attr);
+   glEnableVertexAttribArray(PIGLIT_ATTRIB_POS);
+   glEnableVertexAttribArray(PIGLIT_ATTRIB_TEX);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-   glDisableVertexAttribArray(readback_pos_attr);
-   glDisableVertexAttribArray(readback_texcoord_attr);
+   glDisableVertexAttribArray(PIGLIT_ATTRIB_POS);
+   glDisableVertexAttribArray(PIGLIT_ATTRIB_TEX);
 
glReadPixels(0, 0, 32, 32, GL_RGBA, GL_FLOAT, images[i]);
}
@@ -300,13 +299,10 @@ piglit_init(int argc, char **argv)
tex_uniform = glGetUniformLocation(readback_prog, "tex");
glUniform1i(tex_uniform, 0); /* unit 0 */
sample_pos_uniform = glGetUniformLocation(readback_prog, "samplePos");
-   readback_pos_attr = glGetAttribLocation(readback_prog, "pos");
-   readback_texcoord_attr = glGetAttribLocation(readback_prog, "coord_vs");
 
/* create triangle drawing shader */
draw_prog = piglit_build_simple_program(vs_src_draw, fs_src_draw);
glUseProgram(draw_prog);
-   draw_pos_attr = glGetAttribLocation(draw_prog, "pos");
 
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
-- 
2.1.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/4] ext_shader_samples_identical: add test for preprocessor define

2015-11-18 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 .../glsl-1.10/preprocessor/define.frag| 19 +++
 .../glsl-1.10/preprocessor/define.vert| 19 +++
 .../glsl-1.50/preprocessor/define.geom| 18 ++
 .../glsl-es-3.10/preprocessor/define.frag | 19 +++
 .../glsl-es-3.10/preprocessor/define.vert | 19 +++
 5 files changed, 94 insertions(+)
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.frag
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.vert
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-1.50/preprocessor/define.geom
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.frag
 create mode 100644 
tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.vert

diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.frag 
b/tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.frag
new file mode 100644
index 000..c48232a
--- /dev/null
+++ b/tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// require_extensions: GL_ARB_texture_multisample 
GL_EXT_shader_samples_identical
+// [end config]
+
+#extension GL_ARB_texture_multisample: require
+#extension GL_EXT_shader_samples_identical: require
+
+#if !defined GL_EXT_shader_samples_identical
+#  error GL_EXT_shader_samples_identical is not defined
+#elif GL_EXT_shader_samples_identical != 1
+#  error GL_EXT_shader_samples_identical is not equal to 1
+#endif
+
+/* Some compilers generate spurious errors if a shader does not contain
+ * any code or declarations.
+ */
+int foo(void) { return 1; }
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.vert 
b/tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.vert
new file mode 100644
index 000..c48232a
--- /dev/null
+++ b/tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.vert
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// require_extensions: GL_ARB_texture_multisample 
GL_EXT_shader_samples_identical
+// [end config]
+
+#extension GL_ARB_texture_multisample: require
+#extension GL_EXT_shader_samples_identical: require
+
+#if !defined GL_EXT_shader_samples_identical
+#  error GL_EXT_shader_samples_identical is not defined
+#elif GL_EXT_shader_samples_identical != 1
+#  error GL_EXT_shader_samples_identical is not equal to 1
+#endif
+
+/* Some compilers generate spurious errors if a shader does not contain
+ * any code or declarations.
+ */
+int foo(void) { return 1; }
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-1.50/preprocessor/define.geom 
b/tests/spec/ext_shader_samples_identical/glsl-1.50/preprocessor/define.geom
new file mode 100644
index 000..c7d677a
--- /dev/null
+++ b/tests/spec/ext_shader_samples_identical/glsl-1.50/preprocessor/define.geom
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_EXT_shader_samples_identical
+// [end config]
+
+#extension GL_EXT_shader_samples_identical: require
+
+#if !defined GL_EXT_shader_samples_identical
+#  error GL_EXT_shader_samples_identical is not defined
+#elif GL_EXT_shader_samples_identical != 1
+#  error GL_EXT_shader_samples_identical is not equal to 1
+#endif
+
+/* Some compilers generate spurious errors if a shader does not contain
+ * any code or declarations.
+ */
+int foo(void) { return 1; }
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.frag 
b/tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.frag
new file mode 100644
index 000..00a1d1c
--- /dev/null
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 3.10
+// require_extensions: GL_EXT_shader_samples_identical
+// [end config]
+
+#version 310 es
+#extension GL_EXT_shader_samples_identical: require
+
+#if !defined GL_EXT_shader_samples_identical
+#  error GL_EXT_shader_samples_identical is not defined
+#elif GL_EXT_shader_samples_identical != 1
+#  error GL_EXT_shader_samples_identical is not equal to 1
+#endif
+
+/* Some compilers generate spurious errors if a shader does not contain
+ * any code or declarations.
+ */
+int foo(void) { return 1; }
diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.vert 
b/tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.vert
new file mode 100644
index 000..00a1d1c
--- /dev/null
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.vert
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// gls

[Piglit] [PATCH 4/4] ext_shader_samples_identical: Simple fragment shader rendering test

2015-11-18 Thread Ian Romanick
From: Ian Romanick 

Render a simple image.  Scan the image.  At each texel, render blue if
textureSamplesIdenticalEXT returns false.  If textureSamplesIdenticalEXT
returns true, examine each sample.  If the samples are all the same
color, render green.  Render red otherwise.  The test passes if there
are zero red pixels and non-zero green pixels.

Much code borrowed from tests/spec/arb_texture_multisample/texelfetch.c.

Note: This is a pretty weak test.  A stronger test would read back the
original multisampled image and verify the sample-indenticalness using
that.

Signed-off-by: Ian Romanick 
---
 tests/all.py   |   9 +
 .../ext_shader_samples_identical/CMakeLists.gl.txt |  13 +
 .../ext_shader_samples_identical/CMakeLists.txt|   1 +
 .../spec/ext_shader_samples_identical/simple-fs.c  | 268 +
 4 files changed, 291 insertions(+)
 create mode 100644 tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt
 create mode 100644 tests/spec/ext_shader_samples_identical/CMakeLists.txt
 create mode 100644 tests/spec/ext_shader_samples_identical/simple-fs.c

diff --git a/tests/all.py b/tests/all.py
index e7cbddd..54281a9 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4528,5 +4528,14 @@ with profile.group_manager(
 g(['oes_draw_elements_base_vertex-multidrawelements'],
   run_concurrent=False)
 
+# Group EXT_shader_samples_identical
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'EXT_shader_samples_identical')) as g:
+g(['ext_shader_samples_identical', '2'])
+g(['ext_shader_samples_identical', '4'])
+g(['ext_shader_samples_identical', '8'])
+g(['ext_shader_samples_identical', '16'])
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt 
b/tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt
new file mode 100644
index 000..0752483
--- /dev/null
+++ b/tests/spec/ext_shader_samples_identical/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/spec/arb_texture_multisample
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (ext_shader_samples_identical-simple-fs simple-fs.c)
+# vim: ft=cmake:
diff --git a/tests/spec/ext_shader_samples_identical/CMakeLists.txt 
b/tests/spec/ext_shader_samples_identical/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/ext_shader_samples_identical/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/ext_shader_samples_identical/simple-fs.c 
b/tests/spec/ext_shader_samples_identical/simple-fs.c
new file mode 100644
index 000..c6cbfac
--- /dev/null
+++ b/tests/spec/ext_shader_samples_identical/simple-fs.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2015 Intel Corporation
+ * Copyright 2014 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/** \file simple-fs.c
+ * Simple fragment shader test for textureSamplesIdenticalEXT.
+ *
+ * Render a simple image.  Scan the image.  At each texel, render blue if
+ * textureSamplesIdenticalEXT returns false.  If textureSamplesIdenticalEXT
+ * returns true, examine each sample.  If the samples are all the same color,
+ * render green.  Render red otherwise.  The test passes if there are zero red
+ * pixels and non-zero green pixels.
+ *
+ * Much code borrowed from tests/spec/arb_texture_multisample/texelfetch.c.
+ *
+ * \note
+ * This is a pretty weak test.  A stronger test would read back the original
+ * multisampled image and verify the sample-indenticalness using that.
+ */
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+config.supports_gl_compat_version = 30;
+confi

Re: [Piglit] [PATCH 1/2] SSO: new test to ensure correct deadcode optimization

2015-11-18 Thread Timothy Arceri
On Thu, 2015-11-19 at 12:14 +1100, Timothy Arceri wrote:
> On Tue, 2015-11-03 at 20:09 +0100, Gregory Hainaut wrote:
> > Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783
> > 
> > Mostly "Validated" on Nvidia driver. Nvidia fails to link
> > vs_fs_prog_separate_inactive
> 
> It also fails to link on the i965 driver.
> 
> Failed to link: error: fragment shader uses too many input components (252 >
> 128)

Actually thats only with your patch to disable the dead code opt which
suggests Nvidia is not optimising away things for separable programs which
makes sense.

> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] SSO: new test to ensure correct deadcode optimization

2015-11-18 Thread Timothy Arceri
On Tue, 2015-11-03 at 20:09 +0100, Gregory Hainaut wrote:
> Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783
> 
> Mostly "Validated" on Nvidia driver. Nvidia fails to link
> vs_fs_prog_separate_inactive

It also fails to link on the i965 driver.

Failed to link: error: fragment shader uses too many input components (252 >
128)

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] SSO: new test to ensure correct deadcode optimization

2015-11-18 Thread Timothy Arceri
On Tue, 2015-11-03 at 20:09 +0100, Gregory Hainaut wrote:
> Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783
> 
> Mostly "Validated" on Nvidia driver. Nvidia fails to link
> vs_fs_prog_separate_inactive
> 
> v3: add the test to all.py
> 
> v2:
> * Test both output and input are still active
> * Test real interstage variable are still optimized
> * Mix rendezvous by name and location
> 
> Signed-off-by: Gregory Hainaut 
> ---
>  tests/all.py   |   2 +
>  .../arb_separate_shader_objects/CMakeLists.gl.txt  |   1 +
>  .../rendezvous_by_name.c   | 358
> +
>  3 files changed, 361 insertions(+)
>  create mode 100644
> tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index acfc586..35c330b 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2145,6 +2145,8 @@ with profile.group_manager(
>'UseProgramStages - non-separable program')
>  g(['arb_separate_shader_object-ProgramUniform-coverage'],
>'ProgramUniform coverage')
> +g(['arb_separate_shader_object-rendezvous_by_name'],
> +  'Rendez vous by name')
>  g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'],
>'Rendezvous by location', run_concurrent=False)
>  g(['arb_separate_shader_object-rendezvous_by_location-5-stages'],
> diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> index f1b15c0..9ab6606 100644
> --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> @@ -18,5 +18,6 @@ piglit_add_executable (arb_separate_shader_object
> -ProgramUniform-coverage Progra
>  piglit_add_executable (arb_separate_shader_object-rendezvous_by_location
> rendezvous_by_location.c)
>  piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3
> -stages rendezvous_by_location-3-stages.c)
>  piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5
> -stages rendezvous_by_location-5-stages.c)
> +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name
> rendezvous_by_name.c)
>  piglit_add_executable (arb_separate_shader_object-UseProgramStages-non
> -separable UseProgramStages-non-separable.c)
>  piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline
> ValidateProgramPipeline.c)
> diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
> b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
> new file mode 100644
> index 000..c8d3b20
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c
> @@ -0,0 +1,358 @@
> +/*
> + * Copyright © 2015 Gregory Hainaut 
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
> OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +/**
> + * \file rendezvous_by_name.c
> + * Simple test for separate shader objects that use rendezvous-by-name.
> + *
> + * Related to issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783
> + *
> + * The test ensures deadcode optimization of input variables doesn't break
> + * the rendezvous by name of the variables.
> + */
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> + config.supports_gl_compat_version = 10;
> + config.window_visual = PIGLIT_GL_VISUAL_RGB |
> PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static GLuint pipeline_3_out_1_in[2];
> +static GLuint pipeline_1_out_3_in[2];
> +static GLuint pipeline_inactive;
> +static GLint  vs_fs_prog_inactive;
> +
> +static const char *vs_code_3_out_template =
> + "#version %d\n"
> + "#extension GL_ARB_separate_shader_objects: require\n"
> + "#extension GL_ARB_explicit_attrib_location: require\n"
> + "\n"
> + "layout(location = 0) in vec4 piglit_vertex;\

Re: [Piglit] [PATCH 1/2] arb_gpu_shader_fp64: fix wrong use of GLSL version

2015-11-18 Thread Dave Airlie
On 19 November 2015 at 02:05, Emil Velikov  wrote:
> On 17 November 2015 at 15:25, Samuel Pitoiset  
> wrote:
>> piglit_require_GLSL_version() requires an integer as parameter, not a float.
>> This fixes an implicit conversion spotted by Clang.
>>
>> Signed-off-by: Samuel Pitoiset 
>> ---
>>  .../arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c  | 2 
>> +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git 
>> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>>  
>> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>> index ff4b0e0..36b0a2d 100644
>> --- 
>> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>> +++ 
>> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>> @@ -115,7 +115,7 @@ piglit_init(int argc, char **argv)
>> int i;
>>
>> /* Set up test */
>> -   piglit_require_GLSL_version(1.50);
>> +   piglit_require_GLSL_version(150);
> I felt bored for a few minutes and had a quick look at the whole of
> piglit. This is the only case where we implicitly or explicitly try to
> feed an incorrect value (float in this case) into
> piglit_require_GLSL_version().

Do I win a prize? :-P
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] arb_gpu_shader_fp64: fix wrong use of GLSL version

2015-11-18 Thread Emil Velikov
On 17 November 2015 at 15:25, Samuel Pitoiset  wrote:
> piglit_require_GLSL_version() requires an integer as parameter, not a float.
> This fixes an implicit conversion spotted by Clang.
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  .../arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c  | 2 
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git 
> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>  
> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
> index ff4b0e0..36b0a2d 100644
> --- 
> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
> +++ 
> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
> @@ -115,7 +115,7 @@ piglit_init(int argc, char **argv)
> int i;
>
> /* Set up test */
> -   piglit_require_GLSL_version(1.50);
> +   piglit_require_GLSL_version(150);
I felt bored for a few minutes and had a quick look at the whole of
piglit. This is the only case where we implicitly or explicitly try to
feed an incorrect value (float in this case) into
piglit_require_GLSL_version().

In case anyone is interested :P
-Emil
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_separate_shader_objects: test mixed explicit and non-explicit locations

2015-11-18 Thread Gregory Hainaut
Hello Timothy,

Normally the first of the 2 new SSO tests that I sent a couple of
weeks ago cover this case. However my test is limited to the first
location.

Hopefully my Mesa patches take care of the issue. I will check it with
this new test (and rebase my patches)

Best regards,
Gregory

On 11/17/15, Timothy Arceri  wrote:
> This tests a bug in Mesa where explicit locations are not taken into
> account when assigning varying locations which results in two
> inputs/outputs being given the same location.
>
> Test results:
> Nvidia GeForce 840M - NVIDIA 352.41: pass
> i965 - Mesa 11.1-dev: fail
>
> Cc: Ian Romanick 
> Cc: Gregory Hainaut 
> ---
>  tests/all.py   |   2 +
>  .../arb_separate_shader_objects/CMakeLists.gl.txt  |   1 +
>  .../mixed_explicit_and_non_explicit_locations.c| 158
> +
>  3 files changed, 161 insertions(+)
>  create mode 100644
> tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 4d6c781..376cad0 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2150,6 +2150,8 @@ with profile.group_manager(
>'UseProgramStages - non-separable program')
>  g(['arb_separate_shader_object-ProgramUniform-coverage'],
>'ProgramUniform coverage')
> +
> g(['arb_separate_shader_object-mixed_explicit_and_non_explicit_locations',
> '-fbo'],
> +  'Mixed explicit and non-explicit locations', run_concurrent=False)
>  g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'],
>'Rendezvous by location', run_concurrent=False)
>  g(['arb_separate_shader_object-rendezvous_by_location-5-stages'],
> diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> index f1b15c0..e8311e3 100644
> --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
> @@ -15,6 +15,7 @@ piglit_add_executable
> (arb_separate_shader_object-compat-builtins compat-builtin
>  piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv
> GetProgramPipelineiv.c)
>  piglit_add_executable (arb_separate_shader_object-IsProgramPipeline
> IsProgramPipeline.c)
>  piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage
> ProgramUniform-coverage.c)
> +piglit_add_executable
> (arb_separate_shader_object-mixed_explicit_and_non_explicit_locations
> mixed_explicit_and_non_explicit_locations.c)
>  piglit_add_executable (arb_separate_shader_object-rendezvous_by_location
> rendezvous_by_location.c)
>  piglit_add_executable
> (arb_separate_shader_object-rendezvous_by_location-3-stages
> rendezvous_by_location-3-stages.c)
>  piglit_add_executable
> (arb_separate_shader_object-rendezvous_by_location-5-stages
> rendezvous_by_location-5-stages.c)
> diff --git
> a/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c
> b/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c
> new file mode 100644
> index 000..d0ad73c
> --- /dev/null
> +++
> b/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c
> @@ -0,0 +1,158 @@
> +/*
> + * Copyright © 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
> OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +/**
> + * This tests a bug in Mesa where explicit locations are not taken into
> + * account when assigning varying locations which results in two
> + * inputs/outputs being given the same location.
> + */
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> + config.supports_gl_compat_version = 10;
> + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static GLuint pipeline;
> +
> +static const char

[Piglit] [PATCH] arb_draw_indirect: test sharing binding point with 2 attribs

2015-11-18 Thread Tapani Pälli
Test passes with Nvidia binary driver and on current Mesa.

Signed-off-by: Tapani Pälli 
---
 tests/all.py   |   1 +
 tests/spec/arb_draw_indirect/CMakeLists.gl.txt |   1 +
 .../arb_draw_indirect/draw-arrays-shared-binding.c | 133 +
 3 files changed, 135 insertions(+)
 create mode 100644 tests/spec/arb_draw_indirect/draw-arrays-shared-binding.c

diff --git a/tests/all.py b/tests/all.py
index 4d6c781..75d3cc7 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1919,6 +1919,7 @@ with profile.group_manager(
 g(['arb_draw_indirect-draw-elements-prim-restart'])
 g(['arb_draw_indirect-draw-elements-prim-restart-ugly'])
 g(['arb_draw_indirect-draw-arrays-instances'])
+g(['arb_draw_indirect-draw-arrays-shared-binding'])
 g(['arb_draw_indirect-vertexid'],
   'gl_VertexID used with glDrawArraysIndirect')
 g(['arb_draw_indirect-vertexid', 'elements'],
diff --git a/tests/spec/arb_draw_indirect/CMakeLists.gl.txt 
b/tests/spec/arb_draw_indirect/CMakeLists.gl.txt
index 471b675..f53eac4 100644
--- a/tests/spec/arb_draw_indirect/CMakeLists.gl.txt
+++ b/tests/spec/arb_draw_indirect/CMakeLists.gl.txt
@@ -18,5 +18,6 @@ piglit_add_executable 
(arb_draw_indirect-draw-elements-prim-restart draw-element
 piglit_add_executable (arb_draw_indirect-draw-elements-prim-restart-ugly 
draw-elements-prim-restart-ugly.c)
 piglit_add_executable (arb_draw_indirect-draw-arrays-instances 
draw-arrays-instances.c)
 piglit_add_executable (arb_draw_indirect-vertexid vertexid.c)
+piglit_add_executable (arb_draw_indirect-draw-arrays-shared-binding 
draw-arrays-shared-binding.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/arb_draw_indirect/draw-arrays-shared-binding.c 
b/tests/spec/arb_draw_indirect/draw-arrays-shared-binding.c
new file mode 100644
index 000..d73f5f8
--- /dev/null
+++ b/tests/spec/arb_draw_indirect/draw-arrays-shared-binding.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * @file draw-arrays-shared-binding.c
+ *
+ * Test creates a VAO and tests sharing binding point with 2 enabled vertex
+ * attribute arrays, one used for vertices and another for output colors.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_core_version = 31;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char vs_text[] =
+   "attribute vec4 vertex;\n"
+   "attribute vec4 colors;\n"
+   "varying vec4 color;\n"
+   "void main() {\n"
+   "gl_Position = vertex;\n"
+   "color = colors;\n"
+   "}";
+
+static const char fs_text[] =
+   "varying vec4 color;\n"
+   "void main() {\n"
+   "gl_FragColor = color;\n"
+   "}";
+
+static const GLfloat rect[] = {
+   -1.0f,  1.0f, 0.0f,
+   1.0f,  1.0f, 0.0f,
+   -1.0f, -1.0f, 0.0f,
+   1.0f, -1.0f, 0.0f,
+};
+
+GLuint indirect_data[] = {
+   4, 1, 0, 0
+};
+
+GLuint vao;
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   unsigned i;
+   GLfloat colors[ARRAY_SIZE(rect)];
+
+   /* Resulting colors should match given vertices clamped. */
+   for (i = 0; i < ARRAY_SIZE(rect); i++)
+   colors[i] = CLAMP(rect[i], 0.0, 1.0);
+
+   glBindVertexArray(vao);
+   glDrawArraysIndirect(GL_TRIANGLE_STRIP, 0);
+
+   if (!piglit_check_gl_error(GL_NO_ERROR))
+   piglit_report_result(PIGLIT_FAIL);
+
+   piglit_present_results();
+
+   /* Probe each corner. */
+   pass &= piglit_probe_pixel_rgb(0, piglit_height -1, colors);
+   pass &= piglit_probe_pixel_rgb(piglit_width - 1, piglit_height - 1, 
&colors[3]);
+   pass &= piglit_probe_pixel_rgb(0, 0, &colors[6]);
+   pass &= piglit_probe_pixel_rgb(piglit_width - 1, 0, &colors[9]);
+
+