Re: [Piglit] [PATCH v2] tbo: test a max-sized buffer

2015-09-15 Thread Ilia Mirkin
BTW i made a version that aligns data (and offset) to 16, but that
didn't fix the crashes on intel, so I'm hesitant to send it out. I
think intel has a deeper issue, the memcpy just goes to a bad place in
the first place.

On Tue, Sep 15, 2015 at 7:29 PM, Ilia Mirkin  wrote:
> ---
>
> Turns out MAX_TEXTURE_BUFFER_SIZE is in *texels*, not bytes. Updated
> to take that into account. Note that this causes an error in
> avx_memcpy on i965 (hsw), most likely due to alignment, but I haven't
> investigated...
>
> Also, this version avoids the question of what to do with 2G+ buffers.
>
>  tests/all.py   |   1 +
>  .../arb_texture_buffer_object/CMakeLists.gl.txt|   1 +
>  tests/spec/arb_texture_buffer_object/max-size.c| 106 
> +
>  3 files changed, 108 insertions(+)
>  create mode 100644 tests/spec/arb_texture_buffer_object/max-size.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 4fbe75b..761ec5c 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2372,6 +2372,7 @@ with profile.group_manager(
>  g(['arb_texture_buffer_object-get'], 'get')
>  g(['arb_texture_buffer_object-fetch-outside-bounds'],
>'fetch-outside-bounds')
> +g(['arb_texture_buffer_object-max-size'], 'max-size')
>  g(['arb_texture_buffer_object-minmax'], 'minmax')
>  g(['arb_texture_buffer_object-negative-bad-bo'], 'negative-bad-bo')
>  g(['arb_texture_buffer_object-negative-bad-format'], 
> 'negative-bad-format')
> diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt 
> b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
> index 5019e52..2971582 100644
> --- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
> +++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
> @@ -14,6 +14,7 @@ piglit_add_executable (arb_texture_buffer_object-data-sync 
> data-sync.c)
>  piglit_add_executable (arb_texture_buffer_object-dlist dlist.c)
>  piglit_add_executable (arb_texture_buffer_object-formats formats.c)
>  piglit_add_executable (arb_texture_buffer_object-get get.c)
> +piglit_add_executable (arb_texture_buffer_object-max-size max-size.c)
>  piglit_add_executable (arb_texture_buffer_object-minmax minmax.c)
>  piglit_add_executable (arb_texture_buffer_object-negative-bad-bo 
> negative-bad-bo.c)
>  piglit_add_executable (arb_texture_buffer_object-negative-bad-format 
> negative-bad-format.c)
> diff --git a/tests/spec/arb_texture_buffer_object/max-size.c 
> b/tests/spec/arb_texture_buffer_object/max-size.c
> new file mode 100644
> index 000..3cc940b
> --- /dev/null
> +++ b/tests/spec/arb_texture_buffer_object/max-size.c
> @@ -0,0 +1,106 @@
> +/* Copyright © 2015 Ilia Mirkin
> + *
> + * 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 max-size.c
> + *
> + * Tests that we can sample a maximally-sized texture buffer.
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +   static const float green[4] = {0, 1, 0, 0};
> +   bool pass;
> +
> +   glViewport(0, 0, piglit_width, piglit_height);
> +   glClearColor(0.2, 0.2, 0.2, 0.2);
> +   glClear(GL_COLOR_BUFFER_BIT);
> +
> +   piglit_draw_rect(-1, -1, 2, 2);
> +
> +   pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, 
> green);
> +
> +   piglit_present_results();
> +
> +   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> +}
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +   static const char *vs_source =
> +   "#version 140\n"
> +   "in vec4 piglit_vertex;\n"
> +   "void main()\n"
> +   "{\n"
> +   "   gl_Position = piglit_vertex;\n"
> +   "}\n";
> +
> +   static const char *fs_source =
> +   "#version 140\n"
> +   "uniform samplerBuffer s;\n"
> +   "unifo

[Piglit] [PATCH v2] tbo: test a max-sized buffer

2015-09-15 Thread Ilia Mirkin
---

Turns out MAX_TEXTURE_BUFFER_SIZE is in *texels*, not bytes. Updated
to take that into account. Note that this causes an error in
avx_memcpy on i965 (hsw), most likely due to alignment, but I haven't
investigated...

Also, this version avoids the question of what to do with 2G+ buffers.

 tests/all.py   |   1 +
 .../arb_texture_buffer_object/CMakeLists.gl.txt|   1 +
 tests/spec/arb_texture_buffer_object/max-size.c| 106 +
 3 files changed, 108 insertions(+)
 create mode 100644 tests/spec/arb_texture_buffer_object/max-size.c

diff --git a/tests/all.py b/tests/all.py
index 4fbe75b..761ec5c 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2372,6 +2372,7 @@ with profile.group_manager(
 g(['arb_texture_buffer_object-get'], 'get')
 g(['arb_texture_buffer_object-fetch-outside-bounds'],
   'fetch-outside-bounds')
+g(['arb_texture_buffer_object-max-size'], 'max-size')
 g(['arb_texture_buffer_object-minmax'], 'minmax')
 g(['arb_texture_buffer_object-negative-bad-bo'], 'negative-bad-bo')
 g(['arb_texture_buffer_object-negative-bad-format'], 'negative-bad-format')
diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt 
b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
index 5019e52..2971582 100644
--- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
@@ -14,6 +14,7 @@ piglit_add_executable (arb_texture_buffer_object-data-sync 
data-sync.c)
 piglit_add_executable (arb_texture_buffer_object-dlist dlist.c)
 piglit_add_executable (arb_texture_buffer_object-formats formats.c)
 piglit_add_executable (arb_texture_buffer_object-get get.c)
+piglit_add_executable (arb_texture_buffer_object-max-size max-size.c)
 piglit_add_executable (arb_texture_buffer_object-minmax minmax.c)
 piglit_add_executable (arb_texture_buffer_object-negative-bad-bo 
negative-bad-bo.c)
 piglit_add_executable (arb_texture_buffer_object-negative-bad-format 
negative-bad-format.c)
diff --git a/tests/spec/arb_texture_buffer_object/max-size.c 
b/tests/spec/arb_texture_buffer_object/max-size.c
new file mode 100644
index 000..3cc940b
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/max-size.c
@@ -0,0 +1,106 @@
+/* Copyright © 2015 Ilia Mirkin
+ *
+ * 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 max-size.c
+ *
+ * Tests that we can sample a maximally-sized texture buffer.
+ */
+
+#include "piglit-util-gl.h"
+
+enum piglit_result
+piglit_display(void)
+{
+   static const float green[4] = {0, 1, 0, 0};
+   bool pass;
+
+   glViewport(0, 0, piglit_width, piglit_height);
+   glClearColor(0.2, 0.2, 0.2, 0.2);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   piglit_draw_rect(-1, -1, 2, 2);
+
+   pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, green);
+
+   piglit_present_results();
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+   static const char *vs_source =
+   "#version 140\n"
+   "in vec4 piglit_vertex;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_Position = piglit_vertex;\n"
+   "}\n";
+
+   static const char *fs_source =
+   "#version 140\n"
+   "uniform samplerBuffer s;\n"
+   "uniform int offset;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_FragColor = texelFetch(s, offset);\n"
+   "}\n";
+
+   GLuint tex, tbo;
+   static const uint8_t data[4] = {0x00, 0xff, 0x00, 0x00};
+   GLuint prog;
+   GLint max;
+
+   prog = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(prog);
+
+   glGenBuffers(1, &tbo);
+   glBindBuffer(GL_TEXTURE_BUFFER, tbo);
+
+   glGenTextures(1, &tex);
+   g

Re: [Piglit] [PATCH] tbo: test a max-sized buffer

2015-09-15 Thread Ilia Mirkin
Actually this test is wrong. I'm going to send a v2 shortly. My
updated test also uncovers a bug in i965 where it makes invalid
assumptions about pointer alignment.

On Tue, Sep 15, 2015 at 6:27 PM, Glenn Kennard  wrote:
> On Tue, 15 Sep 2015 22:56:58 +0200, Ilia Mirkin 
> wrote:
>
>> ---
>>  tests/all.py   |  1 +
>>  .../arb_texture_buffer_object/CMakeLists.gl.txt|  1 +
>>  tests/spec/arb_texture_buffer_object/max-size.c| 99
>> ++
>>  3 files changed, 101 insertions(+)
>>  create mode 100644 tests/spec/arb_texture_buffer_object/max-size.c
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index 4fbe75b..761ec5c 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -2372,6 +2372,7 @@ with profile.group_manager(
>>  g(['arb_texture_buffer_object-get'], 'get')
>>  g(['arb_texture_buffer_object-fetch-outside-bounds'],
>>'fetch-outside-bounds')
>> +g(['arb_texture_buffer_object-max-size'], 'max-size')
>>  g(['arb_texture_buffer_object-minmax'], 'minmax')
>>  g(['arb_texture_buffer_object-negative-bad-bo'], 'negative-bad-bo')
>>  g(['arb_texture_buffer_object-negative-bad-format'],
>> 'negative-bad-format')
>> diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
>> b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
>> index 5019e52..2971582 100644
>> --- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
>> +++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
>> @@ -14,6 +14,7 @@ piglit_add_executable
>> (arb_texture_buffer_object-data-sync data-sync.c)
>>  piglit_add_executable (arb_texture_buffer_object-dlist dlist.c)
>>  piglit_add_executable (arb_texture_buffer_object-formats formats.c)
>>  piglit_add_executable (arb_texture_buffer_object-get get.c)
>> +piglit_add_executable (arb_texture_buffer_object-max-size max-size.c)
>>  piglit_add_executable (arb_texture_buffer_object-minmax minmax.c)
>>  piglit_add_executable (arb_texture_buffer_object-negative-bad-bo
>> negative-bad-bo.c)
>>  piglit_add_executable (arb_texture_buffer_object-negative-bad-format
>> negative-bad-format.c)
>> diff --git a/tests/spec/arb_texture_buffer_object/max-size.c
>> b/tests/spec/arb_texture_buffer_object/max-size.c
>> new file mode 100644
>> index 000..cbbbeaf
>> --- /dev/null
>> +++ b/tests/spec/arb_texture_buffer_object/max-size.c
>> @@ -0,0 +1,99 @@
>> +/* Copyright © 2015 Ilia Mirkin
>> + *
>> + * 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 max-size.c
>> + *
>> + * Tests that we can sample a maximally-sized texture buffer.
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +
>> +enum piglit_result
>> +piglit_display(void)
>> +{
>> +   static const float green[4] = {0, 1, 0, 0};
>> +   bool pass;
>> +
>> +   glViewport(0, 0, piglit_width, piglit_height);
>> +   glClearColor(0.2, 0.2, 0.2, 0.2);
>> +   glClear(GL_COLOR_BUFFER_BIT);
>> +
>> +   piglit_draw_rect(-1, -1, 2, 2);
>> +
>> +   pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
>> green);
>> +
>> +   piglit_present_results();
>> +
>> +   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
>> +}
>> +
>> +void
>> +piglit_init(int argc, char **argv)
>> +{
>> +   static const char *vs_source =
>> +   "#version 140\n"
>> +   "in vec4 piglit_vertex;\n"
>> +   "void main()\n"
>> +   "{\n"
>> +   "   gl_Position = piglit_vertex;\n"
>> +   "}\n";
>> +
>> +   static const char *fs_source =
>> +   "#version 140\n"
>> +   "uniform samplerBuffer s;\n"
>> +   "uniform int offset;\n"
>> +   "void main()\n"
>> +   "{\n"
>> +   "   gl_FragColor = texelFetch(s, offset);\n"
>> +   "

Re: [Piglit] [PATCH] tbo: test a max-sized buffer

2015-09-15 Thread Glenn Kennard
On Tue, 15 Sep 2015 22:56:58 +0200, Ilia Mirkin   
wrote:



---
 tests/all.py   |  1 +
 .../arb_texture_buffer_object/CMakeLists.gl.txt|  1 +
 tests/spec/arb_texture_buffer_object/max-size.c| 99  
++

 3 files changed, 101 insertions(+)
 create mode 100644 tests/spec/arb_texture_buffer_object/max-size.c

diff --git a/tests/all.py b/tests/all.py
index 4fbe75b..761ec5c 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2372,6 +2372,7 @@ with profile.group_manager(
 g(['arb_texture_buffer_object-get'], 'get')
 g(['arb_texture_buffer_object-fetch-outside-bounds'],
   'fetch-outside-bounds')
+g(['arb_texture_buffer_object-max-size'], 'max-size')
 g(['arb_texture_buffer_object-minmax'], 'minmax')
 g(['arb_texture_buffer_object-negative-bad-bo'], 'negative-bad-bo')
 g(['arb_texture_buffer_object-negative-bad-format'],  
'negative-bad-format')
diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt  
b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt

index 5019e52..2971582 100644
--- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
@@ -14,6 +14,7 @@ piglit_add_executable  
(arb_texture_buffer_object-data-sync data-sync.c)

 piglit_add_executable (arb_texture_buffer_object-dlist dlist.c)
 piglit_add_executable (arb_texture_buffer_object-formats formats.c)
 piglit_add_executable (arb_texture_buffer_object-get get.c)
+piglit_add_executable (arb_texture_buffer_object-max-size max-size.c)
 piglit_add_executable (arb_texture_buffer_object-minmax minmax.c)
 piglit_add_executable (arb_texture_buffer_object-negative-bad-bo  
negative-bad-bo.c)
 piglit_add_executable (arb_texture_buffer_object-negative-bad-format  
negative-bad-format.c)
diff --git a/tests/spec/arb_texture_buffer_object/max-size.c  
b/tests/spec/arb_texture_buffer_object/max-size.c

new file mode 100644
index 000..cbbbeaf
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/max-size.c
@@ -0,0 +1,99 @@
+/* Copyright © 2015 Ilia Mirkin
+ *
+ * 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 max-size.c
+ *
+ * Tests that we can sample a maximally-sized texture buffer.
+ */
+
+#include "piglit-util-gl.h"
+
+enum piglit_result
+piglit_display(void)
+{
+   static const float green[4] = {0, 1, 0, 0};
+   bool pass;
+
+   glViewport(0, 0, piglit_width, piglit_height);
+   glClearColor(0.2, 0.2, 0.2, 0.2);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   piglit_draw_rect(-1, -1, 2, 2);
+
+	pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,  
green);

+
+   piglit_present_results();
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+   static const char *vs_source =
+   "#version 140\n"
+   "in vec4 piglit_vertex;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_Position = piglit_vertex;\n"
+   "}\n";
+
+   static const char *fs_source =
+   "#version 140\n"
+   "uniform samplerBuffer s;\n"
+   "uniform int offset;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_FragColor = texelFetch(s, offset);\n"
+   "}\n";
+
+   GLuint tex, tbo;
+   static const uint8_t data[4] = {0x0, 0xff, 0x0, 0x0};
+   GLuint prog;
+   GLint max, offset;
+
+   prog = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(prog);
+
+   glGenBuffers(1, &tbo);
+   glBindBuffer(GL_TEXTURE_BUFFER, tbo);
+
+   glGenTextures(1, &tex);
+   glBindTexture(GL_TEXTURE_BUFFER, tex);
+
+   glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, &max);
+   max -= max % sizeof(data);
+
+   glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, tbo);
+   glB

