Re: [Piglit] [Mesa-dev] [PATCH piglit v2] Test that glShaderSource does not change compile status.

2016-04-26 Thread Kenneth Graunke
On Tuesday, April 26, 2016 1:08:02 PM PDT Jamey Sharp wrote:
> OpenGL 4.5 Core Profile section 7.1, in the documentation for
> CompileShader, says: "Changing the source code of a shader object with
> ShaderSource does not change its compile status or the compiled shader
> code." (I haven't checked older versions of the spec.)
> 
> This test creates a shader, compiles it, changes its source, and links
> it. The spec requires rendering done with this shader to be consistent
> with the old source, not the new source, since the shader isn't compiled
> again after the source is changed.
> 
> According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> Edition" depends on this odd quirk of the spec. See:
> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> 
> This test fails against current Mesa master, but passes with a one-line
> patch to src/mesa/main/shaderapi.c. That patch, together with
> MESA_GL_VERSION_OVERRIDE=4.2, also allowed "Divinity" to start up
> successfully on i965, though rendering bugs remain.
> 
> Based on Karol's report, I expect this test should pass on Catalyst, but
> I only have Intel hardware to test on.
> 
> Signed-off-by: Jamey Sharp 
> Cc: Ian Romanick 
> ---
> 
> "But Ian, I learned it from watching you!" Most of the things you
> complained about, I copied verbatim from your sso-simple.c. ;-)
> 
> I did notice I apparently introduced the first use of C99 array literals
> anywhere in Piglit, and I didn't really need to, so I re-wrote that. And
> after your suggestions, piglit_init was embarrasingly tiny, so I moved
> more setup code into it. I think it's a little more clear this way.
> 
> I think this test can perhaps be simplified. Can all the work be done in
> one shader, either just a vertex shader or just a fragment shader? Or
> does OpenGL require both shaders to be present? I didn't spot the answer
> while skimming the spec.

You could probably only use one shader, but that means getting legacy
fixed-function programming for one of the two stages.  It's usually a
lot simpler to just specify both, as you have - I wouldn't change it.

> 
>  tests/all.py|   1 +
>  tests/shaders/CMakeLists.gl.txt |   1 +
>  tests/shaders/shadersource-no-compile.c | 102 +
+++
>  3 files changed, 104 insertions(+)
>  create mode 100644 tests/shaders/shadersource-no-compile.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index 93d64e6..9f5c019 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -572,6 +572,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as 
g:
>  g(['glsl-kwin-blur-2'])
>  g(['gpu_shader4_attribs'])
>  g(['link-unresolved-function'])
> +g(['shadersource-no-compile'])
>  g(['sso-simple'])
>  g(['sso-uniforms-01'])
>  g(['sso-uniforms-02'])
> diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/
CMakeLists.gl.txt
> index afbcc4b..2db2ded 100644
> --- a/tests/shaders/CMakeLists.gl.txt
> +++ b/tests/shaders/CMakeLists.gl.txt
> @@ -150,6 +150,7 @@ ENDIF (UNIX)
>  piglit_add_executable (glsl-kwin-blur-1 glsl-kwin-blur-1.c)
>  piglit_add_executable (glsl-kwin-blur-2 glsl-kwin-blur-2.c)
>  piglit_add_executable (link-unresolved-function link-unresolved-function.c)
> +piglit_add_executable (shadersource-no-compile shadersource-no-compile.c)
>  piglit_add_executable (sso-simple sso-simple.c)
>  piglit_add_executable (sso-uniforms-01 sso-uniforms-01.c)
>  piglit_add_executable (sso-uniforms-02 sso-uniforms-02.c)
> diff --git a/tests/shaders/shadersource-no-compile.c b/tests/shaders/
shadersource-no-compile.c
> new file mode 100644
> index 000..b5db55d
> --- /dev/null
> +++ b/tests/shaders/shadersource-no-compile.c
> @@ -0,0 +1,102 @@
> +/*
> + * Copyright © 2016 Jamey Sharp
> + *
> + * 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] [Mesa-dev] [PATCH] glShaderSource must not change compile status.

2016-04-26 Thread Kenneth Graunke
On Monday, April 25, 2016 10:06:40 PM PDT Jamey Sharp wrote:
> OpenGL 4.5 Core Profile section 7.1, in the documentation for
> CompileShader, says: "Changing the source code of a shader object with
> ShaderSource does not change its compile status or the compiled shader
> code." (I haven't checked older versions of the spec.)
> 
> According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> Edition" depends on this odd quirk of the spec. See:
> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> 
> This patch, together with MESA_GL_VERSION_OVERRIDE=4.2, allows
> "Divinity" to start up successfully on i965, though rendering bugs
> remain.
> 
> Signed-off-by: Jamey Sharp 
> Cc: Karol Herbst 
> ---
>  src/mesa/main/shaderapi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index b28b5ce..fc2e885 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -949,7 +949,6 @@ shader_source(struct gl_shader *sh, const GLchar 
*source)
> /* free old shader source string and install new one */
> free((void *)sh->Source);
> sh->Source = source;
> -   sh->CompileStatus = GL_FALSE;
>  #ifdef DEBUG
> sh->SourceChecksum = _mesa_str_checksum(sh->Source);
>  #endif
> 

Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] glsl-1.10/execution: Extend tests for early returns

