Re: [Piglit] [PATCH] arb_fragment_shader_interlock: fix MinGW build

2017-04-27 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 27/04/17 19:25, Brian Paul wrote:

uint isn't a standard type.  GLuint would be another possibility.
Untested.
---
  .../arb_fragment_shader_interlock/image-load-store.c | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/spec/arb_fragment_shader_interlock/image-load-store.c 
b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
index 390ffb2..597bcf7 100644
--- a/tests/spec/arb_fragment_shader_interlock/image-load-store.c
+++ b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
@@ -218,9 +218,9 @@ piglit_display(void)
  {
int samples[4] = { 2, 4, 8, 16 };
bool pass = true;
-   uint i, j, k;
-   uint result1[4] = { 47, 35, 63, 255 };
-   uint result2[4] = { 47, 0, 63, 255 };
+   unsigned i, j, k;
+   const unsigned result1[4] = { 47, 35, 63, 255 };
+   const unsigned result2[4] = { 47, 0, 63, 255 };
int max_samples;
  
  	glViewport(0, 0, piglit_width, piglit_height);

@@ -256,12 +256,12 @@ piglit_display(void)
glGetTexImage(GL_TEXTURE_3D, 0, GL_RGBA, GL_FLOAT, tex_data);
for (j = 0; j < piglit_height; j++) {
for (k = 0; k < piglit_width; k++) {
-   uint l = ((piglit_width * piglit_height * 
samples[i]) +
+   unsigned l = ((piglit_width * piglit_height * 
samples[i]) +
(j * piglit_width) + k) * 4;
-   uint r = fabs(tex_data[l]) * 255;
-   uint g = fabs(tex_data[l + 1]) * 255;
-   uint b = fabs(tex_data[l + 2]) * 255;
-   uint a = fabs(tex_data[l + 3]) * 255;
+   unsigned r = fabs(tex_data[l]) * 255;
+   unsigned g = fabs(tex_data[l + 1]) * 255;
+   unsigned b = fabs(tex_data[l + 2]) * 255;
+   unsigned a = fabs(tex_data[l + 3]) * 255;
  
  if ((k < piglit_width / 2) && (r != result1[0] ||

  g != result1[1] || b != result1[2] || 
a != result1[3])) {



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


[Piglit] [PATCH] arb_fragment_shader_interlock: fix MinGW build

2017-04-27 Thread Brian Paul
uint isn't a standard type.  GLuint would be another possibility.
Untested.
---
 .../arb_fragment_shader_interlock/image-load-store.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/spec/arb_fragment_shader_interlock/image-load-store.c 
b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
index 390ffb2..597bcf7 100644
--- a/tests/spec/arb_fragment_shader_interlock/image-load-store.c
+++ b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
@@ -218,9 +218,9 @@ piglit_display(void)
 {
int samples[4] = { 2, 4, 8, 16 };
bool pass = true;
-   uint i, j, k;
-   uint result1[4] = { 47, 35, 63, 255 };
-   uint result2[4] = { 47, 0, 63, 255 };
+   unsigned i, j, k;
+   const unsigned result1[4] = { 47, 35, 63, 255 };
+   const unsigned result2[4] = { 47, 0, 63, 255 };
int max_samples;
 
glViewport(0, 0, piglit_width, piglit_height);
@@ -256,12 +256,12 @@ piglit_display(void)
glGetTexImage(GL_TEXTURE_3D, 0, GL_RGBA, GL_FLOAT, tex_data);
for (j = 0; j < piglit_height; j++) {
for (k = 0; k < piglit_width; k++) {
-   uint l = ((piglit_width * piglit_height * 
samples[i]) +
+   unsigned l = ((piglit_width * piglit_height * 
samples[i]) +
(j * piglit_width) + k) * 4;
-   uint r = fabs(tex_data[l]) * 255;
-   uint g = fabs(tex_data[l + 1]) * 255;
-   uint b = fabs(tex_data[l + 2]) * 255;
-   uint a = fabs(tex_data[l + 3]) * 255;
+   unsigned r = fabs(tex_data[l]) * 255;
+   unsigned g = fabs(tex_data[l + 1]) * 255;
+   unsigned b = fabs(tex_data[l + 2]) * 255;
+   unsigned a = fabs(tex_data[l + 3]) * 255;
 
if ((k < piglit_width / 2) && (r != result1[0] 
||
  g != result1[1] || b != result1[2] || 
a != result1[3])) {
-- 
1.9.1

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


Re: [Piglit] [PATCH] all.py: s/OpenGL 1.1/opengl 1.1/

2017-04-27 Thread Dylan Baker
The test name is lowered by the g() call, so this is effectively a no-op. I just
want to be clear that this change will not change test names or behaviors, and I
think it's nice to be consistent.

Reviewed-by: Dylan Baker 

Quoting Brian Paul (2017-04-27 14:14:16)
> To match the naming convention for all the other "opengl x.y" groups.
> ---
>  tests/all.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/all.py b/tests/all.py
> index 6255ddf..da3398b 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -836,7 +836,7 @@ with profile.test_list.group_manager(
>  
>  with profile.test_list.group_manager(
>  PiglitGLTest,
> -grouptools.join('spec', '!OpenGL 1.1')) as g:
> +grouptools.join('spec', '!opengl 1.1')) as g:
>  g(['copyteximage', '1D'], run_concurrent=False)
>  g(['copyteximage', '2D'], run_concurrent=False)
>  g(['drawbuffer-modes'], run_concurrent=False)
> -- 
> 1.9.1
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


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


Re: [Piglit] [PATCH] all.py: s/OpenGL 1.1/opengl 1.1/

2017-04-27 Thread Neha Bhende
looks good to me.


Reviewed-by: Neha Bhende


Regards,

Neha


From: Piglit  on behalf of Brian Paul 

Sent: Thursday, April 27, 2017 2:14:16 PM
To: piglit@lists.freedesktop.org
Subject: [Piglit] [PATCH] all.py: s/OpenGL 1.1/opengl 1.1/

To match the naming convention for all the other "opengl x.y" groups.
---
 tests/all.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/all.py b/tests/all.py
index 6255ddf..da3398b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -836,7 +836,7 @@ with profile.test_list.group_manager(

 with profile.test_list.group_manager(
 PiglitGLTest,
-grouptools.join('spec', '!OpenGL 1.1')) as g:
+grouptools.join('spec', '!opengl 1.1')) as g:
 g(['copyteximage', '1D'], run_concurrent=False)
 g(['copyteximage', '2D'], run_concurrent=False)
 g(['drawbuffer-modes'], run_concurrent=False)
--
1.9.1

___
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


[Piglit] [PATCH] all.py: s/OpenGL 1.1/opengl 1.1/

2017-04-27 Thread Brian Paul
To match the naming convention for all the other "opengl x.y" groups.
---
 tests/all.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/all.py b/tests/all.py
index 6255ddf..da3398b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -836,7 +836,7 @@ with profile.test_list.group_manager(
 
 with profile.test_list.group_manager(
 PiglitGLTest,
-grouptools.join('spec', '!OpenGL 1.1')) as g:
+grouptools.join('spec', '!opengl 1.1')) as g:
 g(['copyteximage', '1D'], run_concurrent=False)
 g(['copyteximage', '2D'], run_concurrent=False)
 g(['drawbuffer-modes'], run_concurrent=False)
-- 
1.9.1

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


Re: [Piglit] [PATCH 1/6] arb_bindless_texture: test bound samplers/image with glUniform1i()

2017-04-27 Thread Samuel Pitoiset



On 04/27/2017 10:02 PM, Nicolai Hähnle wrote:

On 27.04.2017 00:52, Samuel Pitoiset wrote:

From section 2.14.16 of the ARB_bindless_texture spec:

"When used as uniforms in the default block, the value of sampler
 variables may be specified with either Uniform1i{v} or
 UniformHandleui64{v}ARB."

From section 2.14.X of the ARB_bindless_texture spec:

"When used as uniforms in the default block, the value of image
 variables may be specified with either Uniform1i{v} or
 UniformHandleui64{v}ARB."

This test just ensures that setting a uniform to bound samplers
doesn't report any GL errors.


Okay, I'm very confused again. The spec *also* says this:

"These modifiers control whether default-block uniforms of the
 corresponding types may have their values set via both
 UniformHandle* and Uniform1i (bindless_sampler and bindless_image)
 or only via Uniform1i (bound_sampler and bound_image)."

Which would actually suggest that the current test is wrong *before* 
this patch. What's going on here?


Not wrong, but incomplete, yes.

Basically, if my understanding of the spec is correct. The only GL call 
which should report an error is UniformHandle* when a sampler has the 
bound_sampler layout qualifier. That said, we can use UniformHandle* and 
Uniform1i when the bindless_sampler is set and when no layout qualifiers 
are present.







Signed-off-by: Samuel Pitoiset 
---
 tests/spec/arb_bindless_texture/uniform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/arb_bindless_texture/uniform.c 
b/tests/spec/arb_bindless_texture/uniform.c

index c4c06df05..1524eb18c 100644
--- a/tests/spec/arb_bindless_texture/uniform.c
+++ b/tests/spec/arb_bindless_texture/uniform.c
@@ -158,6 +158,7 @@ 
check_UniformHandleui64_with_implicit_bound_sampler(void *data)

  */
 glUniformHandleui64ARB(loc, handle);
 glProgramUniformHandleui64vARB(prog, loc, 1, &handle);
+glUniform1i(loc, 5);
 if (!piglit_check_gl_error(GL_NO_ERROR))
 return PIGLIT_FAIL;

@@ -223,6 +224,7 @@ 
check_UniformHandleui64_with_implicit_bound_image(void *data)

  */
 glUniformHandleui64ARB(loc, handle);
 glProgramUniformHandleui64vARB(prog, loc, 1, &handle);
+glUniform1i(loc, 5);
 if (!piglit_check_gl_error(GL_NO_ERROR))
 return PIGLIT_FAIL;






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


Re: [Piglit] [PATCH 5/6] arb_bindless_texture: add inout-non-matching-type.frag compiler tests

2017-04-27 Thread Nicolai Hähnle

On 27.04.2017 10:12, Samuel Pitoiset wrote:



On 04/27/2017 10:02 AM, Samuel Pitoiset wrote:



On 04/27/2017 02:24 AM, Timothy Arceri wrote:

Same comment for 3-5 as for comment 2. I'd rather see varyables
function params and return values used as frag/vert outputs otherwise
there is no guarantee the compiler won't just optimise the invalid
uses away.


I think it's a bit overkill. Most of the compiler tests in piglit are
really pretty simple. Looks like only very few of them guarantee that
the compiler won't optimize. Yeah, it's sad.

I have written and tested this series against NV blob. At least, this
one doesn't need anything else because it fails as-is.


I understand your point of view though. But the way I designed the
compiler tests for ARB_bindless_texture would need a bunch of changes.


I think these tests are mostly about the compiler accepting the syntax 
in the first place, so it's fine if they're trivial to optimize away.


The execution tests are what checks that later stages of the compiler 
pipeline are working correctly.


With that in mind, patches 2-5 are:

Reviewed-by: Nicolai Hähnle 








On 27/04/17 08:52, Samuel Pitoiset wrote:

"Replace Section 4.1.X, (Images)"

 "As function parameters, images may be only passed to images
  of matching type."

"Replace Section 4.1.7 (Samplers), p. 25"

 "As function parameters, samplers may be only passed to samplers
  of matching type."

Two simple test cases to make sure types are checked.

Signed-off-by: Samuel Pitoiset 
---
  .../compiler/images/inout-non-matching-type.frag   | 26
++
  .../compiler/samplers/inout-non-matching-type.frag | 25
+
  2 files changed, 51 insertions(+)
  create mode 100644
tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag

  create mode 100644
tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag


diff --git
a/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag

new file mode 100644
index 0..0ff8d5bc9
--- /dev/null
+++
b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag

@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
GL_ARB_shader_image_load_store
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.X, (Images)"
+//
+//  "As function parameters, images may be only passed to images of
+//   matching type."
+
+void f(inout image2D p)
+{
+}
+
+void main()
+{
+writeonly image1D u;
+f(u);
+}
diff --git
a/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag

new file mode 100644
index 0..25a5724cf
--- /dev/null
+++
b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag

@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.7 (Samplers), p. 25"
+//
+//  "As function parameters, samplers may be only passed to
samplers of
+//   matching type."
+
+void f(inout sampler2D p)
+{
+}
+
+void main()
+{
+sampler1D u;
+f(u);
+}


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



--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/6] arb_bindless_texture: test bound samplers/image with glUniform1i()

2017-04-27 Thread Nicolai Hähnle

On 27.04.2017 00:52, Samuel Pitoiset wrote:

From section 2.14.16 of the ARB_bindless_texture spec:

"When used as uniforms in the default block, the value of sampler
 variables may be specified with either Uniform1i{v} or
 UniformHandleui64{v}ARB."

From section 2.14.X of the ARB_bindless_texture spec:

"When used as uniforms in the default block, the value of image
 variables may be specified with either Uniform1i{v} or
 UniformHandleui64{v}ARB."

This test just ensures that setting a uniform to bound samplers
doesn't report any GL errors.


Okay, I'm very confused again. The spec *also* says this:

   "These modifiers control whether default-block uniforms of the
corresponding types may have their values set via both
UniformHandle* and Uniform1i (bindless_sampler and bindless_image)
or only via Uniform1i (bound_sampler and bound_image)."

Which would actually suggest that the current test is wrong *before* 
this patch. What's going on here?





Signed-off-by: Samuel Pitoiset 
---
 tests/spec/arb_bindless_texture/uniform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/arb_bindless_texture/uniform.c 
b/tests/spec/arb_bindless_texture/uniform.c
index c4c06df05..1524eb18c 100644
--- a/tests/spec/arb_bindless_texture/uniform.c
+++ b/tests/spec/arb_bindless_texture/uniform.c
@@ -158,6 +158,7 @@ check_UniformHandleui64_with_implicit_bound_sampler(void 
*data)
 */
glUniformHandleui64ARB(loc, handle);
glProgramUniformHandleui64vARB(prog, loc, 1, &handle);
+   glUniform1i(loc, 5);
if (!piglit_check_gl_error(GL_NO_ERROR))
return PIGLIT_FAIL;

@@ -223,6 +224,7 @@ check_UniformHandleui64_with_implicit_bound_image(void 
*data)
 */
glUniformHandleui64ARB(loc, handle);
glProgramUniformHandleui64vARB(prog, loc, 1, &handle);
+   glUniform1i(loc, 5);
if (!piglit_check_gl_error(GL_NO_ERROR))
return PIGLIT_FAIL;





--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shader_runner: clean up resident handles at exit time

2017-04-27 Thread Samuel Pitoiset



On 04/27/2017 09:56 PM, Nicolai Hähnle wrote:
I wonder whether this should also be cleaned up after each test when 
running multiple tests at a time. But I don't think we're doing that 
with textures and other objects either...


Nope, we don't.



Reviewed-by: Nicolai Hähnle 

On 27.04.2017 10:42, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
 tests/shaders/shader_runner.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/shaders/shader_runner.c 
b/tests/shaders/shader_runner.c

index 2047d6cb0..6ac5f9893 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3765,6 +3765,9 @@ piglit_display(void)
 for (i = 0; i < ARRAY_SIZE(texture_bindings); i++)
 clear_texture_binding(i);

+for (i = 0; i < ARRAY_SIZE(resident_handles); i++)
+clear_resident_handle(i);
+
 if (prog != 0) {
 glDeleteProgram(prog);
 glUseProgram(0);





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


Re: [Piglit] [PATCH] shader_runner: clean up resident handles at exit time

2017-04-27 Thread Nicolai Hähnle
I wonder whether this should also be cleaned up after each test when 
running multiple tests at a time. But I don't think we're doing that 
with textures and other objects either...


Reviewed-by: Nicolai Hähnle 

On 27.04.2017 10:42, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
 tests/shaders/shader_runner.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 2047d6cb0..6ac5f9893 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3765,6 +3765,9 @@ piglit_display(void)
for (i = 0; i < ARRAY_SIZE(texture_bindings); i++)
clear_texture_binding(i);

+   for (i = 0; i < ARRAY_SIZE(resident_handles); i++)
+   clear_resident_handle(i);
+
if (prog != 0) {
glDeleteProgram(prog);
glUseProgram(0);




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_image_load_store: add memory-qualifier-with-non-image-type.frag

2017-04-27 Thread Nicolai Hähnle

Reviewed-by: Nicolai Hähnle 

On 26.04.2017 18:42, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
 .../memory-qualifier-with-non-image-type.frag  | 25 ++
 1 file changed, 25 insertions(+)
 create mode 100644 
tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag

diff --git 
a/tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag
 
b/tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag
new file mode 100644
index 0..71087ec21
--- /dev/null
+++ 
b/tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_shader_image_load_store
+// [end config]
+
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+
+// From Section 4.10 (Memory Qualifiers) of the GLSL 4.50 spec:
+//
+// "Variables declared as image types (the basic opaque types with “image”
+//  in their keyword) can be further qualified with one or more of the
+//  following memory qualifiers: ..."
+//
+// Easy enough to infer that memory qualifiers should not be used with
+// non-image types.
+
+uniform Block {
+   volatile int x;
+};
+
+void main()
+{
+}




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_fragment_shader_interlock: Test image load/store.

2017-04-27 Thread Nicolai Hähnle

On 25.04.2017 20:58, Plamena Manolova wrote:

A test to check whether GL_ARB_fragment_shader_interlock operates as
expected. This test simulates blending behaviour by using image loads/stores
to a 3D texture. The blending formula used is:
result = current_alpha * current_color + (1 - current_alpha) * previous_color
Multisampling is also enabled and tested at 2, 4, 8 and 16.

Signed-off-by: Plamena Manolova 


Thanks for the v2!

Reviewed-by: Nicolai Hähnle 



---
 tests/all.py   |   5 +
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gl.txt  |  12 +
 .../arb_fragment_shader_interlock/CMakeLists.txt   |   1 +
 .../image-load-store.c | 297 +
 5 files changed, 316 insertions(+)
 create mode 100644 tests/spec/arb_fragment_shader_interlock/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_fragment_shader_interlock/CMakeLists.txt
 create mode 100644 tests/spec/arb_fragment_shader_interlock/image-load-store.c

diff --git a/tests/all.py b/tests/all.py
index 3cd3b47..f105701 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4804,6 +4804,11 @@ with profile.test_list.group_manager(
 g(['arb_post_depth_coverage-sample-shading'])

 with profile.test_list.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_fragment_shader_interlock')) as g:
+g(['arb_fragment_shader_interlock-image-load-store'])
+
+with profile.test_list.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'arb_shader_image_size')) as g:
 g(['arb_shader_image_size-builtin'], 'builtin')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 5bdde84..5bfa76b 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -160,3 +160,4 @@ add_subdirectory (arb_shader_texture_image_samples)
 add_subdirectory (arb_texture_barrier)
 add_subdirectory (intel_conservative_rasterization)
 add_subdirectory (arb_post_depth_coverage)
+add_subdirectory (arb_fragment_shader_interlock)
diff --git a/tests/spec/arb_fragment_shader_interlock/CMakeLists.gl.txt 
b/tests/spec/arb_fragment_shader_interlock/CMakeLists.gl.txt
new file mode 100644
index 000..d8bb7da
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/CMakeLists.gl.txt
@@ -0,0 +1,12 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_fragment_shader_interlock-image-load-store
+   image-load-store.c)
diff --git a/tests/spec/arb_fragment_shader_interlock/CMakeLists.txt 
b/tests/spec/arb_fragment_shader_interlock/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_fragment_shader_interlock/image-load-store.c 
b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
new file mode 100644
index 000..390ffb2
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
@@ -0,0 +1,297 @@
+/*
+ * 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
+ * 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.
+ */
+
+#include "piglit-util-gl.h"
+
+/*
+ * A test to check whether GL_ARB_fragment_shader_interlock operates as
+ * expected. This test simulates blending behaviour by using image loads/stores
+ * to a 3D texture. The blending formula used is:
+ * result = current_alpha * current_color + (1 - current_alpha) * 
previous_color
+ * Multisampling is also enabled and tested at 2, 4, 8 and 16.
+ */
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 42;
+   config.supports_gl_core_version = 42;
+   config.window_width = 100;
+   config.window_height = 100;
+   config.window_visual = PIGLI

Re: [Piglit] [PATCH] arb_shader_image_load_store: add format-layout-with-non-image-type.frag compiler test

2017-04-27 Thread Nicolai Hähnle

Reviewed-by: Nicolai Hähnle 

On 26.04.2017 18:28, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
 .../format-layout-with-non-image-type.frag | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
tests/spec/arb_shader_image_load_store/compiler/format-layout-with-non-image-type.frag

diff --git 
a/tests/spec/arb_shader_image_load_store/compiler/format-layout-with-non-image-type.frag
 
b/tests/spec/arb_shader_image_load_store/compiler/format-layout-with-non-image-type.frag
new file mode 100644
index 0..e072cba0d
--- /dev/null
+++ 
b/tests/spec/arb_shader_image_load_store/compiler/format-layout-with-non-image-type.frag
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_shader_image_load_store
+// [end config]
+
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+
+// From Section 4.4.6.2 (Format Layout Qualifiers) of the GLSL 4.50 spec:
+//
+// "Format layout qualifiers can be used on image variable declarations
+//  (those declared with a basic type having “image” in its keyword)."
+//
+// Easy enough to infer that format layout qualifiers should not be used with
+// non-image types.
+
+uniform Block {
+   layout (r32f) int x;
+};
+
+void main()
+{
+}




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] glx: add test for drawing to GL_FRONT between glxMakeCurrent()

2017-04-27 Thread Brian Paul

Looks great.  Thanks!

Reviewed-by: Brian Paul 

I'll push it for you.

-Brian


On 04/27/2017 09:42 AM, Józef Kucia wrote:

Based on the glx-fbo-binding test.

v2: - do not declare "piglit_width" and "piglit_height"
 - use piglit_get_gl_enum_name()

Signed-off-by: Józef Kucia 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99116
---

I do not have commit access.

---
  tests/all.py|   1 +
  tests/glx/CMakeLists.gl.txt |   1 +
  tests/glx/glx-multi-context-front.c | 113 
  3 files changed, 115 insertions(+)
  create mode 100644 tests/glx/glx-multi-context-front.c

diff --git a/tests/all.py b/tests/all.py
index 3cd3b47..6255ddf 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -662,6 +662,7 @@ with profile.test_list.group_manager(
  g(['glx-fbconfig-compliance'], run_concurrent=False)
  g(['glx-fbconfig-bad'], run_concurrent=False)
  g(['glx-fbo-binding'], run_concurrent=False)
+g(['glx-multi-context-front'], run_concurrent=False)
  g(['glx-multi-context-ib-1'], run_concurrent=False)
  g(['glx-multithread'], run_concurrent=False)
  g(['glx-multithread-texture'], run_concurrent=False)
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index ec5fc73..1e1c684 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -30,6 +30,7 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-destroycontext-1 glx-destroycontext-1.c)
piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
+   piglit_add_executable (glx-multi-context-front 
glx-multi-context-front.c)
piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
piglit_add_executable (glx-multithread glx-multithread.c)
target_link_libraries(glx-multithread pthread)
diff --git a/tests/glx/glx-multi-context-front.c 
b/tests/glx/glx-multi-context-front.c
new file mode 100644
index 000..4f76f3c
--- /dev/null
+++ b/tests/glx/glx-multi-context-front.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2011 VMware, Inc.
+ * Copyright (c) 2017 Józef Kucia 
+ *
+ * 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.
+ */
+
+/**
+ * Test clearing GL_FRONT across glXMakeCurrent calls.
+ *
+ * Reproduces bug in st/mesa front buffer allocation logic.
+ */
+
+#include "piglit-util-gl.h"
+#include "piglit-glx-util.h"
+
+static const char *test_name = "glx-multi-context-front";
+static const float green[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
+
+static Window Windows[2];
+static GLXContext ctx;
+
+
+enum piglit_result
+draw(Display *dpy)
+{
+   bool pass = true;
+   GLint buffer;
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glDrawBuffer(GL_FRONT);
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %s\n",
+  test_name, piglit_get_gl_enum_name(buffer));
+   pass = false;
+   }
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %s\n",
+  test_name, piglit_get_gl_enum_name(buffer));
+   pass = false;
+   }
+
+   glClearColor(green[0], green[1], green[2], green[3]);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glReadBuffer(GL_FRONT);
+   pass &= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
+ green);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+
+int
+main(int argc, char **argv)
+{
+   Display *dpy;
+   XVisualInfo *visinfo;
+   int i;
+
+   for (i = 1; i < argc; i++) {
+ 

[Piglit] [PATCH v2] glx: add test for drawing to GL_FRONT between glxMakeCurrent()

2017-04-27 Thread Józef Kucia
Based on the glx-fbo-binding test.

v2: - do not declare "piglit_width" and "piglit_height"
- use piglit_get_gl_enum_name()

Signed-off-by: Józef Kucia 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99116
---

I do not have commit access.

---
 tests/all.py|   1 +
 tests/glx/CMakeLists.gl.txt |   1 +
 tests/glx/glx-multi-context-front.c | 113 
 3 files changed, 115 insertions(+)
 create mode 100644 tests/glx/glx-multi-context-front.c

diff --git a/tests/all.py b/tests/all.py
index 3cd3b47..6255ddf 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -662,6 +662,7 @@ with profile.test_list.group_manager(
 g(['glx-fbconfig-compliance'], run_concurrent=False)
 g(['glx-fbconfig-bad'], run_concurrent=False)
 g(['glx-fbo-binding'], run_concurrent=False)
+g(['glx-multi-context-front'], run_concurrent=False)
 g(['glx-multi-context-ib-1'], run_concurrent=False)
 g(['glx-multithread'], run_concurrent=False)
 g(['glx-multithread-texture'], run_concurrent=False)
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index ec5fc73..1e1c684 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -30,6 +30,7 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-destroycontext-1 glx-destroycontext-1.c)
piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
+   piglit_add_executable (glx-multi-context-front 
glx-multi-context-front.c)
piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
piglit_add_executable (glx-multithread glx-multithread.c)
target_link_libraries(glx-multithread pthread)
diff --git a/tests/glx/glx-multi-context-front.c 
b/tests/glx/glx-multi-context-front.c
new file mode 100644
index 000..4f76f3c
--- /dev/null
+++ b/tests/glx/glx-multi-context-front.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2011 VMware, Inc.
+ * Copyright (c) 2017 Józef Kucia 
+ *
+ * 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.
+ */
+
+/**
+ * Test clearing GL_FRONT across glXMakeCurrent calls.
+ *
+ * Reproduces bug in st/mesa front buffer allocation logic.
+ */
+
+#include "piglit-util-gl.h"
+#include "piglit-glx-util.h"
+
+static const char *test_name = "glx-multi-context-front";
+static const float green[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
+
+static Window Windows[2];
+static GLXContext ctx;
+
+
+enum piglit_result
+draw(Display *dpy)
+{
+   bool pass = true;
+   GLint buffer;
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glDrawBuffer(GL_FRONT);
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %s\n",
+  test_name, piglit_get_gl_enum_name(buffer));
+   pass = false;
+   }
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %s\n",
+  test_name, piglit_get_gl_enum_name(buffer));
+   pass = false;
+   }
+
+   glClearColor(green[0], green[1], green[2], green[3]);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glReadBuffer(GL_FRONT);
+   pass &= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
+ green);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+
+int
+main(int argc, char **argv)
+{
+   Display *dpy;
+   XVisualInfo *visinfo;
+   int i;
+
+   for (i = 1; i < argc; i++) {
+   if (strcmp(argv[i], "-auto") == 0) {
+   piglit_automatic = 1;
+   break;
+   }

Re: [Piglit] [PATCH] arb_compute_shader: fix shared-atomics.comp

2017-04-27 Thread Samuel Pitoiset



On 04/27/2017 05:24 PM, Ilia Mirkin wrote:

 From ARB_compute_shader:

Dependencies on OpenGL 4.3 and ARB_shader_storage_buffer_object

 If OpenGL 4.3 and ARB_shader_storage_buffer_object are not supported, the
 spec language adding the built-in functions atomicAdd(), atomicMin(),
 atomicMax(), atomicAnd(), atomicOr(), atomicXor(), atomicExchange(), and
 atomicCompSwap() should be considered to be incorporated into this
 extension as-is, except that buffer variables will not be supported and
 thus cannot be used with these functions.  No "#extension" directive is
 necessary to use these functions in compute shaders.


Ah, I missed that point. Corner case :)



On Thu, Apr 27, 2017 at 11:19 AM, Samuel Pitoiset
 wrote:

atomic*() functions require either GLSL 4.30 or
GL_ARB_shader_storage_buffer_object.

Signed-off-by: Samuel Pitoiset 
---
  tests/spec/arb_compute_shader/compiler/shared-atomics.comp | 1 +
  1 file changed, 1 insertion(+)

diff --git a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp 
b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
index 3835bee03..a4f4a6855 100644
--- a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
+++ b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
@@ -6,6 +6,7 @@

  #version 420
  #extension GL_ARB_compute_shader: enable
+#extension GL_ARB_shader_storage_buffer_object : enable

  shared uint u;
  shared int i;
--
2.12.2

___
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] [PATCH] arb_compute_shader: fix shared-atomics.comp

2017-04-27 Thread Ilia Mirkin
From ARB_compute_shader:

Dependencies on OpenGL 4.3 and ARB_shader_storage_buffer_object

If OpenGL 4.3 and ARB_shader_storage_buffer_object are not supported, the
spec language adding the built-in functions atomicAdd(), atomicMin(),
atomicMax(), atomicAnd(), atomicOr(), atomicXor(), atomicExchange(), and
atomicCompSwap() should be considered to be incorporated into this
extension as-is, except that buffer variables will not be supported and
thus cannot be used with these functions.  No "#extension" directive is
necessary to use these functions in compute shaders.

On Thu, Apr 27, 2017 at 11:19 AM, Samuel Pitoiset
 wrote:
> atomic*() functions require either GLSL 4.30 or
> GL_ARB_shader_storage_buffer_object.
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  tests/spec/arb_compute_shader/compiler/shared-atomics.comp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp 
> b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
> index 3835bee03..a4f4a6855 100644
> --- a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
> +++ b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
> @@ -6,6 +6,7 @@
>
>  #version 420
>  #extension GL_ARB_compute_shader: enable
> +#extension GL_ARB_shader_storage_buffer_object : enable
>
>  shared uint u;
>  shared int i;
> --
> 2.12.2
>
> ___
> 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


[Piglit] [PATCH] arb_compute_shader: fix shared-atomics.comp

2017-04-27 Thread Samuel Pitoiset
atomic*() functions require either GLSL 4.30 or
GL_ARB_shader_storage_buffer_object.

Signed-off-by: Samuel Pitoiset 
---
 tests/spec/arb_compute_shader/compiler/shared-atomics.comp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp 
b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
index 3835bee03..a4f4a6855 100644
--- a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
+++ b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
@@ -6,6 +6,7 @@
 
 #version 420
 #extension GL_ARB_compute_shader: enable
+#extension GL_ARB_shader_storage_buffer_object : enable
 
 shared uint u;
 shared int i;
-- 
2.12.2

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


Re: [Piglit] [PATCH] glx: add test for drawing to GL_FRONT between glxMakeCurrent()

2017-04-27 Thread Brian Paul

On 04/27/2017 07:02 AM, Józef Kucia wrote:

Based on the glx-fbo-binding test.

Signed-off-by: Józef Kucia 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99116
---
  tests/all.py|   1 +
  tests/glx/CMakeLists.gl.txt |   1 +
  tests/glx/glx-multi-context-front.c | 114 
  3 files changed, 116 insertions(+)
  create mode 100644 tests/glx/glx-multi-context-front.c

diff --git a/tests/all.py b/tests/all.py
index 3cd3b47..6255ddf 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -662,6 +662,7 @@ with profile.test_list.group_manager(
  g(['glx-fbconfig-compliance'], run_concurrent=False)
  g(['glx-fbconfig-bad'], run_concurrent=False)
  g(['glx-fbo-binding'], run_concurrent=False)
+g(['glx-multi-context-front'], run_concurrent=False)
  g(['glx-multi-context-ib-1'], run_concurrent=False)
  g(['glx-multithread'], run_concurrent=False)
  g(['glx-multithread-texture'], run_concurrent=False)
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index ec5fc73..1e1c684 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -30,6 +30,7 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-destroycontext-1 glx-destroycontext-1.c)
piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
+   piglit_add_executable (glx-multi-context-front 
glx-multi-context-front.c)
piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
piglit_add_executable (glx-multithread glx-multithread.c)
target_link_libraries(glx-multithread pthread)
diff --git a/tests/glx/glx-multi-context-front.c 
b/tests/glx/glx-multi-context-front.c
new file mode 100644
index 000..74cd48b
--- /dev/null
+++ b/tests/glx/glx-multi-context-front.c
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2011 VMware, Inc.
+ * Copyright (c) 2017 Józef Kucia 
+ *
+ * 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.
+ */
+
+/**
+ * Test clearing GL_FRONT across glXMakeCurrent calls.
+ *
+ * Reproduces bug in st/mesa front buffer allocation logic.
+ */
+
+#include "piglit-util-gl.h"
+#include "piglit-glx-util.h"
+
+int piglit_width = 50, piglit_height = 50;


I don't think you need to declare the window size here.


+static const char *test_name = "glx-multi-context-front";
+static const float green[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
+
+static Window Windows[2];
+static GLXContext ctx;
+
+
+enum piglit_result
+draw(Display *dpy)
+{
+   bool pass = true;
+   GLint buffer;
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glDrawBuffer(GL_FRONT);
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %#x\n",
+  test_name, buffer);


You can use piglit_get_gl_enum_name() here and below to print the enum 
string in the error message.




+   pass = false;
+   }
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %#x\n",
+  test_name, buffer);
+   pass = false;
+   }
+
+   glClearColor(green[0], green[1], green[2], green[3]);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glReadBuffer(GL_FRONT);
+   pass &= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
+ green);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+
+int
+main(int argc, char **argv)
+{
+   Display *dpy;
+   XVisualInfo *visinfo;
+   int i;
+
+   for (i = 1; i < argc; i++) {
+   if (strcmp(argv[i], "-auto") == 0) {
+   

Re: [Piglit] [PATCH v2] gl30basic: add some extra suspected extension

2017-04-27 Thread Eric Anholt
Sandra Koroniewska  writes:

> This fixes
> spec/gl30basic test on Windows Intel or Nvidia driver according to page 693 
> of openGL 4.4 spec ("In additional to OpenGL extensions, there are also ARB 
> extensions to the related GLX and WGL APIs.").

I'm reading that bit of spec text as saying that "extensions in the
Khronos ecosystem start with GL_ or GLX_ or WGL_...", not "extensions
returned from the GL extension list may start with WGL_".

If Khronos's intent is that window system extensions appear in this
extensions string, then we should get that clarified and actually test
for the correct behavior, not permit both behaviors.


signature.asc
Description: PGP signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] gl30basic: add some extra suspected extension

2017-04-27 Thread Brian Paul

On 04/27/2017 05:04 AM, Sandra Koroniewska wrote:

This fixes
spec/gl30basic test on Windows Intel or Nvidia driver according to page 693 of openGL 4.4 
spec ("In additional to OpenGL extensions, there are also ARB extensions to the 
related GLX and WGL APIs.").
---
  tests/general/gl30basic.c | 8 ++--
  1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/general/gl30basic.c b/tests/general/gl30basic.c
index 2207787bb..08305a6f8 100644
--- a/tests/general/gl30basic.c
+++ b/tests/general/gl30basic.c
@@ -99,8 +99,12 @@ test_extension_list(void)
ext[0] != 'G' ||
ext[1] != 'L' ||
ext[2] != '_') {
- printf("%s: bad extension string [%d]: %s\n", Prog, k, ext);
- return PIGLIT_FAIL;
+  if (ext[0] != 'W' ||
+  ext[1] != 'G' ||
+  ext[2] != 'L') {
+  printf("%s: bad extension string [%d]: %s\n", Prog, k, ext);
+  return PIGLIT_FAIL;
+  }
}
if (strchr((char *) ext, ' ')) {
   printf("%s: extension string [%d] contains a space: %s\n", Prog, k, 
ext);



Hmm, It looks like NVIDIA's driver does report WGL_EXT_swap_control with 
glGetStringi(GL_EXTENSIONS, i).  That's really weird.  Is that what 
Intel's Windows driver does?


Doing that is actually counter to the extension spec for 
WGL_EXT_swap_control which says:


"""
Dependencies on WGL_EXT_extensions_string

Because there is no way to extend wgl, these calls are defined in
the ICD and can be called by obtaining the address with
wglGetProcAddress.  Because this extension is a WGL extension, it
is not included in the GL_EXTENSIONS string.  Its existence can be
determined with the WGL_EXT_extensions_string extension.

For historical reasons, GL_EXT_SWAP_CONTROL is also included in the
GL_EXTENSIONS string as return from glGetString.
"""

I believe the last sentence should read "GL_EXT_swap_control" and not 
"GL_EXT_SWAP_CONTROL".  The spec for GL_EXT_swap_control make a vague 
reference to a shortcoming in the WGL extension querying mechanism so 
I'm not sure what the whole store is there.  NVIDIA's driver does not 
support GL_EXT_swap_control AFAICT.


In any case, I think your patch is OK, but let's please put a comment in 
to the effect of:


/* Note: normally, glGetStringi(GL_EXTENSIONS, i) should only return
 * "core" OpenGL extension strings and not window system (WGL/GLX)
 * extensions.  However, NVIDIA's and Intel's Windows drivers include
 * WGL_EXT_swap_control in the core extensions list.  This is a special
 * case for that.
 */


-Brian

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


[Piglit] [PATCH] glx: add test for drawing to GL_FRONT between glxMakeCurrent()

2017-04-27 Thread Józef Kucia
Based on the glx-fbo-binding test.

Signed-off-by: Józef Kucia 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99116
---
 tests/all.py|   1 +
 tests/glx/CMakeLists.gl.txt |   1 +
 tests/glx/glx-multi-context-front.c | 114 
 3 files changed, 116 insertions(+)
 create mode 100644 tests/glx/glx-multi-context-front.c

diff --git a/tests/all.py b/tests/all.py
index 3cd3b47..6255ddf 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -662,6 +662,7 @@ with profile.test_list.group_manager(
 g(['glx-fbconfig-compliance'], run_concurrent=False)
 g(['glx-fbconfig-bad'], run_concurrent=False)
 g(['glx-fbo-binding'], run_concurrent=False)
+g(['glx-multi-context-front'], run_concurrent=False)
 g(['glx-multi-context-ib-1'], run_concurrent=False)
 g(['glx-multithread'], run_concurrent=False)
 g(['glx-multithread-texture'], run_concurrent=False)
diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index ec5fc73..1e1c684 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -30,6 +30,7 @@ IF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_executable (glx-destroycontext-1 glx-destroycontext-1.c)
piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
+   piglit_add_executable (glx-multi-context-front 
glx-multi-context-front.c)
piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
piglit_add_executable (glx-multithread glx-multithread.c)
target_link_libraries(glx-multithread pthread)
diff --git a/tests/glx/glx-multi-context-front.c 
b/tests/glx/glx-multi-context-front.c
new file mode 100644
index 000..74cd48b
--- /dev/null
+++ b/tests/glx/glx-multi-context-front.c
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2011 VMware, Inc.
+ * Copyright (c) 2017 Józef Kucia 
+ *
+ * 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.
+ */
+
+/**
+ * Test clearing GL_FRONT across glXMakeCurrent calls.
+ *
+ * Reproduces bug in st/mesa front buffer allocation logic.
+ */
+
+#include "piglit-util-gl.h"
+#include "piglit-glx-util.h"
+
+int piglit_width = 50, piglit_height = 50;
+static const char *test_name = "glx-multi-context-front";
+static const float green[4] = { 0.0f, 1.0f, 0.0f, 0.0f };
+
+static Window Windows[2];
+static GLXContext ctx;
+
+
+enum piglit_result
+draw(Display *dpy)
+{
+   bool pass = true;
+   GLint buffer;
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glDrawBuffer(GL_FRONT);
+
+   glXMakeCurrent(dpy, Windows[0], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %#x\n",
+  test_name, buffer);
+   pass = false;
+   }
+   glXMakeCurrent(dpy, Windows[1], ctx);
+   glGetIntegerv(GL_DRAW_BUFFER, &buffer);
+   if (buffer != GL_FRONT) {
+   printf("%s: Got unexpected draw buffer %#x\n",
+  test_name, buffer);
+   pass = false;
+   }
+
+   glClearColor(green[0], green[1], green[2], green[3]);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glReadBuffer(GL_FRONT);
+   pass &= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
+ green);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+
+int
+main(int argc, char **argv)
+{
+   Display *dpy;
+   XVisualInfo *visinfo;
+   int i;
+
+   for (i = 1; i < argc; i++) {
+   if (strcmp(argv[i], "-auto") == 0) {
+   piglit_automatic = 1;
+   break;
+   }
+   }
+
+   dpy = XOpenDisplay(NULL);
+   if (!dpy) {
+   fprintf(stderr, "Failed to open display\n");
+

[Piglit] [PATCH v2] gl30basic: add some extra suspected extension

2017-04-27 Thread Sandra Koroniewska
This fixes
spec/gl30basic test on Windows Intel or Nvidia driver according to page 693 of 
openGL 4.4 spec ("In additional to OpenGL extensions, there are also ARB 
extensions to the related GLX and WGL APIs.").
---
 tests/general/gl30basic.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/general/gl30basic.c b/tests/general/gl30basic.c
index 2207787bb..08305a6f8 100644
--- a/tests/general/gl30basic.c
+++ b/tests/general/gl30basic.c
@@ -99,8 +99,12 @@ test_extension_list(void)
   ext[0] != 'G' ||
   ext[1] != 'L' ||
   ext[2] != '_') {
- printf("%s: bad extension string [%d]: %s\n", Prog, k, ext);
- return PIGLIT_FAIL;
+  if (ext[0] != 'W' ||
+  ext[1] != 'G' ||
+  ext[2] != 'L') {
+  printf("%s: bad extension string [%d]: %s\n", Prog, k, ext);
+  return PIGLIT_FAIL;
+  }
   }
   if (strchr((char *) ext, ' ')) {
  printf("%s: extension string [%d] contains a space: %s\n", Prog, k, 
ext);
-- 
2.11.0.windows.1

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


[Piglit] [PATCH] shader_runner: clean up resident handles at exit time

2017-04-27 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset 
---
 tests/shaders/shader_runner.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 2047d6cb0..6ac5f9893 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3765,6 +3765,9 @@ piglit_display(void)
for (i = 0; i < ARRAY_SIZE(texture_bindings); i++)
clear_texture_binding(i);
 
+   for (i = 0; i < ARRAY_SIZE(resident_handles); i++)
+   clear_resident_handle(i);
+
if (prog != 0) {
glDeleteProgram(prog);
glUseProgram(0);
-- 
2.12.2

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


Re: [Piglit] [PATCH 5/6] arb_bindless_texture: add inout-non-matching-type.frag compiler tests

2017-04-27 Thread Samuel Pitoiset



On 04/27/2017 10:02 AM, Samuel Pitoiset wrote:



On 04/27/2017 02:24 AM, Timothy Arceri wrote:
Same comment for 3-5 as for comment 2. I'd rather see varyables 
function params and return values used as frag/vert outputs otherwise 
there is no guarantee the compiler won't just optimise the invalid 
uses away.


I think it's a bit overkill. Most of the compiler tests in piglit are 
really pretty simple. Looks like only very few of them guarantee that 
the compiler won't optimize. Yeah, it's sad.


I have written and tested this series against NV blob. At least, this 
one doesn't need anything else because it fails as-is.


I understand your point of view though. But the way I designed the 
compiler tests for ARB_bindless_texture would need a bunch of changes.






On 27/04/17 08:52, Samuel Pitoiset wrote:

"Replace Section 4.1.X, (Images)"

 "As function parameters, images may be only passed to images
  of matching type."

"Replace Section 4.1.7 (Samplers), p. 25"

 "As function parameters, samplers may be only passed to samplers
  of matching type."

Two simple test cases to make sure types are checked.

Signed-off-by: Samuel Pitoiset 
---
  .../compiler/images/inout-non-matching-type.frag   | 26 
++
  .../compiler/samplers/inout-non-matching-type.frag | 25 
+

  2 files changed, 51 insertions(+)
  create mode 100644 
tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 

  create mode 100644 
tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 



diff --git 
a/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 
b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 


new file mode 100644
index 0..0ff8d5bc9
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 


@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture 
GL_ARB_shader_image_load_store

+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.X, (Images)"
+//
+//  "As function parameters, images may be only passed to images of
+//   matching type."
+
+void f(inout image2D p)
+{
+}
+
+void main()
+{
+writeonly image1D u;
+f(u);
+}
diff --git 
a/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 
b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 


new file mode 100644
index 0..25a5724cf
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 


@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.7 (Samplers), p. 25"
+//
+//  "As function parameters, samplers may be only passed to samplers of
+//   matching type."
+
+void f(inout sampler2D p)
+{
+}
+
+void main()
+{
+sampler1D u;
+f(u);
+}


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


Re: [Piglit] [PATCH 5/6] arb_bindless_texture: add inout-non-matching-type.frag compiler tests

2017-04-27 Thread Samuel Pitoiset



On 04/27/2017 02:24 AM, Timothy Arceri wrote:
Same comment for 3-5 as for comment 2. I'd rather see varyables function 
params and return values used as frag/vert outputs otherwise there is no 
guarantee the compiler won't just optimise the invalid uses away.


I think it's a bit overkill. Most of the compiler tests in piglit are 
really pretty simple. Looks like only very few of them guarantee that 
the compiler won't optimize. Yeah, it's sad.


I have written and tested this series against NV blob. At least, this 
one doesn't need anything else because it fails as-is.




On 27/04/17 08:52, Samuel Pitoiset wrote:

"Replace Section 4.1.X, (Images)"

 "As function parameters, images may be only passed to images
  of matching type."

"Replace Section 4.1.7 (Samplers), p. 25"

 "As function parameters, samplers may be only passed to samplers
  of matching type."

Two simple test cases to make sure types are checked.

Signed-off-by: Samuel Pitoiset 
---
  .../compiler/images/inout-non-matching-type.frag   | 26 
++
  .../compiler/samplers/inout-non-matching-type.frag | 25 
+

  2 files changed, 51 insertions(+)
  create mode 100644 
tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 

  create mode 100644 
tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 



diff --git 
a/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 
b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 


new file mode 100644
index 0..0ff8d5bc9
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag 


@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture 
GL_ARB_shader_image_load_store

+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.X, (Images)"
+//
+//  "As function parameters, images may be only passed to images of
+//   matching type."
+
+void f(inout image2D p)
+{
+}
+
+void main()
+{
+writeonly image1D u;
+f(u);
+}
diff --git 
a/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 
b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 


new file mode 100644
index 0..25a5724cf
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag 


@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.7 (Samplers), p. 25"
+//
+//  "As function parameters, samplers may be only passed to samplers of
+//   matching type."
+
+void f(inout sampler2D p)
+{
+}
+
+void main()
+{
+sampler1D u;
+f(u);
+}


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


Re: [Piglit] [PATCH 2/6] arb_bindless_texture: add uniform-block-initializer.frag compiler tests

2017-04-27 Thread Samuel Pitoiset



On 04/27/2017 02:20 AM, Timothy Arceri wrote:


On 27/04/17 08:52, Samuel Pitoiset wrote:

"Replace Section 4.1.7 (Samplers), p. 25"

 "As uniforms in the default uniform block, samplers may be
  initialized only with the OpenGL API; they cannot be declared
  with an initializer in a shader."

"Replace Section 4.1.X, (Images)"

 "As uniforms in the default uniform block, images may be
  initialized only with the OpenGL API; they cannot be declared
  with an initializer in a shader."



You are missing the bit to say where you are quoting this text from in 
this commit message. I know it should be obvious but would be nice to 
add for completeness.


Yeah, it looked obvious but I can add "The ARB_bindless_texture spec 
says:" for sure. :)






Just to be sure samplers/images are not too relaxed when bindless
texture is enabled.

Signed-off-by: Samuel Pitoiset 
---
  .../compiler/images/uniform-block-initializer.frag | 23 
++
  .../samplers/uniform-block-initializer.frag| 22 
+

  2 files changed, 45 insertions(+)
  create mode 100644 
tests/spec/arb_bindless_texture/compiler/images/uniform-block-initializer.frag 

  create mode 100644 
tests/spec/arb_bindless_texture/compiler/samplers/uniform-block-initializer.frag 



diff --git 
a/tests/spec/arb_bindless_texture/compiler/images/uniform-block-initializer.frag 
b/tests/spec/arb_bindless_texture/compiler/images/uniform-block-initializer.frag 


new file mode 100644
index 0..2148ea04a
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/compiler/images/uniform-block-initializer.frag 


@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture 
GL_ARB_shader_image_load_store

+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.X, (Images)"
+//
+//  "As uniforms in the default uniform block, images may be initialized
+//   only with the OpenGL API; they cannot be declared with an 
initializer

+//   in a shader."
+
+writeonly uniform image2D img = 0 > +
+void main()
+{
+}


I don't really like tests like this. IMO when testing variable/uniforms 
we should always make sure they are used. There is nothing in the spec 
that says the uniform cannot be optimised away before validation is 
done. I'm actually a little surprised that doesn't happen in this case, 
my feeling is the test would fail on Nvidia where they are very 
aggressive with optimisations. The spec also doesn't say if this is a 
link or compile time error.


A compile-time error makes more sense to me.

I will update the test.



Either way I'd rather have the uniform used.


diff --git 
a/tests/spec/arb_bindless_texture/compiler/samplers/uniform-block-initializer.frag 
b/tests/spec/arb_bindless_texture/compiler/samplers/uniform-block-initializer.frag 


new file mode 100644
index 0..d76ab8442
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/compiler/samplers/uniform-block-initializer.frag 


@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.7 (Samplers), p. 25"
+//
+//  "As uniforms in the default uniform block, samplers may be 
initialized
+//   only with the OpenGL API; they cannot be declared with an 
initializer

+//   in a shader."
+
+uniform sampler2D tex = 0;
+
+void main()
+{
+}


___
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