Re: [Piglit] [PATCH v2 4/4] Add API tests for KHR_texture_compression_astc_ldr

2015-09-15 Thread Chad Versace
On Mon 14 Sep 2015, Nanley Chery wrote:
> On Tue, Sep 8, 2015 at 11:45 AM, Chad Versace 
> wrote:
> 
> > On Fri 28 Aug 2015, Nanley Chery wrote:
> > > From: Nanley Chery 
> > >
> > > These tests check that the GL error returned by valid and invalid API
> > calls
> > > are as defined by the spec.
> > >
> > > Signed-off-by: Nanley Chery 
> > > ---
> > >  .../khr_texture_compression_astc/CMakeLists.gl.txt |   1 +
> > >  .../CMakeLists.gles2.txt   |   1 +
> > >  .../khr_compressed_astc-basic.c| 366
> > +
> > >  3 files changed, 368 insertions(+)
> > >  create mode 100644
> > tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c


> > > +static const GLenum good_targets[] = {
> >
> > There are additional good targets: 3D and and CUBE_MAP. Please rename
> > this variable to indicate that these are "good targets" for
> > glCompressedTex*3D().
> >
> I'm not sure what you mean by additional good targets. I've renamed the
> variable to good_compressed_tex_3d_targets.
> 
> > > +   GL_TEXTURE_2D_ARRAY,
> > > +   GL_TEXTURE_CUBE_MAP_ARRAY_EXT,
> > > +   GL_TEXTURE_3D,
> > > +};