2016-04-26 Thread Lars Hamre
Modifies existing early return tests to test both
code paths (with and without an early return).

Adds an additional test where the early return ends
up being the final instruction.

Per feedback on this mesa patch:
https://lists.freedesktop.org/archives/mesa-dev/2016-April/114706.html

Signed-off-by: Lars Hamre 

---

CC: Timothy Arceri 

NOTE: someone with access will need to commit this
  after the review process

 .../vs-float-main-return-at-end.shader_test| 31 ++
 .../execution/vs-float-main-return.shader_test |  3 +++
 .../execution/vs-vec2-main-return.shader_test  |  3 +++
 .../execution/vs-vec3-main-return.shader_test  |  3 +++
 .../execution/vs-vec4-main-return.shader_test  |  3 +++
 5 files changed, 43 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test

diff --git 
a/tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test 
b/tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test
new file mode 100644
index 000..a83fa7f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test
@@ -0,0 +1,31 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int early_return;
+varying float foo1;
+void main()
+{
+   gl_Position = gl_Vertex;
+   foo1 = 0.5;
+   if (early_return != 0) {
+   foo1 = 0.2;
+   return;
+   }
+}
+
+[fragment shader]
+varying float foo1;
+void main()
+{
+   gl_FragColor = vec4(foo1);
+}
+
+[test]
+
+uniform int early_return 1
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.5 0.5 0.5
diff --git a/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test
index e15e12b..d385571 100644
--- a/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test
@@ -25,3 +25,6 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2
diff --git a/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test
index ada67ef..df74500 100644
--- a/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test
@@ -26,4 +26,7 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2

diff --git a/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test
index a688934..28c3faa 100644
--- a/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test
@@ -25,4 +25,7 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2

diff --git a/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test
index b5b02dc..fc22c4b 100644
--- a/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test
@@ -25,4 +25,7 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2

--
2.5.5

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


Re: [Piglit] [PATCH] ext_image_dma_buf_import/sample_rgb: Make sure the window has alpha.

2016-04-26 Thread Chad Versace
On Tue 26 Apr 2016, Chad Versace wrote:
> On Mon 18 Apr 2016, Eric Anholt wrote:
> > Fixes test result in non-auto-fbo mode on Intel, where you end up
> > without an alpha channel if you forget to ask for one.
> > ---
> >  tests/spec/ext_image_dma_buf_import/sample_rgb.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> This fixes `bin/ext_image_dma_buf_import-sample_rgb -fmt=XR24 -alpha-one
> -auto` for me.
> 
> Reviewed-by: Chad Versace 

Hey Kristian, you may need this patch.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] ext_image_dma_buf_import/sample_rgb: Make sure the window has alpha.

2016-04-26 Thread Chad Versace
On Mon 18 Apr 2016, Eric Anholt wrote:
> Fixes test result in non-auto-fbo mode on Intel, where you end up
> without an alpha channel if you forget to ask for one.
> ---
>  tests/spec/ext_image_dma_buf_import/sample_rgb.c | 1 +
>  1 file changed, 1 insertion(+)

This fixes `bin/ext_image_dma_buf_import-sample_rgb -fmt=XR24 -alpha-one
-auto` for me.

Reviewed-by: Chad Versace 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH piglit v2] Test that glShaderSource does not change compile status.

2016-04-26 Thread Jamey Sharp
OpenGL 4.5 Core Profile section 7.1, in the documentation for
CompileShader, says: "Changing the source code of a shader object with
ShaderSource does not change its compile status or the compiled shader
code." (I haven't checked older versions of the spec.)

This test creates a shader, compiles it, changes its source, and links
it. The spec requires rendering done with this shader to be consistent
with the old source, not the new source, since the shader isn't compiled
again after the source is changed.

According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
Edition" depends on this odd quirk of the spec. See:
https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html

This test fails against current Mesa master, but passes with a one-line
patch to src/mesa/main/shaderapi.c. That patch, together with
MESA_GL_VERSION_OVERRIDE=4.2, also allowed "Divinity" to start up
successfully on i965, though rendering bugs remain.

Based on Karol's report, I expect this test should pass on Catalyst, but
I only have Intel hardware to test on.

Signed-off-by: Jamey Sharp 
Cc: Ian Romanick 
---

"But Ian, I learned it from watching you!" Most of the things you
complained about, I copied verbatim from your sso-simple.c. ;-)

I did notice I apparently introduced the first use of C99 array literals
anywhere in Piglit, and I didn't really need to, so I re-wrote that. And
after your suggestions, piglit_init was embarrasingly tiny, so I moved
more setup code into it. I think it's a little more clear this way.

