[Piglit] [PATCH 4/8] texsubimage-depth-formats: Require ARB_depth_texture

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 tests/texturing/texsubimage-depth-formats.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/texturing/texsubimage-depth-formats.c 
b/tests/texturing/texsubimage-depth-formats.c
index aa6f586..ead2811 100644
--- a/tests/texturing/texsubimage-depth-formats.c
+++ b/tests/texturing/texsubimage-depth-formats.c
@@ -170,6 +170,8 @@ load_texture(int formats_idx, int tex_size_idx)
 void
 piglit_init(int argc, char **argv)
 {
+   piglit_require_extension("GL_ARB_depth_texture");
+
for (int i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "pbo")) {
piglit_require_extension("GL_ARB_pixel_buffer_object");
-- 
2.9.4

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


[Piglit] [PATCH 2/8] fbo: Require ARB_depth_texture in more tests

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

All of these tests fail when run on implementations that support
ARB_framebuffer_object but not ARB_depth_texture.

Signed-off-by: Ian Romanick 
---
 tests/fbo/fbo-depth-tex1d.c | 1 +
 tests/fbo/fbo-incomplete-invalid-texture.c  | 2 +-
 ...same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/fbo/fbo-depth-tex1d.c b/tests/fbo/fbo-depth-tex1d.c
index 51acd9a..e0810e3 100644
--- a/tests/fbo/fbo-depth-tex1d.c
+++ b/tests/fbo/fbo-depth-tex1d.c
@@ -211,6 +211,7 @@ void piglit_init(int argc, char **argv)
unsigned i, p;
 
piglit_require_extension("GL_EXT_framebuffer_object");
+   piglit_require_extension("GL_ARB_depth_texture");
 
for (p = 1; p < argc; p++) {
for (i = 0; i < sizeof(formats)/sizeof(*formats); i++) {
diff --git a/tests/fbo/fbo-incomplete-invalid-texture.c 
b/tests/fbo/fbo-incomplete-invalid-texture.c
index ac183b4..48d6c86 100644
--- a/tests/fbo/fbo-incomplete-invalid-texture.c
+++ b/tests/fbo/fbo-incomplete-invalid-texture.c
@@ -52,7 +52,7 @@ piglit_init(int argc, char **argv)
GLenum status;
 
piglit_require_extension("GL_ARB_framebuffer_object");
-
+   piglit_require_extension("GL_ARB_depth_texture");
 
glGenTextures(1, );
glBindTexture(GL_TEXTURE_2D, tex);
diff --git 
a/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c
 
b/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c
index 389f92c..fb0e59f 100644
--- 
a/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c
+++ 
b/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c
@@ -143,6 +143,7 @@ void piglit_init(int argc, char **argv)
GLuint tex;
 
piglit_require_extension("GL_ARB_framebuffer_object");
+   piglit_require_extension("GL_ARB_depth_texture");
 
glGenTextures(1, );
glGenFramebuffers(1, );
-- 
2.9.4

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


[Piglit] [PATCH 6/8] fbo: Use renderbuffers instead of textures

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

This allows fbo-blit-stretch to run on platforms that support
ARB_framebuffer_object but not ARB_texture_non_power_of_two.

Coneptually similar to 7b3f6d5.

Signed-off-by: Ian Romanick 
---
 tests/fbo/fbo-blit-stretch.cpp | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/tests/fbo/fbo-blit-stretch.cpp b/tests/fbo/fbo-blit-stretch.cpp
index 935d0d4..da85335 100644
--- a/tests/fbo/fbo-blit-stretch.cpp
+++ b/tests/fbo/fbo-blit-stretch.cpp
@@ -321,22 +321,22 @@ run_test(const TestCase )
 
GLboolean pass;
 
-   GLuint tex;
+   GLuint rbo;
GLuint fbo;
GLenum status;
 
glGenFramebuffers(1, );
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
 
-   tex = piglit_rgbw_texture(GL_RGBA, test.srcW, test.srcH, GL_FALSE, 
GL_TRUE, GL_UNSIGNED_NORMALIZED);
+   glGenRenderbuffers(1, );
+   glBindRenderbuffer(GL_RENDERBUFFER, rbo);
+   glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, test.srcW, test.srcH);
+   glBindRenderbuffer(GL_RENDERBUFFER, 0);
 
-   glBindTexture(GL_TEXTURE_2D, tex);
-
-   glFramebufferTexture2D(GL_FRAMEBUFFER,
-  GL_COLOR_ATTACHMENT0,
-  GL_TEXTURE_2D,
-  tex,
-  0);
+   glFramebufferRenderbuffer(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0,
+ GL_RENDERBUFFER,
+ rbo);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
 
@@ -344,6 +344,12 @@ run_test(const TestCase )
if (status != GL_FRAMEBUFFER_COMPLETE) {
pass = GL_TRUE;
} else {
+   GLubyte *image = piglit_rgbw_image_ubyte(test.srcW, test.srcH,
+GL_TRUE);
+   glDrawPixels(test.srcW, test.srcH, GL_RGBA, GL_UNSIGNED_BYTE,
+image);
+   free(image);
+
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 
@@ -364,7 +370,7 @@ run_test(const TestCase )
 
glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo);
glDeleteFramebuffers(1, );
-   glDeleteTextures(1, );
+   glDeleteRenderbuffers(1, );
 
return pass;
 }
-- 
2.9.4

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


[Piglit] [PATCH 3/8] getteximage-depth: Require ARB_depth_texture

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 tests/texturing/getteximage-depth.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/texturing/getteximage-depth.c 
b/tests/texturing/getteximage-depth.c
index 2986962..bc79466 100644
--- a/tests/texturing/getteximage-depth.c
+++ b/tests/texturing/getteximage-depth.c
@@ -592,6 +592,8 @@ piglit_init(int argc, char **argv)
enum piglit_result status = PIGLIT_PASS;
bool ret;
 
+   piglit_require_extension("GL_ARB_depth_texture");
+
for (i = 0; i < ARRAY_SIZE(target_list); i++) {
 
switch (target_list[i]) {
-- 
2.9.4

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


[Piglit] [PATCH 7/8] teximage-errors: Only run the depth texture subtests when depth textures are supported

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

Fixes failure on radeon and probably others.

Signed-off-by: Ian Romanick 
---
 tests/texturing/teximage-errors.c | 32 ++--
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/tests/texturing/teximage-errors.c 
b/tests/texturing/teximage-errors.c
index 1c9fe14..bb993d3 100644
--- a/tests/texturing/teximage-errors.c
+++ b/tests/texturing/teximage-errors.c
@@ -236,20 +236,24 @@ piglit_display(void)
pass = test_targets() && pass;
pass = test_pos_and_sizes() && pass;
 
-  /*  From OpenGL 3.3 spec, page 141:
-   *"Textures with a base internal format of DEPTH_COMPONENT or
-   * DEPTH_STENCIL require either depth component data or depth/stencil
-   * component data. Textures with other base internal formats require
-   * RGBA component data. The error INVALID_OPERATION is generated if
-   * one of the base internal format and format is DEPTH_COMPONENT or
-   * DEPTH_STENCIL, and the other is neither of these values."
-   */
-   pass = test_depth_formats(formats_allowed, GL_NO_ERROR,
- ARRAY_SIZE(formats_allowed))
-  && pass;
-   pass = test_depth_formats(formats_not_allowed, GL_INVALID_OPERATION,
- ARRAY_SIZE(formats_not_allowed))
-  && pass;
+   if (piglit_get_gl_version() >= 14
+   || piglit_is_extension_supported("GL_ARB_depth_texture")) {
+  /*  From OpenGL 3.3 spec, page 141:
+   *"Textures with a base internal format of DEPTH_COMPONENT or
+   * DEPTH_STENCIL require either depth component data or 
depth/stencil
+   * component data. Textures with other base internal formats 
require
+   * RGBA component data. The error INVALID_OPERATION is generated 
if
+   * one of the base internal format and format is DEPTH_COMPONENT 
or
+   * DEPTH_STENCIL, and the other is neither of these values."
+   */
+  pass = test_depth_formats(formats_allowed, GL_NO_ERROR,
+ARRAY_SIZE(formats_allowed))
+  && pass;
+  pass = test_depth_formats(formats_not_allowed, GL_INVALID_OPERATION,
+ARRAY_SIZE(formats_not_allowed))
+  && pass;
+   }
+
return pass ? PIGLIT_PASS: PIGLIT_FAIL;
 }
 
-- 
2.9.4

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


[Piglit] [PATCH 8/8] teximage-errors: Fix comment formatting after previous commit

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 tests/texturing/teximage-errors.c | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/texturing/teximage-errors.c 
b/tests/texturing/teximage-errors.c
index bb993d3..fe95c82 100644
--- a/tests/texturing/teximage-errors.c
+++ b/tests/texturing/teximage-errors.c
@@ -238,13 +238,16 @@ piglit_display(void)
 
if (piglit_get_gl_version() >= 14
|| piglit_is_extension_supported("GL_ARB_depth_texture")) {
-  /*  From OpenGL 3.3 spec, page 141:
-   *"Textures with a base internal format of DEPTH_COMPONENT or
-   * DEPTH_STENCIL require either depth component data or 
depth/stencil
-   * component data. Textures with other base internal formats 
require
-   * RGBA component data. The error INVALID_OPERATION is generated 
if
-   * one of the base internal format and format is DEPTH_COMPONENT 
or
-   * DEPTH_STENCIL, and the other is neither of these values."
+  /* Section 3.8.3 (Texture Image Specification) of the OpenGL 3.3
+   * Core Profile spec says:
+   *
+   *Textures with a base internal format of DEPTH_COMPONENT or
+   *DEPTH_STENCIL require either depth component data or
+   *depth/stencil component data. Textures with other base
+   *internal formats require RGBA component data. The error
+   *INVALID_OPERATION is generated if one of the base internal
+   *format and format is DEPTH_COMPONENT or DEPTH_STENCIL, and
+   *the other is neither of these values.
*/
   pass = test_depth_formats(formats_allowed, GL_NO_ERROR,
 ARRAY_SIZE(formats_allowed))
-- 
2.9.4

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


[Piglit] [PATCH 1/8] fbo: Fix trivial typo in comment

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

Signed-off-by: Ian Romanick 
---
 tests/fbo/fbo-incomplete-invalid-texture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/fbo/fbo-incomplete-invalid-texture.c 
b/tests/fbo/fbo-incomplete-invalid-texture.c
index cd8adaf..ac183b4 100644
--- a/tests/fbo/fbo-incomplete-invalid-texture.c
+++ b/tests/fbo/fbo-incomplete-invalid-texture.c
@@ -61,7 +61,7 @@ piglit_init(int argc, char **argv)
glGenFramebuffers(1, );
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
 
-   /* The format of the pixel data is invalide for the specified
+   /* The format of the pixel data is invalid for the specified
 * internalFormat.  This should fail and generate
 * GL_INVALID_OPERATION.  This leaves the texture in a weird, broken
 * state.
-- 
2.9.4

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


[Piglit] [PATCH 5/8] fbo: Remove support for the checkerboard test pattern

2017-05-30 Thread Ian Romanick
From: Ian Romanick 

The comment says (correctly) that it should not be used, and removing it
make a later change easier.

Signed-off-by: Ian Romanick 
---
 tests/fbo/fbo-blit-stretch.cpp | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/tests/fbo/fbo-blit-stretch.cpp b/tests/fbo/fbo-blit-stretch.cpp
index 75c787a..935d0d4 100644
--- a/tests/fbo/fbo-blit-stretch.cpp
+++ b/tests/fbo/fbo-blit-stretch.cpp
@@ -41,13 +41,6 @@
 #include "piglit-util-gl.h"
 
 
-/*
- * XXX: Checkerboard is not a good test pattern, because OpenGL spec allows the
- * implementation to clamp against source rectangle edge, as oposed to clamp
- * against the source edges, causing different results along the edge.
- */
-#define CHECKERBOARD 0
-
 #define DSTW 200
 #define DSTH 150
 
@@ -193,11 +186,7 @@ lerp2d(float xy00, float xy01, float xy10, float xy11, 
float wx, float wy)
 }
 
 static float clearColor[4] = {
-#if CHECKERBOARD
-   0.0, 0.0, 1.0, 1.0
-#else
0.5, 0.5, 0.5, 0.5
-#endif
 };
 
 static GLboolean
@@ -339,13 +328,8 @@ run_test(const TestCase )
glGenFramebuffers(1, );
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
 
-#if CHECKERBOARD
-   const float color1[4] = {1.0f, 0.0f, 0.0f, 1.0f};
-   const float color2[4] = {0.0f, 1.0f, 0.0f, 1.0f};
-   tex = piglit_checkerboard_texture(0, 0, test.srcW, test.srcH, 1, 1,  
color1, color2);
-#else
tex = piglit_rgbw_texture(GL_RGBA, test.srcW, test.srcH, GL_FALSE, 
GL_TRUE, GL_UNSIGNED_NORMALIZED);
-#endif
+
glBindTexture(GL_TEXTURE_2D, tex);
 
glFramebufferTexture2D(GL_FRAMEBUFFER,
-- 
2.9.4

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


Re: [Piglit] [PATCH] test/gleantest: fix missing --quick property from quick profile

2017-05-30 Thread Dylan Baker
Quoting Timothy Arceri (2017-05-18 23:21:13)
> ---
>  framework/test/gleantest.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/framework/test/gleantest.py b/framework/test/gleantest.py
> index b2d56f3..0220c1a 100644
> --- a/framework/test/gleantest.py
> +++ b/framework/test/gleantest.py
> @@ -49,21 +49,21 @@ class GleanTest(Test):
>  
>  def __init__(self, name, **kwargs):
>  super(GleanTest, self).__init__(
>  [self._EXECUTABLE, "-o", "-v", "-v", "-v", "-t", "+" + name],
>  **kwargs)
>  
>  @Test.command.getter
>  def command(self):
>  return super(GleanTest, self).command + self.GLOBAL_PARAMS
>  
> -@Test.command.setter
> +@command.setter
>  def command(self, new):
>  self._command = [n for n in new if not n in self.GLOBAL_PARAMS]
>  
>  def interpret_result(self):
>  if self.result.returncode != 0 or 'FAIL' in self.result.out:
>  self.result.result = 'fail'
>  else:
>  self.result.result = 'pass'
>  super(GleanTest, self).interpret_result()
>  
> -- 
> 2.9.4

I know this already landed, but:

Oops. I fixed the other instances of that. That is the correct fix I think, and
it does make sense, but it's a pretty obscure case in the python class model.
property is actually a special kind of class called a descriptor, basically it
provides a getter, setter, and deleter method that get called when you query,
assign, or delete the attribute. When the subclass overrides 
@Test.command.getter
you actually create a new instance, so if you call
@Test.command.{getter,setter,deleter} twice only one of the new instances is
kept.

Dylan

> 
> ___
> 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


[Piglit] [PATCH] glsl-1.50: add linker test for unused in out blocks

2017-05-30 Thread Józef Kucia
This test exposes a Mesa GLSL linker bug. The test fails with the
following error message:

  error: Input block `blk' is not an output of the previous stage

Section 4.3.4 (Inputs) of the GLSL 1.50 spec says:

"Only the input variables that are actually read need to be written
by the previous stage; it is allowed to have superfluous
declarations of input variables."
---
 .../interstage-multiple-shader-objects.shader_test | 38 ++
 1 file changed, 38 insertions(+)
 create mode 100644 
tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test

diff --git 
a/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test 
b/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test
new file mode 100644
index 000..66a46d5
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test
@@ -0,0 +1,38 @@
+# Exercises a Mesa GLSL linker bug.
+#
+# Note that the output block is not used and it is not declared in the main
+# shader object.
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+out blk {
+  vec4 foo;
+} inst;
+
+void set_output(vec4 v)
+{
+  gl_Position = v;
+}
+
+[vertex shader]
+void set_output(vec4 v);
+
+void main()
+{
+  set_output(vec4(1.0));
+}
+
+[fragment shader]
+in blk {
+  vec4 foo;
+} inst;
+
+void main()
+{
+  gl_FragColor = vec4(1.0);
+}
+
+[test]
+link success
-- 
2.10.2

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


Re: [Piglit] [PATCH] arb_texture_view: add simple test for rendering to R32UI texture view

2017-05-30 Thread Marek Olšák
Pushed, thanks!

Marek

On Tue, May 30, 2017 at 3:28 PM, Józef Kucia  wrote:
> This test exposes a Radeonsi driver bug.
>
> The test works on Nvidia binary driver and Mesa Intel (Broadwell).
> It fails on Radeonsi with Cape Verde GPU.
> ---
>  tests/all.py  |   1 +
>  tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
>  tests/spec/arb_texture_view/rendering-r32ui.c | 101 
> ++
>  3 files changed, 103 insertions(+)
>  create mode 100644 tests/spec/arb_texture_view/rendering-r32ui.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 38aabc1..f0a7c05 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2613,6 +2613,7 @@ with profile.test_list.group_manager(
>  g(['arb_texture_view-rendering-levels'], 'rendering-levels')
>  g(['arb_texture_view-rendering-layers'], 'rendering-layers')
>  g(['arb_texture_view-rendering-formats'], 'rendering-formats')
> +g(['arb_texture_view-rendering-r32ui'], 'rendering-r32ui')
>  g(['arb_texture_view-lifetime-format'], 'lifetime-format')
>  g(['arb_texture_view-getteximage-srgb'], 'getteximage-srgb')
>  g(['arb_texture_view-texsubimage-levels'], 'texsubimage-levels')
> diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
> b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> index 47b3320..39330da 100644
> --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
> +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> @@ -23,6 +23,7 @@ piglit_add_executable(arb_texture_view-queries queries.c)
>  piglit_add_executable(arb_texture_view-rendering-formats rendering-formats.c)
>  piglit_add_executable(arb_texture_view-rendering-layers rendering_layers.c 
> common.c)
>  piglit_add_executable(arb_texture_view-rendering-levels rendering_levels.c 
> common.c)
> +piglit_add_executable(arb_texture_view-rendering-r32ui rendering-r32ui.c)
>  piglit_add_executable(arb_texture_view-rendering-target rendering_target.c 
> common.c)
>  piglit_add_executable(arb_texture_view-sampling-2d-array-as-2d-layer 
> sampling-2d-array-as-2d-layer.c)
>  piglit_add_executable(arb_texture_view-sampling-2d-array-as-cubemap-array 
> sampling-2d-array-as-cubemap-array.c)
> diff --git a/tests/spec/arb_texture_view/rendering-r32ui.c 
> b/tests/spec/arb_texture_view/rendering-r32ui.c
> new file mode 100644
> index 000..4a4037b
> --- /dev/null
> +++ b/tests/spec/arb_texture_view/rendering-r32ui.c
> @@ -0,0 +1,101 @@
> +/*
> + * 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.
> + */
> +
> +/**
> + * \file rendering-r32ui.c
> + * Exercises a Radeonsi bug.
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +config.supports_gl_compat_version = 30;
> +config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const char *vs =
> +   "#version 130\n"
> +   "void main() { \n"
> +   "   gl_Position = gl_Vertex;\n"
> +   "}\n";
> +
> +static const char *ps =
> +   "#version 130\n"
> +   "out uvec4 color;\n"
> +   "void main() {\n"
> +   "   color = uvec4(0xff, 0, 0, 0);\n"
> +   "}\n";
> +
> +#define TEX_SIZE 64
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +   return PIGLIT_FAIL;
> +}
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +   GLuint tex, view, framebuffer, prog;
> +   GLuint data[TEX_SIZE * TEX_SIZE];
> +   bool pass = true;
> +
> +   piglit_require_gl_version(30);
> +   piglit_require_extension("GL_ARB_texture_view");
> +
> +   glGenTextures(1, );
> +   glBindTexture(GL_TEXTURE_2D, tex);
> +   glTexStorage2D(GL_TEXTURE_2D, 1, GL_R32F, TEX_SIZE, TEX_SIZE);
> +
> +   glGenTextures(1, );
> +   glTextureView(view, GL_TEXTURE_2D, tex, GL_R32UI, 0, 1, 

[Piglit] [PATCH] arb_texture_view: add simple test for rendering to R32UI texture view

2017-05-30 Thread Józef Kucia
This test exposes a Radeonsi driver bug.

The test works on Nvidia binary driver and Mesa Intel (Broadwell).
It fails on Radeonsi with Cape Verde GPU.
---
 tests/all.py  |   1 +
 tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
 tests/spec/arb_texture_view/rendering-r32ui.c | 101 ++
 3 files changed, 103 insertions(+)
 create mode 100644 tests/spec/arb_texture_view/rendering-r32ui.c

diff --git a/tests/all.py b/tests/all.py
index 38aabc1..f0a7c05 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2613,6 +2613,7 @@ with profile.test_list.group_manager(
 g(['arb_texture_view-rendering-levels'], 'rendering-levels')
 g(['arb_texture_view-rendering-layers'], 'rendering-layers')
 g(['arb_texture_view-rendering-formats'], 'rendering-formats')
+g(['arb_texture_view-rendering-r32ui'], 'rendering-r32ui')
 g(['arb_texture_view-lifetime-format'], 'lifetime-format')
 g(['arb_texture_view-getteximage-srgb'], 'getteximage-srgb')
 g(['arb_texture_view-texsubimage-levels'], 'texsubimage-levels')
diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
b/tests/spec/arb_texture_view/CMakeLists.gl.txt
index 47b3320..39330da 100644
--- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
@@ -23,6 +23,7 @@ piglit_add_executable(arb_texture_view-queries queries.c)
 piglit_add_executable(arb_texture_view-rendering-formats rendering-formats.c)
 piglit_add_executable(arb_texture_view-rendering-layers rendering_layers.c 
common.c)
 piglit_add_executable(arb_texture_view-rendering-levels rendering_levels.c 
common.c)
+piglit_add_executable(arb_texture_view-rendering-r32ui rendering-r32ui.c)
 piglit_add_executable(arb_texture_view-rendering-target rendering_target.c 
common.c)
 piglit_add_executable(arb_texture_view-sampling-2d-array-as-2d-layer 
sampling-2d-array-as-2d-layer.c)
 piglit_add_executable(arb_texture_view-sampling-2d-array-as-cubemap-array 
sampling-2d-array-as-cubemap-array.c)
diff --git a/tests/spec/arb_texture_view/rendering-r32ui.c 
b/tests/spec/arb_texture_view/rendering-r32ui.c
new file mode 100644
index 000..4a4037b
--- /dev/null
+++ b/tests/spec/arb_texture_view/rendering-r32ui.c
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+/**
+ * \file rendering-r32ui.c
+ * Exercises a Radeonsi bug.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+config.supports_gl_compat_version = 30;
+config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *vs =
+   "#version 130\n"
+   "void main() { \n"
+   "   gl_Position = gl_Vertex;\n"
+   "}\n";
+
+static const char *ps =
+   "#version 130\n"
+   "out uvec4 color;\n"
+   "void main() {\n"
+   "   color = uvec4(0xff, 0, 0, 0);\n"
+   "}\n";
+
+#define TEX_SIZE 64
+
+enum piglit_result
+piglit_display(void)
+{
+   return PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+   GLuint tex, view, framebuffer, prog;
+   GLuint data[TEX_SIZE * TEX_SIZE];
+   bool pass = true;
+
+   piglit_require_gl_version(30);
+   piglit_require_extension("GL_ARB_texture_view");
+
+   glGenTextures(1, );
+   glBindTexture(GL_TEXTURE_2D, tex);
+   glTexStorage2D(GL_TEXTURE_2D, 1, GL_R32F, TEX_SIZE, TEX_SIZE);
+
+   glGenTextures(1, );
+   glTextureView(view, GL_TEXTURE_2D, tex, GL_R32UI, 0, 1, 0, 1);
+
+   glGenFramebuffers(1, );
+   glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
+   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+  GL_TEXTURE_2D, view, 0);
+
+   prog = piglit_build_simple_program(vs, ps);
+   glUseProgram(prog);
+
+   piglit_draw_rect(-1, -1, 2, 2);
+
+ 

Re: [Piglit] [PATCH] arb_get_program_binary: check correctly got_error

2017-05-30 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 29/05/17 16:18, Juan A. Suarez Romero wrote:

Seems it was checking if *not* error got, instead of the other way
around.

Suggested-by: Fabio Lagalla
Signed-off-by: Juan A. Suarez Romero 
---
  tests/spec/arb_get_program_binary/retrievable_hint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_get_program_binary/retrievable_hint.c 
b/tests/spec/arb_get_program_binary/retrievable_hint.c
index 8283c5b..9263a89 100644
--- a/tests/spec/arb_get_program_binary/retrievable_hint.c
+++ b/tests/spec/arb_get_program_binary/retrievable_hint.c
@@ -79,7 +79,7 @@ piglit_init(int argc, char **argv)
 */
value = 0xDEADBEEF;
glGetProgramiv(prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, );
-   got_error = piglit_check_gl_error(0);
+   got_error = !piglit_check_gl_error(0);
  
  	if (!got_error) {

if (value == 0xDEADBEEF) {



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


Re: [Piglit] [PATCH] arb_shader_image_load_store: set KHR_no_error compatibility

2017-05-30 Thread Timothy Arceri

Looks good to me:

Reviewed-by: Timothy Arceri 

On 26/05/17 06:21, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset 
---
  tests/spec/arb_shader_image_load_store/atomicity.c  | 1 +
  tests/spec/arb_shader_image_load_store/bitcast.c| 1 +
  tests/spec/arb_shader_image_load_store/coherency.c  | 1 +
  tests/spec/arb_shader_image_load_store/dead-fragments.c | 1 +
  tests/spec/arb_shader_image_load_store/early-z.c| 1 +
  tests/spec/arb_shader_image_load_store/host-mem-barrier.c   | 1 +
  tests/spec/arb_shader_image_load_store/indexing.c   | 1 +
  tests/spec/arb_shader_image_load_store/invalid.c| 1 +
  tests/spec/arb_shader_image_load_store/layer.c  | 1 +
  tests/spec/arb_shader_image_load_store/level.c  | 1 +
  tests/spec/arb_shader_image_load_store/max-images.c | 1 +
  tests/spec/arb_shader_image_load_store/max-size.c   | 1 +
  tests/spec/arb_shader_image_load_store/minmax.c | 1 +
  tests/spec/arb_shader_image_load_store/qualifiers.c | 1 +
  tests/spec/arb_shader_image_load_store/restrict.c   | 1 +
  tests/spec/arb_shader_image_load_store/semantics.c  | 1 +
  tests/spec/arb_shader_image_load_store/shader-mem-barrier.c | 1 +
  tests/spec/arb_shader_image_load_store/state.c  | 1 +
  tests/spec/arb_shader_image_load_store/unused.c | 1 +
  19 files changed, 19 insertions(+)

diff --git a/tests/spec/arb_shader_image_load_store/atomicity.c 
b/tests/spec/arb_shader_image_load_store/atomicity.c
index fe6bdb3e1..f53dddaa2 100644
--- a/tests/spec/arb_shader_image_load_store/atomicity.c
+++ b/tests/spec/arb_shader_image_load_store/atomicity.c
@@ -65,6 +65,7 @@ config.supports_gl_core_version = 32;
  config.window_width = W;
  config.window_height = H;
  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_shader_image_load_store/bitcast.c b/tests/spec/arb_shader_image_load_store/bitcast.c

index 9180e79c0..5f3e2c124 100644
--- a/tests/spec/arb_shader_image_load_store/bitcast.c
+++ b/tests/spec/arb_shader_image_load_store/bitcast.c
@@ -46,6 +46,7 @@ config.supports_gl_core_version = 32;
  config.window_width = W;
  config.window_height = H;
  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_shader_image_load_store/coherency.c b/tests/spec/arb_shader_image_load_store/coherency.c

index d1ecbe8b4..a3ef5fe1a 100644
--- a/tests/spec/arb_shader_image_load_store/coherency.c
+++ b/tests/spec/arb_shader_image_load_store/coherency.c
@@ -72,6 +72,7 @@ config.supports_gl_core_version = 32;
  config.window_width = L;
  config.window_height = L;
  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_shader_image_load_store/dead-fragments.c b/tests/spec/arb_shader_image_load_store/dead-fragments.c

index 70c8f3f7a..c06aaa002 100644
--- a/tests/spec/arb_shader_image_load_store/dead-fragments.c
+++ b/tests/spec/arb_shader_image_load_store/dead-fragments.c
@@ -53,6 +53,7 @@ config.supports_gl_core_version = 32;
  config.window_width = W;
  config.window_height = H;
  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_shader_image_load_store/early-z.c b/tests/spec/arb_shader_image_load_store/early-z.c

index 913a220df..c55d81a87 100644
--- a/tests/spec/arb_shader_image_load_store/early-z.c
+++ b/tests/spec/arb_shader_image_load_store/early-z.c
@@ -63,6 +63,7 @@ config.supports_gl_core_version = 32;
  config.window_width = W;
  config.window_height = H;
  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_shader_image_load_store/host-mem-barrier.c b/tests/spec/arb_shader_image_load_store/host-mem-barrier.c

index 12b966a13..cceaf28ca 100644
--- a/tests/spec/arb_shader_image_load_store/host-mem-barrier.c
+++ b/tests/spec/arb_shader_image_load_store/host-mem-barrier.c
@@ -60,6 +60,7 @@ config.supports_gl_core_version = 32;
  config.window_width = L;
  config.window_height = L;
  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+config.khr_no_error_support = PIGLIT_NO_ERRORS;
  
  PIGLIT_GL_TEST_CONFIG_END
  
diff --git a/tests/spec/arb_shader_image_load_store/indexing.c b/tests/spec/arb_shader_image_load_store/indexing.c

index bf4a56976..acef2db17 100644
--- a/tests/spec/arb_shader_image_load_store/indexing.c
+++