I typo'd. I meant *2D* (not 3D) and CUBE_MAP are additional good targets
for ASTC. Those targets are good for glCompressedTex*2D(). In other
words, I meanth that this array isn't a list of *all* good ASTC targets,
because it excludes 2D and CUBE_MAP.

> > > + /* Test CompressedTexImage3D */
> > > + glCompressedTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY_EXT, 0,
> > > + formats[fi].fmt, 4, 3, 6, 0, 6*formats[fi].bb,
> > fake_tex_data);
> > > + REQUIRE_ERROR(GL_INVALID_VALUE);
> >
> > If HDR is unsupported, I think glCompressedTexImage3D is allowed to
> > emit GL_INVALID_OPERATION here. So, I think glCompressedTexImage3D()
> > should be tested on non-square dimensions only if HDR is supported.
> >
> Agreed. I just made a patch for mesa to support this behavior. I'm
> thinking it'd be better to check that for GL_INVALID_OPERATION if HDR is
> not supported, and GL_INVALID_VALUE otherwise.

Sounds good to me.

...

Also, the reply-level was corrupted in your message. Maybe your email
program is configured incorrectly? Perhaps its a word-wrap problem? The
bug was that the first line of each of your responses was at
reply-level=1 instead of reply-level=0.  That rendered your single-line
responses, nearly invisible, since the single line looked like it
belonged to my message instead of yours.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] tbo: test a max-sized buffer