I think this test can perhaps be simplified. Can all the work be done in
one shader, either just a vertex shader or just a fragment shader? Or
does OpenGL require both shaders to be present? I didn't spot the answer
while skimming the spec.

 tests/all.py|   1 +
 tests/shaders/CMakeLists.gl.txt |   1 +
 tests/shaders/shadersource-no-compile.c | 102 
 3 files changed, 104 insertions(+)
 create mode 100644 tests/shaders/shadersource-no-compile.c

diff --git a/tests/all.py b/tests/all.py
index 93d64e6..9f5c019 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -572,6 +572,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g:
 g(['glsl-kwin-blur-2'])
 g(['gpu_shader4_attribs'])
 g(['link-unresolved-function'])
+g(['shadersource-no-compile'])
 g(['sso-simple'])
 g(['sso-uniforms-01'])
 g(['sso-uniforms-02'])
diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
index afbcc4b..2db2ded 100644
--- a/tests/shaders/CMakeLists.gl.txt
+++ b/tests/shaders/CMakeLists.gl.txt
@@ -150,6 +150,7 @@ ENDIF (UNIX)
 piglit_add_executable (glsl-kwin-blur-1 glsl-kwin-blur-1.c)
 piglit_add_executable (glsl-kwin-blur-2 glsl-kwin-blur-2.c)
 piglit_add_executable (link-unresolved-function link-unresolved-function.c)
+piglit_add_executable (shadersource-no-compile shadersource-no-compile.c)
 piglit_add_executable (sso-simple sso-simple.c)
 piglit_add_executable (sso-uniforms-01 sso-uniforms-01.c)
 piglit_add_executable (sso-uniforms-02 sso-uniforms-02.c)
diff --git a/tests/shaders/shadersource-no-compile.c 
b/tests/shaders/shadersource-no-compile.c
new file mode 100644
index 000..b5db55d
--- /dev/null
+++ b/tests/shaders/shadersource-no-compile.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright © 2016 Jamey Sharp
+ *
+ * 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 shadersource-no-compile.c
+ * OpenGL 4.5 Core Profile section 7.1, in the documentation for CompileShader,
+ * says: "Changing the source code of a shader object with ShaderSource does 
not
+ * change its compile status or the compiled shader code."
+ *
+ * This test creates a shader, compiles it, changes its source, and links it.
+ * The spec requires rendering done with this shader to be consistent with the
+ * old source, not the new source, since the shader isn't comp

Re: [Piglit] [PATCH RESEND] cl: Fix image support when built on CL<1.2

2016-04-26 Thread Jan Vesely
On Sun, 2016-04-24 at 10:08 +0200, Serge Martin wrote:
> On Monday 04 April 2016 08:55:48 Jan Vesely wrote:
> > 
> > On Mon, 2016-03-28 at 21:17 -0400, Jan Vesely wrote:
> > > 
> > > Provide our own image_desc structure since it's too tangled to
> > > remove.
> > > Tests that require OCL 1.2 result in WARN:
> > > Piglit was compiled with lower OpenCL version (1.1) than
> > > version_min:
> > > 12.
> > > OCL 1.1 image tests pass on Intel CPU OCL when compiled in 1.1
> > > environment.
> > gentle ping.
> Reviewed-by: Serge Martin 

Thank you, pushed as 68d981

Jan

