[Piglit] [PATCH] ext_framebuffer_blit: Verify framebuffer bindings after calling glGenerateMipmap

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

Mesa's meta path for glGenerateMipmap had a problem that it assumed the
two bindings were the same.  As a result, one of them was incorrect
after returning from _mesa_meta_GenerateMipmap.

NOTE: This currently fails on all Mesa drivers that use
_mesa_meta_GenerateMipmap.

Signed-off-by: Ian Romanick 
---
 tests/all.py   |   3 +-
 .../spec/arb_framebuffer_object/CMakeLists.gl.txt  |   1 +
 .../GenerateMipmap-versus-READ_FRAMEBUFFER.c   | 129 +
 3 files changed, 132 insertions(+), 1 deletion(-)
 create mode 100644 
tests/spec/arb_framebuffer_object/GenerateMipmap-versus-READ_FRAMEBUFFER.c

diff --git a/tests/all.py b/tests/all.py
index f520920..431ea30 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2003,7 +2003,7 @@ with profile.group_manager(
 g(['fbo-generatemipmap-1d'])
 g(['fbo-generatemipmap-1d', 'RGB9_E5'])
 g(['fbo-generatemipmap-3d'])
-g(['fbo-generatemipmap-3d', 'RGB9_E5'])
+
 for format in ('rgba', 'depth', 'stencil'):
 for test_mode in ('draw', 'read'):
 g(['framebuffer-blit-levels', test_mode, format],
@@ -2705,6 +2705,7 @@ with profile.group_manager(
 g(['fbo-srgb-blit'])
 g(['fbo-sys-blit'], run_concurrent=False)
 g(['fbo-sys-sub-blit'], run_concurrent=False)
+g(['fbo-generatemipmap-versus-READ_FRAMEBUFFER'])
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_framebuffer_object/CMakeLists.gl.txt 
b/tests/spec/arb_framebuffer_object/CMakeLists.gl.txt
index 06d5978..e475e9e 100644
--- a/tests/spec/arb_framebuffer_object/CMakeLists.gl.txt
+++ b/tests/spec/arb_framebuffer_object/CMakeLists.gl.txt
@@ -18,5 +18,6 @@ 
piglit_add_executable(same-attachment-glFramebufferRenderbuffer-GL_DEPTH_STENCIL
 piglit_add_executable (fbo-blit-scaled-linear blit-scaled-linear.cpp)
 piglit_add_executable (fbo-attachments-blit-scaled-linear 
attachments-blit-scaled-linear.cpp)
 piglit_add_executable(fbo-drawbuffers-none fbo-drawbuffers-none.c)
+piglit_add_executable(fbo-generatemipmap-versus-READ_FRAMEBUFFER 
GenerateMipmap-versus-READ_FRAMEBUFFER.c)
 
 # vim: ft=cmake:
diff --git 
a/tests/spec/arb_framebuffer_object/GenerateMipmap-versus-READ_FRAMEBUFFER.c 
b/tests/spec/arb_framebuffer_object/GenerateMipmap-versus-READ_FRAMEBUFFER.c
new file mode 100644
index 000..c46f323
--- /dev/null
+++ b/tests/spec/arb_framebuffer_object/GenerateMipmap-versus-READ_FRAMEBUFFER.c
@@ -0,0 +1,129 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/** \file GenerateMipmap-versus-READ_FRAMEBUFFER.c
+ * Verify that GL_READ_FRAMEBUFFER_BINDING and GL_DRAW_FRAMEBUFFER_BINDING are
+ * correct after calling glGenerateMipmap.
+ *
+ * Mesa's meta path for glGenerateMipmap had a problem that it assumed the two
+ * bindings were the same.  As a result, one of them was incorrect after
+ * returning from _mesa_meta_GenerateMipmap.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const GLuint texels[16] = {
+   0, 0, 0, 0,
+   0, 0, 0, 0,
+   0, 0, 0, 0,
+   0, 0, 0, 0
+};
+
+void
+piglit_init(int argc, char **argv)
+{
+   GLuint fbos[2];
+   GLuint texture;
+   GLuint draw_binding;
+   GLuint read_binding;
+   bool pass = true;
+
+   if (piglit_get_gl_version() >= 30 ||
+   piglit_is_extension_supported("GL_ARB_framebuffer_object")) {
+   glGenFramebuffers(2, fbos);
+   glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbos[0]);
+   glBindFramebuffer(GL_READ_FRAMEBUFFER, fbos[1]);
+   } else if (piglit_is_extension_supported("GL_EXT_framebuffer_object") &&
+  

Re: [Piglit] [PATCH 1/6] shader_runner: Check feature support before querying GL_MAX_*.

2015-11-13 Thread Matt Turner
On Wed, Nov 11, 2015 at 4:47 PM, Kenneth Graunke  wrote:
> On Tuesday, November 10, 2015 10:46:18 PM Matt Turner wrote:
>> Otherwise, these will generate an error (to be noticed sometime later
>> when glGetError() is called), often resulting in a test failure.
>> ---
>>  tests/shaders/shader_runner.c | 18 --
>>  1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
>> index 32ac7bd..4597b46 100644
>> --- a/tests/shaders/shader_runner.c
>> +++ b/tests/shaders/shader_runner.c
>> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
>>   if (piglit_get_gl_version() >= 32)
>>   glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
>> _max_vertex_output_components);
>> - glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>> -   _max_fragment_uniform_components);
>> - glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>> -   _max_vertex_uniform_components);
>> - glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
>> -   _max_varying_components);
>> + if (piglit_get_gl_version() >= 20 ||
>> + piglit_is_extension_supported("GL_ARB_fragment_shader"))
>> + glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>> +   _max_fragment_uniform_components);
>> + if (piglit_get_gl_version() >= 20 ||
>> + piglit_is_extension_supported("GL_ARB_vertex_shader"))
>> + glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>> +   _max_vertex_uniform_components);
>
> Above this, we call piglit_require_GLSL()...it seems like that
> ought to be causing us to skip in this case.  Maybe we don't
> return early enough?

We talked about this on IRC, but for the mailing list:

The problem is that piglit_require_GLSL() says "all okay" if you have
GL 2.0 or (GL_ARB_shader_objects and GL_ARB_shading_language_100), and
R200 exposes both of those extensions, even though it doesn't expose
the actual extensions you need for shading... ARB_fragment_shader or
ARB_vertex_shader.

And moreover, since we support fragment program and vertex program
shader_tests, we don't actually want to be requiring GLSL anyway.

I'll work on sorting that out, but I think t his patch is good as is
(with the GL_ARB_geometry_shader4 change).
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] ext_framebuffer_blit: Verify framebuffer bindings after calling glGenerateMipmap

2015-11-13 Thread Ilia Mirkin
On Fri, Nov 13, 2015 at 2:54 PM, Ian Romanick  wrote:
> From: Ian Romanick 
>
> Mesa's meta path for glGenerateMipmap had a problem that it assumed the
> two bindings were the same.  As a result, one of them was incorrect
> after returning from _mesa_meta_GenerateMipmap.
>
> NOTE: This currently fails on all Mesa drivers that use
> _mesa_meta_GenerateMipmap.
>
> Signed-off-by: Ian Romanick 
> ---
>  tests/all.py   |   3 +-
>  .../spec/arb_framebuffer_object/CMakeLists.gl.txt  |   1 +
>  .../GenerateMipmap-versus-READ_FRAMEBUFFER.c   | 129 
> +
>  3 files changed, 132 insertions(+), 1 deletion(-)
>  create mode 100644 
> tests/spec/arb_framebuffer_object/GenerateMipmap-versus-READ_FRAMEBUFFER.c
>
> diff --git a/tests/all.py b/tests/all.py
> index f520920..431ea30 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2003,7 +2003,7 @@ with profile.group_manager(
>  g(['fbo-generatemipmap-1d'])
>  g(['fbo-generatemipmap-1d', 'RGB9_E5'])
>  g(['fbo-generatemipmap-3d'])
> -g(['fbo-generatemipmap-3d', 'RGB9_E5'])
> +

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


Re: [Piglit] [PATCH v1] Porting the OpenGL shading language from Glean to Piglit.

2015-11-13 Thread Matt Turner
On Tue, Oct 20, 2015 at 12:16 AM, Juliet Fru  wrote:
> Hi Brian,
>
> I have been working on the "gl_Position not written check"
> (tests/spec/glsl-1.10/linker/) test from glean to shader_test files. Here is
> what I have so far.  I'm sure there may be some errors since this test does
> not have the fragment shader aspects. I am not very familiar with
> shader_test files. I will appreciate if you could correct this sample test
> so I could submit the patch and move on to the others.

Hi Juliet,

I was going to port the fragment/vertex program (tfragprog1.cpp,
tvertprog1.cpp) tests in glean to regular shader_test files, but I
don't want to collide with anything you're doing. I haven't seen
anything from you in more than three weeks, so I think your project
might be complete? Can you confirm your status?

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


Re: [Piglit] [PATCH] ext_framebuffer_blit: Verify framebuffer bindings after calling glGenerateMipmap

2015-11-13 Thread Ian Romanick
On 11/13/2015 12:04 PM, Ilia Mirkin wrote:
> On Fri, Nov 13, 2015 at 2:54 PM, Ian Romanick  wrote:
>> From: Ian Romanick 
>>
>> Mesa's meta path for glGenerateMipmap had a problem that it assumed the
>> two bindings were the same.  As a result, one of them was incorrect
>> after returning from _mesa_meta_GenerateMipmap.
>>
>> NOTE: This currently fails on all Mesa drivers that use
>> _mesa_meta_GenerateMipmap.
>>
>> Signed-off-by: Ian Romanick 
>> ---
>>  tests/all.py   |   3 +-
>>  .../spec/arb_framebuffer_object/CMakeLists.gl.txt  |   1 +
>>  .../GenerateMipmap-versus-READ_FRAMEBUFFER.c   | 129 
>> +
>>  3 files changed, 132 insertions(+), 1 deletion(-)
>>  create mode 100644 
>> tests/spec/arb_framebuffer_object/GenerateMipmap-versus-READ_FRAMEBUFFER.c
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index f520920..431ea30 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -2003,7 +2003,7 @@ with profile.group_manager(
>>  g(['fbo-generatemipmap-1d'])
>>  g(['fbo-generatemipmap-1d', 'RGB9_E5'])
>>  g(['fbo-generatemipmap-3d'])
>> -g(['fbo-generatemipmap-3d', 'RGB9_E5'])
>> +
> 
> oops?

Oops in deed!  Fixed locally.  Thanks.

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