2015-09-15 Thread Ilia Mirkin
---
 tests/all.py   |  1 +
 .../arb_texture_buffer_object/CMakeLists.gl.txt|  1 +
 tests/spec/arb_texture_buffer_object/max-size.c| 99 ++
 3 files changed, 101 insertions(+)
 create mode 100644 tests/spec/arb_texture_buffer_object/max-size.c

diff --git a/tests/all.py b/tests/all.py
index 4fbe75b..761ec5c 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2372,6 +2372,7 @@ with profile.group_manager(
 g(['arb_texture_buffer_object-get'], 'get')
 g(['arb_texture_buffer_object-fetch-outside-bounds'],
   'fetch-outside-bounds')
+g(['arb_texture_buffer_object-max-size'], 'max-size')
 g(['arb_texture_buffer_object-minmax'], 'minmax')
 g(['arb_texture_buffer_object-negative-bad-bo'], 'negative-bad-bo')
 g(['arb_texture_buffer_object-negative-bad-format'], 'negative-bad-format')
diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt 
b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
index 5019e52..2971582 100644
--- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
@@ -14,6 +14,7 @@ piglit_add_executable (arb_texture_buffer_object-data-sync 
data-sync.c)
 piglit_add_executable (arb_texture_buffer_object-dlist dlist.c)
 piglit_add_executable (arb_texture_buffer_object-formats formats.c)
 piglit_add_executable (arb_texture_buffer_object-get get.c)
+piglit_add_executable (arb_texture_buffer_object-max-size max-size.c)
 piglit_add_executable (arb_texture_buffer_object-minmax minmax.c)
 piglit_add_executable (arb_texture_buffer_object-negative-bad-bo 
negative-bad-bo.c)
 piglit_add_executable (arb_texture_buffer_object-negative-bad-format 
negative-bad-format.c)
diff --git a/tests/spec/arb_texture_buffer_object/max-size.c 
b/tests/spec/arb_texture_buffer_object/max-size.c
new file mode 100644
index 000..cbbbeaf
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/max-size.c
@@ -0,0 +1,99 @@
+/* Copyright © 2015 Ilia Mirkin
+ *
+ * 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 max-size.c
+ *
+ * Tests that we can sample a maximally-sized texture buffer.
+ */
+
+#include "piglit-util-gl.h"
+
+enum piglit_result
+piglit_display(void)
+{
+   static const float green[4] = {0, 1, 0, 0};
+   bool pass;
+
+   glViewport(0, 0, piglit_width, piglit_height);
+   glClearColor(0.2, 0.2, 0.2, 0.2);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   piglit_draw_rect(-1, -1, 2, 2);
+
+   pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, green);
+
+   piglit_present_results();
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+   static const char *vs_source =
+   "#version 140\n"
+   "in vec4 piglit_vertex;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_Position = piglit_vertex;\n"
+   "}\n";
+
+   static const char *fs_source =
+   "#version 140\n"
+   "uniform samplerBuffer s;\n"
+   "uniform int offset;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_FragColor = texelFetch(s, offset);\n"
+   "}\n";
+
+   GLuint tex, tbo;
+   static const uint8_t data[4] = {0x0, 0xff, 0x0, 0x0};
+   GLuint prog;
+   GLint max, offset;
+
+   prog = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(prog);
+
+   glGenBuffers(1, &tbo);
+   glBindBuffer(GL_TEXTURE_BUFFER, tbo);
+
+   glGenTextures(1, &tex);
+   glBindTexture(GL_TEXTURE_BUFFER, tex);
+
+   glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, &max);
+   max -= max % sizeof(data);
+
+   glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, tbo);
+   glBufferData(GL_TEXTURE_BUFFER, max, NULL, GL_STATIC_READ);
+   glBufferSubData(GL_TEXT

Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: Test std430 packing of vec2/vec3 array data

2015-09-15 Thread Kristian Høgsberg
On Tue, Sep 15, 2015 at 11:48 AM, Jordan Justen
 wrote:
> Signed-off-by: Jordan Justen 
> Cc: Samuel Iglesias Gonsálvez 

Reviewed-by: Kristian Høgsberg 

> ---
>  Passes on NVidia's 340.76 driver & Igalia's SSBO branch for i965
>
>  .../layout-std430-write-shader.c   | 18 
> +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c 
> b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
> index c25e921..f821f69 100644
> --- a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
> +++ b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
> @@ -46,7 +46,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>
>  PIGLIT_GL_TEST_CONFIG_END
>
> -#define SSBO_SIZE 48
> +#define SSBO_SIZE 64
>
>  static const char vs_pass_thru_text[] =
> "#version 130\n"
> @@ -65,6 +65,8 @@ static const char vs_pass_thru_text[] =
> "   float f;\n"
> "   A s;\n"
> "   mat3x4 m;\n"
> +   "   vec2 v2a[3];\n"
> +   "   vec3 v3a[2];\n"
> "   float unsized_array[];\n"
> "};\n"
> "in vec4 piglit_vertex;\n"
> @@ -78,6 +80,10 @@ static const char vs_pass_thru_text[] =
> "   s.sb[0].b1[0] = 18.0;\n"
> "   s.sb[0].b1[1] = 19.0;\n"
> "   m[1] = vec4(25.0, 26.0, 27.0, 28.0);\n"
> +   "   v2a[0].yx = vec2(34.0, 33.0);\n"
> +   "   v2a[1].y = 36.0;\n"
> +   "   v3a[0].xz = vec2(39.0, 41.0);\n"
> +   "   v3a[1].y = 43.0;\n"
> "   int index = int(v.x); // index should be zero\n"
> "   unsized_array[index + gl_VertexID] = 
> unsized_array.length();\n"
> "}\n";
> @@ -99,6 +105,8 @@ static const char fs_source[] =
> "   float f;\n"
> "   A s;\n"
> "   mat3x4 m;\n"
> +   "   vec2 v2a[3];\n"
> +   "   vec3 v3a[2];\n"
> "   float unsized_array[];\n"
> "};\n"
> "out vec4 color;\n"
> @@ -112,6 +120,10 @@ static const char fs_source[] =
> "   s.sb[1].b1[2] = 20.0;\n"
> "   m[0] = vec4(21.0, 22.0, 23.0, 24.0);\n"
> "   m[2] = vec4(29.0, 30.0, 31.0, 32.0);\n"
> +   "   v2a[1].x = 35.0;\n"
> +   "   v2a[2].xy = vec2(37.0, 38.0);\n"
> +   "   v3a[0].y = 40.0;\n"
> +   "   v3a[1].xz = vec2(42.0, 44.0);\n"
> "   int index = int(v.z + gl_FragCoord.x);\n"
> "   unsized_array[index] = unsized_array.length() * 2.0;\n"
> "}\n";
> @@ -129,6 +141,10 @@ float expected[SSBO_SIZE] = { 0.0,  1.0,  2.0,  3.0, // 
> vec4 v
>  21.0, 22.0, 23.0, 24.0, // mat3x4 m[0]
>  25.0, 26.0, 27.0, 28.0, // mat3x4 m[1]
>  29.0, 30.0, 31.0, 32.0, // mat3x4 m[2]
> +33.0, 34.0, 35.0, 36.0, // vec2 v2a[3]
> +37.0, 38.0,  0.0,  0.0, //
> +39.0, 40.0, 41.0,  0.0, // vec3 v3a[2]
> +42.0, 43.0, 44.0,  0.0, //
>   4.0,  4.0,  8.0,  8.0  // float unsized_array[0]
>  };
>
> --
> 2.5.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_shader_storage_buffer_object: Test std430 packing of vec2/vec3 array data

2015-09-15 Thread Jordan Justen
Signed-off-by: Jordan Justen 
Cc: Samuel Iglesias Gonsálvez 
---
 Passes on NVidia's 340.76 driver & Igalia's SSBO branch for i965

 .../layout-std430-write-shader.c   | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c 
b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
index c25e921..f821f69 100644
--- a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
+++ b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
@@ -46,7 +46,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
-#define SSBO_SIZE 48
+#define SSBO_SIZE 64
 
 static const char vs_pass_thru_text[] =
"#version 130\n"
@@ -65,6 +65,8 @@ static const char vs_pass_thru_text[] =
"   float f;\n"
"   A s;\n"
"   mat3x4 m;\n"
+   "   vec2 v2a[3];\n"
+   "   vec3 v3a[2];\n"
"   float unsized_array[];\n"
"};\n"
"in vec4 piglit_vertex;\n"
@@ -78,6 +80,10 @@ static const char vs_pass_thru_text[] =
"   s.sb[0].b1[0] = 18.0;\n"
"   s.sb[0].b1[1] = 19.0;\n"
"   m[1] = vec4(25.0, 26.0, 27.0, 28.0);\n"
+   "   v2a[0].yx = vec2(34.0, 33.0);\n"
+   "   v2a[1].y = 36.0;\n"
+   "   v3a[0].xz = vec2(39.0, 41.0);\n"
+   "   v3a[1].y = 43.0;\n"
"   int index = int(v.x); // index should be zero\n"
"   unsized_array[index + gl_VertexID] = unsized_array.length();\n"
"}\n";
@@ -99,6 +105,8 @@ static const char fs_source[] =
"   float f;\n"
"   A s;\n"
"   mat3x4 m;\n"
+   "   vec2 v2a[3];\n"
+   "   vec3 v3a[2];\n"
"   float unsized_array[];\n"
"};\n"
"out vec4 color;\n"
@@ -112,6 +120,10 @@ static const char fs_source[] =
"   s.sb[1].b1[2] = 20.0;\n"
"   m[0] = vec4(21.0, 22.0, 23.0, 24.0);\n"
"   m[2] = vec4(29.0, 30.0, 31.0, 32.0);\n"
+   "   v2a[1].x = 35.0;\n"
+   "   v2a[2].xy = vec2(37.0, 38.0);\n"
+   "   v3a[0].y = 40.0;\n"
+   "   v3a[1].xz = vec2(42.0, 44.0);\n"
"   int index = int(v.z + gl_FragCoord.x);\n"
"   unsized_array[index] = unsized_array.length() * 2.0;\n"
"}\n";
@@ -129,6 +141,10 @@ float expected[SSBO_SIZE] = { 0.0,  1.0,  2.0,  3.0, // 
vec4 v
 21.0, 22.0, 23.0, 24.0, // mat3x4 m[0]
 25.0, 26.0, 27.0, 28.0, // mat3x4 m[1]
 29.0, 30.0, 31.0, 32.0, // mat3x4 m[2]
+33.0, 34.0, 35.0, 36.0, // vec2 v2a[3]
+37.0, 38.0,  0.0,  0.0, //
+39.0, 40.0, 41.0,  0.0, // vec3 v3a[2]
+42.0, 43.0, 44.0,  0.0, //
  4.0,  4.0,  8.0,  8.0  // float unsized_array[0]
 };
 
-- 
2.5.0

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


Re: [Piglit] [PATCH] arb_uniform_buffer_object: fix UNIFORM_BUFFER_START and UNIFORM_BUFFER_SIZE queries when no buffer object is bound

2015-09-15 Thread Kristian Høgsberg
On Wed, May 13, 2015 at 11:56 PM, Samuel Iglesias Gonsalvez
 wrote:
> According to ARB_uniform_buffer_object spec:
>
> "If the parameter (starting offset or size) was not specified when the
>  buffer object was bound (e.g. if bound with BindBufferBase), or if no
>  buffer object is bound to , zero is returned."
>
> Tested on NVIDIA's proprietary driver version 340.65 and ATI proprietary
> driver version 13.35.1005.
>
> Signed-off-by: Samuel Iglesias Gonsalvez 

In particular, this seems to have changed in v64 of the spec:

(v64, 2011-01-27, jon)
- Change return value for start/size queries when no buffer
  bound from -1 to zero, to match state tables (Bug 7318).

Section 6.7.1 of the GL4.0 spec also confirms this.

Reviewed-by: Kristian Høgsberg 

> ---
>  tests/spec/arb_uniform_buffer_object/getintegeri_v.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/arb_uniform_buffer_object/getintegeri_v.c 
> b/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> index d1b685f..9ed5fcc 100644
> --- a/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> +++ b/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> @@ -79,7 +79,7 @@ piglit_init(int argc, char **argv)
>
> piglit_require_extension("GL_ARB_uniform_buffer_object");
>
> -   test_range(__LINE__, 0, 0, -1, -1);
> +   test_range(__LINE__, 0, 0, 0, 0);
>
> glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &alignment);
>
> @@ -117,7 +117,7 @@ piglit_init(int argc, char **argv)
>  * of the GL API, including glBindBuffer(), to allow it
>  */
> glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0);
> -   test_range(__LINE__, 0, 0, -1, -1);
> +   test_range(__LINE__, 0, 0, 0, 0);
>
> /* Test the error condition. */
> glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &max_bindings);
> --
> 2.1.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_image_load_store/compiler: Add memoryBarrier() tests