> 
> > 
> > 
> > > 
> > > Signed-off-by: Jan Vesely 
> > > ---
> > > 
> > > Looks like the first one did not make it to the ML.
> > > 
> > >  tests/cl/program/program-tester.c |  2 +-
> > >  tests/util/piglit-util-cl.c   | 34 -
> > > 
> > > -
> > >  tests/util/piglit-util-cl.h   | 20 +++-
> > >  3 files changed, 40 insertions(+), 16 deletions(-)
> > > 
> > > diff --git a/tests/cl/program/program-tester.c
> > > b/tests/cl/program/program-tester.c
> > > index 3e0ed43..0a3b011 100644
> > > --- a/tests/cl/program/program-tester.c
> > > +++ b/tests/cl/program/program-tester.c
> > > @@ -345,7 +345,7 @@ struct test_arg {
> > >   uint64_t ulp;
> > >  
> > >   /* image data */
> > > - cl_image_desc   image_desc;
> > > + piglit_image_desc   image_desc;
> > >   cl_image_format image_format;
> > >  
> > >   /* sampler data */
> > > diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-
> > > util-
> > > cl.c
> > > index 9bf45a2..efa289c 100644
> > > --- a/tests/util/piglit-util-cl.c
> > > +++ b/tests/util/piglit-util-cl.c
> > > @@ -1006,14 +1006,18 @@
> > > piglit_cl_read_whole_buffer(cl_command_queue
> > > command_queue, cl_mem buffer,
> > >  
> > >  cl_mem
> > >  piglit_cl_create_image(piglit_cl_context context, cl_mem_flags
> > > flags,
> > > -   const cl_image_format *format, const
> > > cl_image_desc *desc)
> > > +   const cl_image_format *format,
> > > +   const piglit_image_desc *desc)
> > >  {
> > >   cl_int errNo;
> > >   cl_mem image = NULL;
> > >  
> > > +#ifdef CL_VERSION_1_2
> > >   if (piglit_cl_get_platform_version(context->platform_id) 
> > > >=
> > > 12) {
> > >   image = clCreateImage(context->cl_ctx, flags,
> > > format, desc, NULL, &errNo);
> > > - } else if (desc->image_type == CL_MEM_OBJECT_IMAGE2D) {
> > > + } else
> > > +#endif
> > > + if (desc->image_type == CL_MEM_OBJECT_IMAGE2D) {
> > >   image = clCreateImage2D(context->cl_ctx, flags,
> > > format,
> > >   desc->image_width, desc-
> > > 
> > > > 
> > > > image_height, 0,
> > >   NULL, &errNo);
> > > @@ -1068,36 +1072,38 @@ piglit_get_image_region(cl_mem image,
> > > size_t
> > > *region)
> > >   free(p);
> > >  
> > >   switch (*type) {
> > > +#ifdef CL_VERSION_1_2
> > > + case CL_MEM_OBJECT_IMAGE1D_ARRAY:
> > > + p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_ARRAY_SIZE);
> > > + region[1] = *p;
> > > + free(p);
> > > + region[2] = 1;
> > > + break;
> > >   case CL_MEM_OBJECT_IMAGE1D:
> > >   case CL_MEM_OBJECT_IMAGE1D_BUFFER:
> > >   region[1] = 1;
> > >   region[2] = 1;
> > >   break;
> > > - case CL_MEM_OBJECT_IMAGE2D:
> > > - p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_HEIGHT);
> > > - region[1] = *p;
> > > - free(p);
> > > - region[2] = 1;
> > > - break;
> > > - case CL_MEM_OBJECT_IMAGE3D:
> > > + case CL_MEM_OBJECT_IMAGE2D_ARRAY:
> > >   p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_HEIGHT);
> > >   region[1] = *p;
> > >   free(p);
> > > - p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_DEPTH);
> > > + p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_ARRAY_SIZE);
> > >   region[2] = *p;
> > >   free(p);
> > >   break;
> > > - case CL_MEM_OBJECT_IMAGE1D_ARRAY:
> > > - p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_ARRAY_SIZE);
> > > +#endif
> > > + case CL_MEM_OBJECT_IMAGE2D:
> > > + p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_HEIGHT);
> > >   region[1] = *p;
> > >   free(p);
> > >   region[2] = 1;
> > >   break;
> > > - case CL_MEM_OBJECT_IMAGE2D_ARRAY:
> > > + case CL_MEM_OBJECT_IMAGE3D:
> > >   p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_HEIGHT);
> > >   region[1] = *p;
> > >   free(p);
> > > - p = piglit_cl_get_image_info(image,
> > > CL_IMAGE_ARRAY_SIZE);
> > > +  

[Piglit] [PATCH 1/3] ext_image_dma_buf_import: Use piglit-dispatch

2016-04-26 Thread Chad Versace
Stop calling eglGetProcAddress. Let piglit-dispatch do it.
---
 .../intel_external_sampler_only.c  | 26 +++---
 1 file changed, 3 insertions(+), 23 deletions(-)

diff --git a/tests/spec/ext_image_dma_buf_import/intel_external_sampler_only.c 
b/tests/spec/ext_image_dma_buf_import/intel_external_sampler_only.c
index 59772e1..7743a68 100644
--- a/tests/spec/ext_image_dma_buf_import/intel_external_sampler_only.c
+++ b/tests/spec/ext_image_dma_buf_import/intel_external_sampler_only.c
@@ -42,10 +42,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
-static PFNGLGENRENDERBUFFERSOESPROC piglit_glGenRenderbuffersOES;
-static PFNGLBINDRENDERBUFFEROESPROC piglit_glBindRenderbufferOES;
-static PFNGLDELETERENDERBUFFERSOESPROC piglit_glDeleteRenderbuffersOES;
-
 static EGLImageKHR
 create_image(unsigned w, unsigned h, int fd, unsigned stride, unsigned offset)
 {
@@ -87,13 +83,11 @@ try_as_render_buffer(EGLImageKHR img)
GLuint rbo;
bool res;
 
-   piglit_glGenRenderbuffersOES(1, &rbo);
-   piglit_glBindRenderbufferOES(GL_RENDERBUFFER_OES, rbo);
-
+   glGenRenderbuffersOES(1, &rbo);
+   glBindRenderbufferOES(GL_RENDERBUFFER_OES, rbo);
glEGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER_OES, img);
res = piglit_check_gl_error(GL_NO_ERROR);
-
-   piglit_glDeleteRenderbuffersOES(1, &rbo);
+   glDeleteRenderbuffersOES(1, &rbo);
 
return res;
 }