2015-09-15 Thread Francisco Jerez
Samuel Iglesias Gonsalvez  writes:

> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  generated_tests/gen_shader_image_load_store_tests.py | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/generated_tests/gen_shader_image_load_store_tests.py 
> b/generated_tests/gen_shader_image_load_store_tests.py
> index 00c4f27..296cae3 100644
> --- a/generated_tests/gen_shader_image_load_store_tests.py
> +++ b/generated_tests/gen_shader_image_load_store_tests.py
> @@ -819,3 +819,11 @@ gen('builtin-qualifier-mismatch-writeonly', """\
>  }
>  """, product(image_load_builtin + image_atomic_builtins,
>   image_types[:1], shader_stages))
> +
> +gen('memory-barrier', """\

Maybe call this builtin-memory-barrier for consistency with the other
built-in function compiler tests.  With that fixed:

Reviewed-by: Francisco Jerez 

> +${header('pass')}
> +void main()
> +{
> +memoryBarrier();
> +}
> +""", shader_stages)
> -- 
> 2.1.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


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


Re: [Piglit] [PATCH 2/2] cl: Change data types of char/short buffers in integer limits tests

2015-09-15 Thread Jan Vesely
On Tue, Sep 15, 2015 at 7:28 AM, Jan Vesely  wrote:

> On Thu, 2015-09-10 at 10:12 -0500, Aaron Watry wrote:
> > The char/short return buffers were declared as ints.
> >
> > Signed-off-by: Aaron Watry 
>
> Reviewed-by: Jan Vesely 
> For both patches.
>
> though, I agree with Serge that a spec reference would be nice.
>

PS: don't we need to test this for *_MAX too? I'd expect at least char and
short to have the same problem.

>
> Jan
>
> > ---
> >  tests/cl/program/execute/int-definitions.cl | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tests/cl/program/execute/int-definitions.cl
> > b/tests/cl/program/execute/int-definitions.cl
> > index 3d8ee63..a438fe4 100644
> > --- a/tests/cl/program/execute/int-definitions.cl
> > +++ b/tests/cl/program/execute/int-definitions.cl
> > @@ -12,12 +12,12 @@ global_size: 1 0 0
> >  [test]
> >  name: Char Definitions
> >  kernel_name: test_char
> > -arg_out: 0 buffer int[6] 8 127 -128 127 -128 255
> > +arg_out: 0 buffer char[6] 8 127 -128 127 -128 255
> >
> >  [test]
> >  name: Short Definitions
> >  kernel_name: test_short
> > -arg_out: 0 buffer int[3] 32767 -32768 65535
> > +arg_out: 0 buffer short[3] 32767 -32768 65535
> >
> >  [test]
> >  name: Int Definitions
> > @@ -32,7 +32,7 @@ arg_out: 0 buffer long[3] 9223372036854775807 \
> >18446744073709551615
> >  !*/
> >
> > -kernel void test_char(global int* out) {
> > +kernel void test_char(global char* out) {
> >int i = 0;
> >out[i++] = CHAR_BIT;
> >out[i++] = CHAR_MAX;
> > @@ -42,7 +42,7 @@ kernel void test_char(global int* out) {
> >out[i++] = UCHAR_MAX;
> >  }
> >
> > -kernel void test_short(global int* out) {
> > +kernel void test_short(global short* out) {
> >int i = 0;
> >out[i++] = SHRT_MAX;
> >out[i++] = (SHRT_MIN - (short2)(0)).s0;
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v7] Port basic GL rendering test from Glean to Piglit

2015-09-15 Thread Juliet Fru
Alright,

Thanks Brian, Will send in the patches soon.

Regards,
Juliet

On Tue, Sep 15, 2015 at 2:38 AM, Brian Paul  wrote:

> On 09/13/2015 11:20 AM, Juliet Fru wrote:
>
>> Hello Brian,
>>
>> Could you please give the sample array for testing the black colour?
>>
>
> You just need to declare black like this:
>
> static const float black[3] = { 0.0, 0.0, 0.0 };
>
> then test for that color in the probe function.
>
> -Brian
>
> Regards,
>> Juliet
>>
>> On Fri, Sep 11, 2015 at 10:23 PM, Brian Paul > > wrote:
>>
>> On 09/11/2015 12:55 PM, Juliet Fru wrote:
>>
>> This test replaces the original glean tpaths.cpp test.
>> ---
>>tests/all.py|   1 +
>>tests/spec/gl-1.0/CMakeLists.gl.txt |   1 +
>>tests/spec/gl-1.0/no-op-paths.c | 294
>> 
>>3 files changed, 296 insertions(+)
>>create mode 100644 tests/spec/gl-1.0/no-op-paths.c
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index fcfc5cd..85973d6 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -1000,6 +1000,7 @@ with profile.group_manager(
>>g(['gl-1.0-ortho-pos'])
>>g(['gl-1.0-readpixsanity'])
>>g(['gl-1.0-logicop'])
>> +g(['gl-1.0-no-op-paths'])
>>
>>with profile.group_manager(
>>PiglitGLTest,
>> diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt
>> b/tests/spec/gl-1.0/CMakeLists.gl.txt
>> index d04b835..7a7f508 100644
>> --- a/tests/spec/gl-1.0/CMakeLists.gl.txt
>> +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
>> @@ -22,6 +22,7 @@ piglit_add_executable
>> (gl-1.0-front-invalidate-back front-invalidate-back.c)
>>piglit_add_executable (gl-1.0-logicop logicop.c)
>>piglit_add_executable (gl-1.0-long-dlist long-dlist.c)
>>piglit_add_executable (gl-1.0-ortho-pos orthpos.c)
>> +piglit_add_executable (gl-1.0-no-op-paths no-op-paths.c)
>>piglit_add_executable (gl-1.0-polygon-line-aa
>> polygon-line-aa.c)
>>piglit_add_executable (gl-1.0-push-no-attribs
>> push-no-attribs.c)
>>piglit_add_executable (gl-1.0-readpixsanity readpix.c)
>> diff --git a/tests/spec/gl-1.0/no-op-paths.c
>> b/tests/spec/gl-1.0/no-op-paths.c
>> new file mode 100644
>> index 000..a573b07
>> --- /dev/null
>> +++ b/tests/spec/gl-1.0/no-op-paths.c
>> @@ -0,0 +1,294 @@
>> +/*  BEGIN_COPYRIGHT -*- glean -*-
>> + *
>> + *  Copyright (C) 1999  Allen Akin   All Rights Reserved.
>> + *  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.
>> + *
>> + *  END_COPYRIGHT
>> + */
>> +/** @file paths.c
>> + *
>> + *  Test basic GL rendering paths.
>> + *
>> + *
>> + * Based on the original Glean tpaths.cpp test, this test
>> verifies
>> + * that basic, trival OpenGL paths work as expected. For
>> example,
>> + * glAlphaFunc(GL_GEQUAL, 0.0) should always pass and
>> + * glAlphaFunc(GL_LESS, 0.0) should always fail.  We setup
>> trivial
>> + * pass and fail conditions for each of alpha test,
>> blending, color mask,
>> + * depth test, logic ops, scissor, stencil, stipple

[Piglit] [PATCH] arb_shader_image_load_store/compiler: Add memoryBarrier() tests

2015-09-15 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez 
---
 generated_tests/gen_shader_image_load_store_tests.py | 8 
 1 file changed, 8 insertions(+)

diff --git a/generated_tests/gen_shader_image_load_store_tests.py 
b/generated_tests/gen_shader_image_load_store_tests.py
index 00c4f27..296cae3 100644
--- a/generated_tests/gen_shader_image_load_store_tests.py
+++ b/generated_tests/gen_shader_image_load_store_tests.py
@@ -819,3 +819,11 @@ gen('builtin-qualifier-mismatch-writeonly', """\
 }
 """, product(image_load_builtin + image_atomic_builtins,
  image_types[:1], shader_stages))
+
+gen('memory-barrier', """\
+${header('pass')}
+void main()
+{
+memoryBarrier();
+}
+""", shader_stages)
-- 
2.1.4

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


Re: [Piglit] [PATCH 2/2] cl: Change data types of char/short buffers in integer limits tests

2015-09-15 Thread Jan Vesely
On Thu, 2015-09-10 at 10:12 -0500, Aaron Watry wrote:
> The char/short return buffers were declared as ints.
> 
> Signed-off-by: Aaron Watry 

Reviewed-by: Jan Vesely 
For both patches.

though, I agree with Serge that a spec reference would be nice.

Jan

> ---
>  tests/cl/program/execute/int-definitions.cl | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/cl/program/execute/int-definitions.cl
> b/tests/cl/program/execute/int-definitions.cl
> index 3d8ee63..a438fe4 100644
> --- a/tests/cl/program/execute/int-definitions.cl
> +++ b/tests/cl/program/execute/int-definitions.cl
> @@ -12,12 +12,12 @@ global_size: 1 0 0
>  [test]
>  name: Char Definitions
>  kernel_name: test_char
> -arg_out: 0 buffer int[6] 8 127 -128 127 -128 255
> +arg_out: 0 buffer char[6] 8 127 -128 127 -128 255
>  
>  [test]
>  name: Short Definitions
>  kernel_name: test_short
> -arg_out: 0 buffer int[3] 32767 -32768 65535
> +arg_out: 0 buffer short[3] 32767 -32768 65535
>  
>  [test]
>  name: Int Definitions
> @@ -32,7 +32,7 @@ arg_out: 0 buffer long[3] 9223372036854775807 \
>18446744073709551615
>  !*/
>  
> -kernel void test_char(global int* out) {
> +kernel void test_char(global char* out) {
>int i = 0;
>out[i++] = CHAR_BIT;
>out[i++] = CHAR_MAX;
> @@ -42,7 +42,7 @@ kernel void test_char(global int* out) {
>out[i++] = UCHAR_MAX;
>  }
>  
> -kernel void test_short(global int* out) {
> +kernel void test_short(global short* out) {
>int i = 0;
>out[i++] = SHRT_MAX;
>out[i++] = (SHRT_MIN - (short2)(0)).s0;


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


Re: [Piglit] [PATCH] sso: bind pipeline object in ValidateProgramPipeline

2015-09-15 Thread Juha-Pekka Heikkila
Reviewed-by: Juha-Pekka Heikkila 

On 14.09.2015 12:23, Tapani Pälli wrote:
> When fixing some ES 3.1 conformance issues I noticed several subtests
> started to fail. Pipeline has to be bound before validation, this makes
> failing subtests to pass with planned Mesa changes.
> 
> Signed-off-by: Tapani Pälli 
> ---
>  tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c 
> b/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c
> index a2741aa..d129517 100644
> --- a/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c
> +++ b/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c
> @@ -323,6 +323,7 @@ piglit_init(int argc, char **argv)
>  
>   /* Create the pipeline */
>   glGenProgramPipelines(1, &pipe);
> + glBindProgramPipeline(pipe);
>  
>   build_and_validate_pipe(pipe, true, 
>   "VS/FS program, single glUseProgramStages "
> 

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


Re: [Piglit] [PATCH 1/2] cl: Update integer limit tests to detect incorrect storage sizes

2015-09-15 Thread Serge Martin
On Thursday 10 September 2015 10:12:49 Aaron Watry wrote:
> The tests for the char/short/integer/long minimums do not properly
> check that the value is stored in the correct type.  E.g. (-32768)
> actually gets parsed as an int by the preprocessor, and INT_MIN is
> actually stored as a long.
> 
> By subtracting a vector with value of 0 from the given defined *_MIN
> and then grabbing the first element of the resulting vector, we can
> make sure that the values are actually stored in the correct type.

It puzzle me why a vector operation will raise an error. It's because CL is 
more strict than C
Could you please add something like that in the commit message (as explain in 
the llvm thread):

According to chapter 6.2.6  "Usual Arithmetic Conversions"
"An error shall occur if any scalar operand has greater rank than the type of 
the vector element."

In any case, the series is
Reviewed-by Serge Martin 

> 
> Reported-By: Moritz Pflanzer 
> Signed-off-by: Aaron Watry 
> ---
>  tests/cl/program/execute/int-definitions.cl | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/cl/program/execute/int-definitions.cl
> b/tests/cl/program/execute/int-definitions.cl index 011599d..3d8ee63 100644
> --- a/tests/cl/program/execute/int-definitions.cl
> +++ b/tests/cl/program/execute/int-definitions.cl
> @@ -36,29 +36,29 @@ kernel void test_char(global int* out) {
>int i = 0;
>out[i++] = CHAR_BIT;
>out[i++] = CHAR_MAX;
> -  out[i++] = CHAR_MIN;
> +  out[i++] = (CHAR_MIN - (char2)(0)).s0;
>out[i++] = SCHAR_MAX;
> -  out[i++] = SCHAR_MIN;
> +  out[i++] = (SCHAR_MIN - (char2)(0)).s0;
>out[i++] = UCHAR_MAX;
>  }
> 
>  kernel void test_short(global int* out) {
>int i = 0;
>out[i++] = SHRT_MAX;
> -  out[i++] = SHRT_MIN;
> +  out[i++] = (SHRT_MIN - (short2)(0)).s0;
>out[i++] = USHRT_MAX;
>  }
> 
>  kernel void test_int(global int* out) {
>int i = 0;
>out[i++] = INT_MAX;
> -  out[i++] = INT_MIN;
> +  out[i++] = (INT_MIN - (int2)(0)).s0;
>out[i++] = UINT_MAX;
>  }
> 
>  kernel void test_long(global long* out) {
>int i = 0;
>out[i++] = LONG_MAX;
> -  out[i++] = LONG_MIN;
> +  out[i++] = (LONG_MIN - (long2)(0)).s0;
>out[i++] = ULONG_MAX;
>  }

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