@@ -148,20 +142,6 @@ piglit_init(int argc, char **argv)
piglit_require_egl_extension(egl_dpy, "EGL_KHR_image_base");
piglit_require_extension("GL_OES_EGL_image");
piglit_require_extension("GL_OES_framebuffer_object");
-   
-   piglit_glGenRenderbuffersOES =
-   (PFNGLGENRENDERBUFFERSOESPROC)
-   eglGetProcAddress("glGenRenderbuffersOES");
-   piglit_glBindRenderbufferOES =
-   (PFNGLBINDRENDERBUFFEROESPROC)
-   eglGetProcAddress("glBindRenderbufferOES");
-   piglit_glDeleteRenderbuffersOES =
-   (PFNGLDELETERENDERBUFFERSOESPROC)
-   eglGetProcAddress("glDeleteRenderbuffersOES");
-   if (!piglit_glGenRenderbuffersOES ||
-   !piglit_glBindRenderbufferOES ||
-   !piglit_glDeleteRenderbuffersOES)
-   piglit_report_result(PIGLIT_FAIL);
 
vendor_str = (const char *)glGetString(GL_VENDOR);
if (strncmp(vendor_str, intel_id, sizeof(intel_id) - 1) != 0) {
-- 
2.8.1

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


[Piglit] [PATCH 3/3] util/dma_buf: Use rendernode if available

2016-04-26 Thread Chad Versace
The GL_OES_EGL_image_external tests only passed if they succeeded
to DRI2-authenticate with the X server, because piglit_drm_dma_buf.c
used /dev/dri/card0 as the DRM device. This patch teaches that file to
first try /dev/dri/renderD128, then fallback to /dev/dri/card0.

Despite the simple goal of using a rendernode, this patch needed to
shuffle a lot of code in piglit_drm_dma_buf.c in order to eliminate
piglit_drm_device_get(), which opened and returned the device fd.
---
 .../util/piglit-framework-gl/piglit_drm_dma_buf.c  | 108 +
 1 file changed, 65 insertions(+), 43 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index e286e26..479592c 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -34,8 +34,7 @@
 #include 
 #include 
 #include 
-
-static const char *drm_device_filename = "/dev/dri/card0";
+#include 
 
 #define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 1))
 
@@ -48,7 +47,8 @@ struct piglit_dma_buf {
 };
 
 struct piglit_drm_driver {
-   const char *name;
+   int fd;
+   char *name;
 
bool
(*create)(unsigned w, unsigned h, unsigned cpp,
@@ -62,21 +62,10 @@ struct piglit_drm_driver {
(*destroy)(struct piglit_dma_buf *buf);
 };
 
-static int
-piglit_drm_device_get(void)
-{
-   static int fd = 0;
-
-   if (fd)
-   return fd;
-
-   fd = open(drm_device_filename, O_RDWR);
-
-   return fd;
-}
+static const struct piglit_drm_driver *piglit_drm_get_driver(void);
 
 static bool
-piglit_drm_x11_authenticate(void)
+piglit_drm_x11_authenticate(int fd)
 {
drm_magic_t magic;
xcb_connection_t *conn;
@@ -94,7 +83,7 @@ piglit_drm_x11_authenticate(void)
return false;
}
 
-   ret = drmGetMagic(piglit_drm_device_get(), &magic);
+   ret = drmGetMagic(fd, &magic);
if (ret) {
printf("piglit: failed to get DRM magic\n");
return false;
@@ -126,18 +115,16 @@ static drm_intel_bufmgr *
 piglit_intel_bufmgr_get(void)
 {
static const unsigned batch_sz = 8192 * sizeof(uint32_t);
+   const struct piglit_drm_driver *drv = piglit_drm_get_driver();
static drm_intel_bufmgr *mgr = NULL;
 
if (mgr)
return mgr;
 
-   if (!piglit_drm_device_get())
+   if (!drv)
return NULL;
 
-   if (!piglit_drm_x11_authenticate())
-   return NULL;
-
-   mgr = intel_bufmgr_gem_init(piglit_drm_device_get(), batch_sz);
+   mgr = intel_bufmgr_gem_init(drv->fd, batch_sz);
 
return mgr;
 }
@@ -195,34 +182,69 @@ piglit_intel_buf_destroy(struct piglit_dma_buf *buf)
 }
 #endif /* HAVE_LIBDRM_INTEL */
 
-/**
- * The framework makes sure one doesn't try to compile without any hardware
- * support.
- */
-static const struct piglit_drm_driver piglit_drm_drivers[] = {
-#ifdef HAVE_LIBDRM_INTEL
-   { "i915", piglit_intel_buf_create, piglit_intel_buf_export,
-  piglit_intel_buf_destroy }
-#endif /* HAVE_LIBDRM_INTEL */
-};
-
 static const struct piglit_drm_driver *
 piglit_drm_get_driver(void)
 {
-   unsigned i;
+   static struct piglit_drm_driver drv = { /* fd */ -1 };
drmVersionPtr version;
-   int fd = piglit_drm_device_get();
 
-   if (!fd)
-   return NULL;
+   if (drv.fd != -1)
+   return &drv;
 
-   version = drmGetVersion(fd);
-   if (!version || !version->name)
-   return NULL;
+   drv.fd = open("/dev/dri/renderD128", O_RDWR);
 
-   for (i = 0; i < ARRAY_SIZE(piglit_drm_drivers); ++i) {
-   if (strcmp(piglit_drm_drivers[i].name, version->name) == 0)
-   return &piglit_drm_drivers[i];
+   if (drv.fd == -1) {
+   drv.fd = open("/dev/dri/card0", O_RDWR);
+   if (drv.fd == -1) {
+   fprintf(stderr, "error: failed to open 
/dev/dri/renderD128 and "
+   "/dev/dri/card0\n");
+   goto fail;
+
+   }
+
+   if (!piglit_drm_x11_authenticate(drv.fd))
+   goto fail;
+   }
+
+   version = drmGetVersion(drv.fd);
+   if (!version || !version->name) {
+   fprintf(stderr, "error: drmGetVersion() failed\n");
+   goto fail;
+   }
+
+   drv.name = strdup(version->name);
+   if (!drv.name) {
+   fprintf(stderr, "out of memory\n");
+   abort();
+   }
+
+   if (0) {
+   /* empty */
+   }
+#ifdef HAVE_LIBDRM_INTEL
+   else if (streq(version->name, "i915")) {
+   drv.create = piglit_intel_buf_create;
+   drv.export = piglit_intel_buf_export;
+   drv.destroy = piglit_intel_buf_destroy;
+   }
+#endif
+   else {
+   fprintf(stderr, 

[Piglit] [PATCH 2/3] util: Fix crash when xcb_get_setup() fails

2016-04-26 Thread Chad Versace
Return early if xcb_get_setup() returns NULL. Don't use the NULL.
---
 tests/util/piglit-framework-gl/piglit_drm_dma_buf.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 44fd0d1..e286e26 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -81,6 +81,7 @@ piglit_drm_x11_authenticate(void)
drm_magic_t magic;
xcb_connection_t *conn;
int screen;
+   const xcb_setup_t *setup;
xcb_screen_iterator_t screen_iter;
xcb_dri2_authenticate_cookie_t auth_cookie;
xcb_dri2_authenticate_reply_t *auth_reply;
@@ -99,7 +100,13 @@ piglit_drm_x11_authenticate(void)
return false;
}
 
-   screen_iter = xcb_setup_roots_iterator(xcb_get_setup(conn));
+   setup = xcb_get_setup(conn);
+   if (!setup) {
+   printf("piglit: xcb_get_setup() failed\n");
+   return false;
+   }
+
+   screen_iter = xcb_setup_roots_iterator(setup);
auth_cookie = xcb_dri2_authenticate_unchecked(conn,
  screen_iter.data->root,
  magic);
-- 
2.8.1

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


Re: [Piglit] [PATCH] util: Fix texture name returned by piglit_integer_texture()

2016-04-26 Thread Chad Versace
On Mon 25 Apr 2016, Nicolai Hähnle wrote:
> Hi Chad,
> 
> I saw Matt's email and went ahead and just did this before seeing your
> email. Sorry about that!

No problem. All that matters is that the bugs get fixed!
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Mesa-dev] [PATCH] glShaderSource must not change compile status.

2016-04-26 Thread Ian Romanick
On 04/26/2016 12:57 PM, Timothy Arceri wrote:
> On Tue, 2016-04-26 at 09:29 +0200, Ian Romanick wrote:
>> On 04/26/2016 07:06 AM, Jamey Sharp wrote:
>>>
>>> OpenGL 4.5 Core Profile section 7.1, in the documentation for
>>> CompileShader, says: "Changing the source code of a shader object
>>> with
>>> ShaderSource does not change its compile status or the compiled
>>> shader
>>> code." (I haven't checked older versions of the spec.)
>>>
>>> According to Karol Herbst, the game "Divinity: Original Sin -
>>> Enhanced
>>> Edition" depends on this odd quirk of the spec. See:
>>> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.h
>>> tml
>>>
>>> This patch, together with MESA_GL_VERSION_OVERRIDE=4.2, allows
>>> "Divinity" to start up successfully on i965, though rendering bugs
>>> remain.
>>>
>>> Signed-off-by: Jamey Sharp 
>>> Cc: Karol Herbst 
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93551
>>
>> I think this is correct, but this might have some interactions with
>> Timothy's shader cache work.
> 
> It should be fine I don't think I'm using this flag for anything.

I was thinking that there might be an interaction between the flag being
GL_TRUE but the gl_shader::Source pointing to a different source string.

>> Reviewed-by: Ian Romanick 
>>
>>>
>>> ---
>>>  src/mesa/main/shaderapi.c | 1 -
>>>  1 file changed, 1 deletion(-)
>>>
>>> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
>>> index b28b5ce..fc2e885 100644
>>> --- a/src/mesa/main/shaderapi.c
>>> +++ b/src/mesa/main/shaderapi.c
>>> @@ -949,7 +949,6 @@ shader_source(struct gl_shader *sh, const
>>> GLchar *source)
>>> /* free old shader source string and install new one */
>>> free((void *)sh->Source);
>>> sh->Source = source;
>>> -   sh->CompileStatus = GL_FALSE;
>>>  #ifdef DEBUG
>>> sh->SourceChecksum = _mesa_str_checksum(sh->Source);
>>>  #endif
>>>
>> ___
>> mesa-dev mailing list
>> mesa-...@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

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


Re: [Piglit] [Mesa-dev] [PATCH] glShaderSource must not change compile status.

2016-04-26 Thread Timothy Arceri
On Tue, 2016-04-26 at 09:29 +0200, Ian Romanick wrote:
> On 04/26/2016 07:06 AM, Jamey Sharp wrote:
> > 
> > OpenGL 4.5 Core Profile section 7.1, in the documentation for
> > CompileShader, says: "Changing the source code of a shader object
> > with
> > ShaderSource does not change its compile status or the compiled
> > shader
> > code." (I haven't checked older versions of the spec.)
> > 
> > According to Karol Herbst, the game "Divinity: Original Sin -
> > Enhanced
> > Edition" depends on this odd quirk of the spec. See:
> > https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.h
> > tml
> > 
> > This patch, together with MESA_GL_VERSION_OVERRIDE=4.2, allows
> > "Divinity" to start up successfully on i965, though rendering bugs
> > remain.
> > 
> > Signed-off-by: Jamey Sharp 
> > Cc: Karol Herbst 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93551
> 
> I think this is correct, but this might have some interactions with
> Timothy's shader cache work.

It should be fine I don't think I'm using this flag for anything.

> 
> Reviewed-by: Ian Romanick 
> 
> > 
> > ---
> >  src/mesa/main/shaderapi.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> > index b28b5ce..fc2e885 100644
> > --- a/src/mesa/main/shaderapi.c
> > +++ b/src/mesa/main/shaderapi.c
> > @@ -949,7 +949,6 @@ shader_source(struct gl_shader *sh, const
> > GLchar *source)
> > /* free old shader source string and install new one */
> > free((void *)sh->Source);
> > sh->Source = source;
> > -   sh->CompileStatus = GL_FALSE;
> >  #ifdef DEBUG
> > sh->SourceChecksum = _mesa_str_checksum(sh->Source);
> >  #endif
> > 
> ___
> mesa-dev mailing list
> mesa-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements

2016-04-26 Thread Marek Olšák
On Mon, Apr 25, 2016 at 4:03 PM, Andres Gomez  wrote:
> Signed-off-by: Andres Gomez 
> ---
>  tests/shaders/shader_runner.c | 17 -
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 239735c..2f6bec8 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -89,6 +89,7 @@ static struct component_version glsl_req_version;
>  static int gl_max_vertex_output_components;
>  static int gl_max_fragment_uniform_components;
>  static int gl_max_vertex_uniform_components;
> +static int gl_max_vertex_attribs;
>  static int gl_max_varying_components;
>  static int gl_max_clip_planes;
>
> @@ -724,6 +725,11 @@ process_requirement(const char *line)
> "vertex uniform components",
> },
> {
> +   "GL_MAX_VERTEX_ATTRIBS",
> +   &gl_max_vertex_attribs,
> +   "vertex attribs",
> +   },
> +   {
> "GL_MAX_VARYING_COMPONENTS",
> &gl_max_varying_components,
> "varying components",
> @@ -3323,9 +3329,12 @@ piglit_init(int argc, char **argv)
> glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>   &gl_max_fragment_uniform_components);
> if (piglit_get_gl_version() >= 20 ||
> -   piglit_is_extension_supported("GL_ARB_vertex_shader"))
> +   piglit_is_extension_supported("GL_ARB_vertex_shader")) {
> glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>   &gl_max_vertex_uniform_components);
> +   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> + &gl_max_vertex_attribs);
> +   }
> if (piglit_get_gl_version() >= 30 ||
> piglit_is_extension_supported("GL_ARB_geometry_shader4") ||
> piglit_is_extension_supported("GL_EXT_geometry_shader4"))
> @@ -3346,6 +3355,12 @@ piglit_init(int argc, char **argv)
> gl_max_vertex_uniform_components *= 4;
> gl_max_varying_components *= 4;
> gl_max_clip_planes = 0;
> +#if defined(PIGLIT_USE_OPENGL_ES3) || defined(PIGLIT_USE_OPENGL_ES2)
> +   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> + &gl_max_vertex_attribs);
> +#else
> +   gl_max_vertex_attribs = 16;

This seems to override the first query above. Is that intentional?

Marek

> +#endif
>  #endif
> if (argc < 2) {
> printf("usage: shader_runner \n");
> --
> 2.8.0.rc3
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Mesa-dev] [PATCH] glShaderSource must not change compile status.

2016-04-26 Thread Ian Romanick
On 04/26/2016 07:06 AM, Jamey Sharp wrote:
> OpenGL 4.5 Core Profile section 7.1, in the documentation for
> CompileShader, says: "Changing the source code of a shader object with
> ShaderSource does not change its compile status or the compiled shader
> code." (I haven't checked older versions of the spec.)
> 
> According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> Edition" depends on this odd quirk of the spec. See:
> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> 
> This patch, together with MESA_GL_VERSION_OVERRIDE=4.2, allows
> "Divinity" to start up successfully on i965, though rendering bugs
> remain.
> 
> Signed-off-by: Jamey Sharp 
> Cc: Karol Herbst 

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93551

I think this is correct, but this might have some interactions with
Timothy's shader cache work.

Reviewed-by: Ian Romanick 

> ---
>  src/mesa/main/shaderapi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index b28b5ce..fc2e885 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -949,7 +949,6 @@ shader_source(struct gl_shader *sh, const GLchar *source)
> /* free old shader source string and install new one */
> free((void *)sh->Source);
> sh->Source = source;
> -   sh->CompileStatus = GL_FALSE;
>  #ifdef DEBUG
> sh->SourceChecksum = _mesa_str_checksum(sh->Source);
>  #endif
> 

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


Re: [Piglit] [PATCH] Test that glShaderSource does not change compile status.

2016-04-26 Thread Ian Romanick
On 04/26/2016 07:04 AM, Jamey Sharp wrote:
> OpenGL 4.5 Core Profile section 7.1, in the documentation for
> CompileShader, says: "Changing the source code of a shader object with
> ShaderSource does not change its compile status or the compiled shader
> code." (I haven't checked older versions of the spec.)
> 
> This test creates a shader, compiles it, changes its source, and links
> it. The spec requires rendering done with this shader to be consistent
> with the old source, not the new source, since the shader isn't compiled
> again after the source is changed.
> 
> According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> Edition" depends on this odd quirk of the spec. See:
> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> 
> This test fails against current Mesa master, but passes with a one-line
> patch to src/mesa/main/shaderapi.c. That patch, together with
> MESA_GL_VERSION_OVERRIDE=4.2, also allowed "Divinity" to start up
> successfully on i965, though rendering bugs remain.
> 
> Based on Karol's report, I expect this test should pass on Catalyst, but
> I only have Intel hardware to test on.
> 
> Signed-off-by: Jamey Sharp 
> Cc: Karol Herbst 
> ---
>  tests/all.py|   1 +
>  tests/shaders/CMakeLists.gl.txt |   1 +
>  tests/shaders/shadersource-no-compile.c | 107 
> 
>  3 files changed, 109 insertions(+)
>  create mode 100644 tests/shaders/shadersource-no-compile.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index 93d64e6..9f5c019 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -572,6 +572,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g:
>  g(['glsl-kwin-blur-2'])
>  g(['gpu_shader4_attribs'])
>  g(['link-unresolved-function'])
> +g(['shadersource-no-compile'])
>  g(['sso-simple'])
>  g(['sso-uniforms-01'])
>  g(['sso-uniforms-02'])
> diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
> index afbcc4b..2db2ded 100644
> --- a/tests/shaders/CMakeLists.gl.txt
> +++ b/tests/shaders/CMakeLists.gl.txt
> @@ -150,6 +150,7 @@ ENDIF (UNIX)
>  piglit_add_executable (glsl-kwin-blur-1 glsl-kwin-blur-1.c)
>  piglit_add_executable (glsl-kwin-blur-2 glsl-kwin-blur-2.c)
>  piglit_add_executable (link-unresolved-function link-unresolved-function.c)
> +piglit_add_executable (shadersource-no-compile shadersource-no-compile.c)
>  piglit_add_executable (sso-simple sso-simple.c)
>  piglit_add_executable (sso-uniforms-01 sso-uniforms-01.c)
>  piglit_add_executable (sso-uniforms-02 sso-uniforms-02.c)
> diff --git a/tests/shaders/shadersource-no-compile.c 
> b/tests/shaders/shadersource-no-compile.c
> new file mode 100644
> index 000..922f0f3
> --- /dev/null
> +++ b/tests/shaders/shadersource-no-compile.c
> @@ -0,0 +1,107 @@
> +/*
> + * Copyright © 2016 Jamey Sharp
> + *
> + * 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 shadersource-no-compile.c
> + * OpenGL 4.5 Core Profile section 7.1, in the documentation for 
> CompileShader,
> + * says: "Changing the source code of a shader object with ShaderSource does 
> not
> + * change its compile status or the compiled shader code."
> + *
> + * This test creates a shader, compiles it, changes its source, and links it.
> + * The spec requires rendering done with this shader to be consistent with 
> the
> + * old source, not the new source, since the shader isn't compiled again 
> after
> + * the source is changed.
> + *
> + * According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> + * Edition" depends on this odd quirk of the spec. See:
> + * https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> + *
> + * \author Jamey Sharp 

We don't add Authors: or \author lines anymore.  GIT does a fine job
tracking that for us.

> + */
> +#include "pigl