Re: [Piglit] [PATCH] arb_texture_view-mipgen: add test to verify correct format is used for mipgen

2016-01-12 Thread Roland Scheidegger
Am 13.01.2016 um 03:32 schrieb Ilia Mirkin:
> On Tue, Jan 12, 2016 at 8:07 PM,   wrote:
>> From: Roland Scheidegger 
>>
>> At least mesa/st fails this right now (always uses the initial format for mip
>> gen).
>>
>> v2: don't use piglit_display (not actually drawing anything), suggested
>> by Ilia Mirkin.
>> ---
>>  tests/all.py  |   1 +
>>  tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
>>  tests/spec/arb_texture_view/mipgen.c  | 104 
>> ++
>>  3 files changed, 106 insertions(+)
>>  create mode 100644 tests/spec/arb_texture_view/mipgen.c
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index d9f88d6..0a97d26 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -2480,6 +2480,7 @@ with profile.group_manager(
>>  g(['arb_texture_view-cubemap-view'], 'cubemap-view')
>>  g(['arb_texture_view-texture-immutable-levels'], 'immutable_levels')
>>  g(['arb_texture_view-max-level'], 'max-level')
>> +g(['arb_texture_view-mipgen'], 'mipgen')
>>  g(['arb_texture_view-params'], 'params')
>>  g(['arb_texture_view-formats'], 'formats')
>>  g(['arb_texture_view-targets'], 'targets')
>> diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
>> b/tests/spec/arb_texture_view/CMakeLists.gl.txt
>> index 772f8b4..47b3320 100644
>> --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
>> +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
>> @@ -17,6 +17,7 @@ piglit_add_executable(arb_texture_view-formats formats.c 
>> common.c)
>>  piglit_add_executable(arb_texture_view-getteximage-srgb getteximage-srgb.c)
>>  piglit_add_executable(arb_texture_view-lifetime-format lifetime_format.c 
>> common.c)
>>  piglit_add_executable(arb_texture_view-max-level max-level.c)
>> +piglit_add_executable(arb_texture_view-mipgen mipgen.c)
>>  piglit_add_executable(arb_texture_view-params params.c)
>>  piglit_add_executable(arb_texture_view-queries queries.c)
>>  piglit_add_executable(arb_texture_view-rendering-formats 
>> rendering-formats.c)
>> diff --git a/tests/spec/arb_texture_view/mipgen.c 
>> b/tests/spec/arb_texture_view/mipgen.c
>> new file mode 100644
>> index 000..f29a95c
>> --- /dev/null
>> +++ b/tests/spec/arb_texture_view/mipgen.c
>> @@ -0,0 +1,104 @@
>> +/*
>> + * Copyright © 2016 VMware, Inc.
>> + *
>> + * 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.
>> + */
>> +
>> +/**
>> + * Verifies that mipmap generation uses the right format (from view,
>> + * not what was originally specified).
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +#include "common.h"
>> +
>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>> +
>> +   config.supports_gl_compat_version = 20;
>> +
>> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
>> PIGLIT_GL_VISUAL_DOUBLE;
>> +
>> +PIGLIT_GL_TEST_CONFIG_END
>> +
>> +static const char *TestName = "arb_texture_view-mipgen";
> 
> I don't think this is used anywhere. With that removed, this is
Ahh right. The wonders of copy & paste :-).

Roland


> 
> Reviewed-by: Ilia Mirkin 
> 
>> +
>> +/**
>> + * Create view with different view format and generate mipmap.
>> + */
>> +static bool
>> +test_mipgen(void)
>> +{
>> +   GLuint tex, new_tex;
>> +   GLint width = 4, height = 4, levels = 2;
>> +   bool pass = true;
>> +
>> +   glGenTextures(1, );
>> +   glBindTexture(GL_TEXTURE_2D, tex);
>> +
>> +   glTexStorage2D(GL_TEXTURE_2D, levels, GL_R8, width, height);
>> +
>> +   /* averaging these as snorm values should give 0 */
>> +   GLubyte buf[4][4] =
>> +   {{0xFF, 0x01, 0xFF, 0x01},
>> +{0xFF, 0x01, 0xFF, 0x01},
>> +{0xFF, 0x01, 0xFF, 0x01},
>> +{0xFF, 0x01, 0xFF, 0x01}};
>> +   GLbyte res[4];
>> +
>> +   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 

[Piglit] [PATCH] arb_enhanced_layouts: more fs output tests

2016-01-12 Thread Timothy Arceri
---
 .../component-layout/fs-out-array.shader_test  | 36 ++
 .../fs-out-overlap-array.shader_test   | 36 ++
 .../component-layout/fs-out-overlap4.shader_test   | 35 +
 .../fs-out-type-mismatch-array.shader_test | 36 ++
 4 files changed, 143 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test

diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
new file mode 100644
index 000..df96f89
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
@@ -0,0 +1,36 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+//   "Additionally, for fragment shader outputs, if two variables are placed
+//   within the same location, they must have the same underlying type
+//   (floating-point or integer). No component aliasing of output variables or
+//   members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0) out vec2 a[2];
+
+// consumes Z/W components
+layout(location = 1, component = 2) out vec2 b;
+
+void main()
+{
+  a[0] = vec2(0.0);
+  a[1] = vec2(0.5);
+  b = vec2(1.0);
+}
+
+[test]
+link success
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
new file mode 100644
index 000..2bdabf4
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
@@ -0,0 +1,36 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+//   "Additionally, for fragment shader outputs, if two variables are placed
+//   within the same location, they must have the same underlying type
+//   (floating-point or integer). No component aliasing of output variables or
+//   members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0) out vec2 a[2];
+
+// consumes Z/W components
+layout(location = 1, component = 1) out vec2 b;
+
+void main()
+{
+  a[0] = vec2(0.0);
+  a[1] = vec2(0.5);
+  b = vec2(1.0);
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
new file mode 100644
index 000..43ac056
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
@@ -0,0 +1,35 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+//   "Additionally, for fragment shader outputs, if two variables are placed
+//   within the same location, they must have the same underlying type
+//   (floating-point or integer). No component aliasing of output variables or
+//   members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0, component = 1) out vec2 a;
+
+// consumes Z/W components
+layout(location = 0) out vec2 b;
+
+void main()
+{
+  a = vec2(0.0);
+  b = vec2(1.0);
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test
new file mode 100644
index 000..7ca5543
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test
@@ -0,0 +1,36 @@
+// From Section 4.4.2 (Output Layout 

Re: [Piglit] [PATCH] arb_texture_view-mipgen: add test to verify correct format is used for mipgen

2016-01-12 Thread Ilia Mirkin
On Tue, Jan 12, 2016 at 8:07 PM,   wrote:
> From: Roland Scheidegger 
>
> At least mesa/st fails this right now (always uses the initial format for mip
> gen).
>
> v2: don't use piglit_display (not actually drawing anything), suggested
> by Ilia Mirkin.
> ---
>  tests/all.py  |   1 +
>  tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
>  tests/spec/arb_texture_view/mipgen.c  | 104 
> ++
>  3 files changed, 106 insertions(+)
>  create mode 100644 tests/spec/arb_texture_view/mipgen.c
>
> diff --git a/tests/all.py b/tests/all.py
> index d9f88d6..0a97d26 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2480,6 +2480,7 @@ with profile.group_manager(
>  g(['arb_texture_view-cubemap-view'], 'cubemap-view')
>  g(['arb_texture_view-texture-immutable-levels'], 'immutable_levels')
>  g(['arb_texture_view-max-level'], 'max-level')
> +g(['arb_texture_view-mipgen'], 'mipgen')
>  g(['arb_texture_view-params'], 'params')
>  g(['arb_texture_view-formats'], 'formats')
>  g(['arb_texture_view-targets'], 'targets')
> diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
> b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> index 772f8b4..47b3320 100644
> --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
> +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> @@ -17,6 +17,7 @@ piglit_add_executable(arb_texture_view-formats formats.c 
> common.c)
>  piglit_add_executable(arb_texture_view-getteximage-srgb getteximage-srgb.c)
>  piglit_add_executable(arb_texture_view-lifetime-format lifetime_format.c 
> common.c)
>  piglit_add_executable(arb_texture_view-max-level max-level.c)
> +piglit_add_executable(arb_texture_view-mipgen mipgen.c)
>  piglit_add_executable(arb_texture_view-params params.c)
>  piglit_add_executable(arb_texture_view-queries queries.c)
>  piglit_add_executable(arb_texture_view-rendering-formats rendering-formats.c)
> diff --git a/tests/spec/arb_texture_view/mipgen.c 
> b/tests/spec/arb_texture_view/mipgen.c
> new file mode 100644
> index 000..f29a95c
> --- /dev/null
> +++ b/tests/spec/arb_texture_view/mipgen.c
> @@ -0,0 +1,104 @@
> +/*
> + * Copyright © 2016 VMware, Inc.
> + *
> + * 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.
> + */
> +
> +/**
> + * Verifies that mipmap generation uses the right format (from view,
> + * not what was originally specified).
> + */
> +
> +#include "piglit-util-gl.h"
> +#include "common.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_compat_version = 20;
> +
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
> PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const char *TestName = "arb_texture_view-mipgen";

I don't think this is used anywhere. With that removed, this is

Reviewed-by: Ilia Mirkin 

> +
> +/**
> + * Create view with different view format and generate mipmap.
> + */
> +static bool
> +test_mipgen(void)
> +{
> +   GLuint tex, new_tex;
> +   GLint width = 4, height = 4, levels = 2;
> +   bool pass = true;
> +
> +   glGenTextures(1, );
> +   glBindTexture(GL_TEXTURE_2D, tex);
> +
> +   glTexStorage2D(GL_TEXTURE_2D, levels, GL_R8, width, height);
> +
> +   /* averaging these as snorm values should give 0 */
> +   GLubyte buf[4][4] =
> +   {{0xFF, 0x01, 0xFF, 0x01},
> +{0xFF, 0x01, 0xFF, 0x01},
> +{0xFF, 0x01, 0xFF, 0x01},
> +{0xFF, 0x01, 0xFF, 0x01}};
> +   GLbyte res[4];
> +
> +   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
> +   GL_RED, GL_UNSIGNED_BYTE, buf);
> +
> +   glGenTextures(1, _tex);
> +
> +   glTextureView(new_tex, GL_TEXTURE_2D, tex,  GL_R8_SNORM, 0, 2, 0, 1);
> +   glBindTexture(GL_TEXTURE_2D, new_tex);

Re: [Piglit] [PATCH 2/2] framework: Get traceback into json results.

2016-01-12 Thread Jose Fonseca
Thanks. I wasn't sure if your changes already had taken care of this. 
I've pushed it now.


Jose

On 12/01/16 00:08, Dylan Baker wrote:

reviewed-by: Dylan Baker >

On Tue, Dec 8, 2015 at 8:14 AM, Jose Fonseca > wrote:

Exceptions were not reaching it.
---
  framework/results.py   | 3 ++-
  templates/test_result.mako | 8 
  2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/framework/results.py b/framework/results.py
index eeffcb7..ef19fd4 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -196,6 +196,7 @@ class TestResult(object):
  'subtests': self.subtests,
  'time': self.time,
  'exception': self.exception,
+'traceback': self.traceback,
  'dmesg': self.dmesg,
  }
  return obj
@@ -215,7 +216,7 @@ class TestResult(object):
  # pylint: disable=assigning-non-slot
  inst = cls()

-for each in ['returncode', 'command', 'exception',
'environment',
+for each in ['returncode', 'command', 'exception',
'traceback', 'environment',
   'time', 'result', 'dmesg']:
  if each in dict_:
  setattr(inst, each, dict_[each])
diff --git a/templates/test_result.mako b/templates/test_result.mako
index 229a5a7..ff08797 100644
--- a/templates/test_result.mako
+++ b/templates/test_result.mako
@@ -75,6 +75,14 @@
${value.command}
  

+% if value.exception:
+  
+Exception
+
+  ${value.exception | h}
+
+  
+% endif
  % if value.traceback:

  Traceback
--
2.5.0




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


Re: [Piglit] [PATCH] glsl-1.50-geometry-end-primitive: ensure position data is reasonably aligned

2016-01-12 Thread Roland Scheidegger
ping?

Am 09.01.2016 um 05:40 schrieb srol...@vmware.com:
> From: Roland Scheidegger 
> 
> The rect halves comparison is in fact not valid in general. The reason is that
> the same geometry does not have the same precision even if it it just shifted
> by some fixed amount in one direction.
> As an example, some calculated x value near 7 will be near 263 if drawn with
> a viewport x value of 256. The value near 7 has 5 bits more precision -
> when calculating the fixed-point values for rasterization (with subpixel
> accuracy), the lower value thus may be rounded in a different direction
> than the higher one, even with correct rounding (not even entirely sure what
> "correct" rounding here means, nearest-floor or nearest-even or whatever, the
> problem is independent from that). This can then cause different pixels to be
> covered by the primitive.
> This causes a failure with this test in llvmpipe when the rounding mode is
> changed slightly (from "mostly" nearest-away-from-zero to nearest-even). I was
> not able to reproduce this with this test on nvidia or amd hardware, but they
> are definitely affected in theory by the same issue (proven by some quick and
> dirty test).
> So, do floor(tmp*2048) / 2048 to ensure everything is reasonably aligned. This
> still retains some subpixel bits (but only very few).
> 
> This may be a problem with more tests, albeit most tend to use vertex data
> which is already sufficiently aligned (e.g. drawing simple aligned rects).
> 
> v2: use mul/floor/div sequence suggested by Ian Romanick instead of add/sub -
> trying to beat the compiler may not be reliable (as it could reorder
> operations).
> ---
>  tests/spec/glsl-1.50/execution/geometry/end-primitive.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/spec/glsl-1.50/execution/geometry/end-primitive.c 
> b/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
> index 6df3a89..97d8375 100644
> --- a/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
> +++ b/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
> @@ -105,7 +105,9 @@ static const char *spiral_text =
>   "  if (vertex_id % 2 == 1) r += 1.0;\n"
>   "  float max_r = b*sqrt(a*float(num_vertices)) + 1.0;\n"
>   "  r /= max_r;\n"
> - "  return r*vec2(cos(theta), sin(theta));\n"
> + "  vec2 tmp = r*vec2(cos(theta), sin(theta));\n"
> + "  // ensure reasonably aligned vertices\n"
> + "  return floor(tmp * 2048.0f) / 2048.0f;\n"
>   "}\n";
>  
>  /**
> 

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


Re: [Piglit] [PATCH 2/2] framework: Get traceback into json results.

2016-01-12 Thread Dylan Baker
I hadn't pushed any changes here, and noticed this was still outstanding
while doing some other work. Thanks for doing this work.

On Tue, Jan 12, 2016 at 2:59 AM, Jose Fonseca  wrote:

> Thanks. I wasn't sure if your changes already had taken care of this. I've
> pushed it now.
>
> Jose
>
> On 12/01/16 00:08, Dylan Baker wrote:
>
>> reviewed-by: Dylan Baker > >
>>
>> On Tue, Dec 8, 2015 at 8:14 AM, Jose Fonseca > > wrote:
>>
>> Exceptions were not reaching it.
>> ---
>>   framework/results.py   | 3 ++-
>>   templates/test_result.mako | 8 
>>   2 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/framework/results.py b/framework/results.py
>> index eeffcb7..ef19fd4 100644
>> --- a/framework/results.py
>> +++ b/framework/results.py
>> @@ -196,6 +196,7 @@ class TestResult(object):
>>   'subtests': self.subtests,
>>   'time': self.time,
>>   'exception': self.exception,
>> +'traceback': self.traceback,
>>   'dmesg': self.dmesg,
>>   }
>>   return obj
>> @@ -215,7 +216,7 @@ class TestResult(object):
>>   # pylint: disable=assigning-non-slot
>>   inst = cls()
>>
>> -for each in ['returncode', 'command', 'exception',
>> 'environment',
>> +for each in ['returncode', 'command', 'exception',
>> 'traceback', 'environment',
>>'time', 'result', 'dmesg']:
>>   if each in dict_:
>>   setattr(inst, each, dict_[each])
>> diff --git a/templates/test_result.mako b/templates/test_result.mako
>> index 229a5a7..ff08797 100644
>> --- a/templates/test_result.mako
>> +++ b/templates/test_result.mako
>> @@ -75,6 +75,14 @@
>> ${value.command}
>>   
>> 
>> +% if value.exception:
>> +  
>> +Exception
>> +
>> +  ${value.exception | h}
>> +
>> +  
>> +% endif
>>   % if value.traceback:
>> 
>>   Traceback
>> --
>> 2.5.0
>>
>>
>>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] arb_enhanced_layouts: test align layout qualifier can only be used with std140 or std430

2016-01-12 Thread Timothy Arceri
---
 .../ssbo-packed-layout-member-align.vert   | 26 ++
 .../ssbo-shared-layout-block-align.vert| 26 ++
 .../ssbo-shared-layout-member-align.vert   | 26 ++
 .../align-layout/ssbo-std140-block-align.vert  | 26 ++
 .../align-layout/ssbo-std140-member-align.vert | 26 ++
 .../align-layout/ssbo-std430-block-align.vert  | 26 ++
 .../align-layout/ssbo-std430-member-align.vert | 26 ++
 .../ubo-packed-layout-block-align.vert | 25 +
 .../ubo-packed-layout-member-align.vert| 25 +
 .../ubo-shared-layout-block-align.vert | 25 +
 .../ubo-shared-layout-member-align.vert| 25 +
 .../align-layout/ubo-std140-block-align.vert   | 25 +
 .../ubo-std140-member-align-named-block.vert   | 25 +
 .../align-layout/ubo-std140-member-align.vert  | 25 +
 14 files changed, 357 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-packed-layout-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-block-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-std140-block-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-std140-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-std430-block-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-std430-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-packed-layout-block-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-packed-layout-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-shared-layout-block-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-shared-layout-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-std140-block-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-std140-member-align-named-block.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-std140-member-align.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-packed-layout-member-align.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-packed-layout-member-align.vert
new file mode 100644
index 000..59b1231
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-packed-layout-member-align.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: false
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"The *align* qualifier can only be used on blocks or block members, and
+//only for blocks declared with *std140* or *std430* layouts."
+//
+// Tests for compiler error, when the block is of packed layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(packed, align = 32) buffer b {
+   vec4 var1;
+   vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-block-align.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-block-align.vert
new file mode 100644
index 000..981c2d8
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-block-align.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: false
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"The *align* qualifier can only be used on blocks or block members, and
+//only for blocks declared with *std140* or *std430* layouts."
+//
+// Tests for compiler error, when the block is of shared layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(shared, align = 32) buffer b {
+   vec4 var1;
+   vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-member-align.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-shared-layout-member-align.vert
new file mode 100644
index 000..39964fb
--- 

[Piglit] [PATCH 2/2] arb_enhanced_layouts: tests compiler error if align qualifier not a power of 2

2016-01-12 Thread Timothy Arceri
---
 .../ssbo-block-align-not-power-of-two.vert | 26 ++
 .../ssbo-member-align-not-power-of-two.vert| 26 ++
 .../ubo-block-align-not-power-of-two.vert  | 24 
 .../align-layout/ubo-block-align-zero.vert | 24 
 .../ubo-member-align-not-power-of-two.vert | 24 
 .../align-layout/ubo-member-align-zero.vert| 24 
 6 files changed, 148 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-block-align-not-power-of-two.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-member-align-not-power-of-two.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-not-power-of-two.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-zero.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-member-align-not-power-of-two.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-member-align-zero.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-block-align-not-power-of-two.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-block-align-not-power-of-two.vert
new file mode 100644
index 000..56995dc
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-block-align-not-power-of-two.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: false
+// [end config]
+//
+// From Section 4.4.5 (Uniform and Shader Storage Block Layout Qualifiers) of
+// the OpenGL 4.50 spec:
+//
+//   "The specified alignment must be a power of 2, or a compile-time error
+//   results."
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std140, align = 62) buffer b {
+   vec4 var1;
+   vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-member-align-not-power-of-two.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-member-align-not-power-of-two.vert
new file mode 100644
index 000..1a52ad3
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ssbo-member-align-not-power-of-two.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: false
+// [end config]
+//
+// From Section 4.4.5 (Uniform and Shader Storage Block Layout Qualifiers) of
+// the OpenGL 4.50 spec:
+//
+//   "The specified alignment must be a power of 2, or a compile-time error
+//   results."
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std140) buffer b {
+   layout(align = 28) vec4 var1;
+   layout(align = 16) vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-not-power-of-two.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-not-power-of-two.vert
new file mode 100644
index 000..fc23415
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-not-power-of-two.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// From Section 4.4.5 (Uniform and Shader Storage Block Layout Qualifiers) of
+// the OpenGL 4.50 spec:
+//
+//   "The specified alignment must be a power of 2, or a compile-time error
+//   results."
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140, align = 40) uniform block {
+   vec4 var1;
+   vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-zero.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-zero.vert
new file mode 100644
index 000..308e390
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/align-layout/ubo-block-align-zero.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// From Section 4.4.5 (Uniform and Shader Storage Block Layout Qualifiers) of
+// the OpenGL 4.50 spec:
+//
+//   "The specified alignment must be a power of 2, or a compile-time error
+//   results."
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140, align = 0) uniform block {
+   vec4 var1;
+   vec4 var2;
+};
+
+void main()
+{
+}
diff --git 

Re: [Piglit] [PATCH] EXT_multisampled_render_to_texture: functional test

2016-01-12 Thread Wendt, Magnus
Thank you Ian for the review and helpful comments.

My apologies for not getting the reply done before the holidays. To keep the 
mail short I have not replied to any comments you had that I just fixed 
according to your suggestions. So consider all that addressed.

>> [blitting from a multisampled FBO to a singlesampled one and then to the 
>> default framebuffer]
> It seems like this could be simpler... can you make fbo_ms half the width of 
> the default framebuffer and just resolve directly from fbo_ms to the default 
> framebuffer?

My reason for doing it this way is that it reflects how multisampled render to 
texture is done without the extension. Sometimes when writing tests you get to 
write convoluted code for the sake of being convoluted ;). I have modified the 
final draw_rect to not being axis aligned anymore so that this second FBO is 
actually required. 

>> +if (!piglit_probe_rect_halves_equal_rgba(0, 0, FB_WIDTH, 
>> FB_HEIGHT))
> Does the spec actually require that the results be identical?

Not really, but I expect that any implementation would most likely implement it 
that way. Since this isn't a conformance test, but a functional test, I took 
the pragmatic approach and tested for identity rather than trying to tune 
tolerance levels to e.g. reject single sampled results. If anyone implements 
this extension in a way so that the identity assumption doesn't hold anymore 
the test could be updated at that time.

> Avoid tests that overdraw previous results. [...]

In this case overdrawing is the test. I want to make sure that there are no 
nasty interactions with fast clear. But I agree the result should remain 
intact, so I have added a break if a pass fails. (Other than overdraw the 
additional passes don't really do anything interesting.)

>> +glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
>> +  GL_RENDERBUFFER, fbo_ms.depth);
> Do you actually need a depth buffer?

Yes and no. I have removed the depth buffer from the default framebuffer. As 
for the FBOs: I am creating an FBO with a multisampled depth attachment and a 
single sampled color attachment. I think that is exotic enough to warrant a 
depth buffer. As for the ground truth FBO, I have it just for symmetry reasons.

Sending a v2.

- Magnus

-Original Message-
From: Ian Romanick [mailto:i...@freedesktop.org] 
Sent: Thursday, December 17, 2015 10:02 PM
To: Wendt, Magnus ; piglit@lists.freedesktop.org
Subject: Re: [Piglit] [PATCH] EXT_multisampled_render_to_texture: functional 
test

On 12/16/2015 06:33 AM, Magnus Wendt wrote:
> EXT_multisampled_render_to_texture allows you to bind a singlesampled 
> texture to the color attachment of a multisampled framebuffer object.
> Rendering is multisampled and the multisample data is implicitly 
> resolved and invalidated when texturing.
> 
> The test renders a ground truth image by drawing a slanted textured 
> quad to a multisampled fbo and resolves it using a blit to a 
> singlesampled fbo. This is textured onto the left half of the window.
> It then renders the same thing into an implicitly resolved fbo and 
> textures that onto the right half of the screen. The two halfs are 
> compared. This is repeated for another slant and different clear 
> colors to check for possible interactions with fast clear.
> The test passes if the two methods yeild identical results for all 
> image

 yield

> pairs.

We'll also need a couple additional tests.  At the very least, we need an 
api-errors test.  There are many that you can borrow from.

If RenderbufferStorageMultisampleEXT is called with a value of
 that is greater than MAX_SAMPLES_EXT, then the error
INVALID_VALUE is generated.

The error INVALID_ENUM is generated if FramebufferTexture2DMultisampleEXT 
is called with a  that is not FRAMEBUFFER.

The error INVALID_ENUM is generated if FramebufferTexture2DMultisampleEXT
is called with an  that is not COLOR_ATTACHMENT0.

The error INVALID_ENUM is generated if FramebufferTexture2DMultisampleEXT 
is called with a  that is not TEXTURE_2D, 
TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, 
TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_X, 
TEXTURE_CUBE_MAP_NEGATIVE_Y, or TEXTURE_CUBE_MAP_NEGATIVE_Z.

The errors section neglects to mention this error from earlier in the spec:

If either width or height is greater than the value of
MAX_RENDERBUFFER_SIZE ... then the error INVALID_VALUE is generated.

We also need a minmax test for GL_MAX_SAMPLES_EXT.  Copy from 
tests/spec/arb_shader_subroutine/minmax.c.

I'd also like to see a test for this bit:

Otherwise samples represents a request for a desired minimum number 
of samples. Since different implementations may support different 
sample counts for multisampled rendering, the actual number of samples 
allocated for 

[Piglit] [PATCH v2] EXT_multisampled_render_to_texture: functional test

2016-01-12 Thread Magnus Wendt
EXT_multisampled_render_to_texture allows you to bind a singlesampled
texture to the color attachment of a multisampled framebuffer object.
Rendering is multisampled and the multisample data is implicitly
resolved and invalidated when texturing.

The test renders a ground truth image by drawing a slanted textured quad
to a multisampled fbo and resolves it using a blit to a singlesampled
fbo. This is textured onto the left half of the window.
It then renders the same thing into an implicitly resolved fbo and
textures that onto the right half of the screen. The two halfs are
compared. This is repeated for another slant and different clear colors
to check for possible interactions with fast clear.
The test passes if the two methods yeild identical results for all image
pairs.

v2: - Renamed main test and added api-errors and minmax tests.
- Several minor changes mostly related to style. (Ian Romanick)

Signed-off-by: Magnus Wendt 
---
 tests/all.py   |   9 +
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gles3.txt   |   7 +
 .../CMakeLists.txt |   1 +
 .../api-errors.c   | 274 +++
 .../ext_multisampled_render_to_texture/minmax.c|  58 
 .../ext_multisampled_render_to_texture/render.c| 366 +
 7 files changed, 716 insertions(+)
 create mode 100644 
tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
 create mode 100644 tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
 create mode 100644 tests/spec/ext_multisampled_render_to_texture/api-errors.c
 create mode 100644 tests/spec/ext_multisampled_render_to_texture/minmax.c
 create mode 100644 tests/spec/ext_multisampled_render_to_texture/render.c

diff --git a/tests/all.py b/tests/all.py
index 8982d22..1b3519b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4592,5 +4592,14 @@ with profile.group_manager(
 g(['arb_indirect_parameters-tf-count-arrays'], 'tf-count-arrays')
 g(['arb_indirect_parameters-tf-count-elements'], 'tf-count-elements')
 
+# Group EXT_multismapled_render_to_texture
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ext_multisampled_render_to_texture')) as g:
+g(['ext_multisampled_render_to_texture-minmax'])
+g(['ext_multisampled_render_to_texture-api-errors'])
+for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
+g(['ext_multisampled_render_to_texture-render', sample_count])
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 383cd60..039323f 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -75,6 +75,7 @@ add_subdirectory (ext_depth_bounds_test)
 add_subdirectory (ext_fog_coord)
 add_subdirectory (ext_framebuffer_multisample)
 add_subdirectory (ext_framebuffer_multisample_blit_scaled)
+add_subdirectory (ext_multisampled_render_to_texture)
 add_subdirectory (ext_packed_depth_stencil)
 add_subdirectory (ext_packed_float)
 add_subdirectory (ext_shader_samples_identical)
diff --git a/tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt 
b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
new file mode 100644
index 000..4c7b02a
--- /dev/null
+++ b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
@@ -0,0 +1,7 @@
+link_libraries(
+   piglitutil_${piglit_target_api}
+   )
+
+piglit_add_executable(ext_multisampled_render_to_texture-render render.c)
+piglit_add_executable(ext_multisampled_render_to_texture-api-errors 
api-errors.c)
+piglit_add_executable(ext_multisampled_render_to_texture-minmax minmax.c)
diff --git a/tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt 
b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/ext_multisampled_render_to_texture/api-errors.c 
b/tests/spec/ext_multisampled_render_to_texture/api-errors.c
new file mode 100644
index 000..f308df5
--- /dev/null
+++ b/tests/spec/ext_multisampled_render_to_texture/api-errors.c
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2016 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 

Re: [Piglit] [PATCH 0/5] Randomized UBO tests of doom

2016-01-12 Thread Timothy Arceri
On Tue, 2015-11-10 at 16:46 -0800, Dylan Baker wrote:
> Since gravy is so delicious,
> 
> https://github.com/dcbaker/piglit.git wip/ubo-fuzzer
> 
> bin/piglit run ubo-fuzzer output
> 
> Obviously it's not at all feature complete, it's more proof of
> concept
> than anything else, but gravy.

Hi Dylan,

I took a quick look at your branch and I'd like to suggest a way
forward on this.

It looks like you made a bunch of small/fixes tidy ups to Ian's
scripts, how about we get those sent out for review/comment then commit
the script to the main piglit repo. 

Ilia and I can then rebase our modifications, resend for review and
commit those.

Then we can worry about gravy once we have all the work in one place.

How does that sound?

Tim


> 
> On Tue, Nov 10, 2015 at 03:01 11AM -0500, Ilia Mirkin wrote:
> > That's a full step ahead of my suggestion. I just want the thing in
> > a
> > shared place so that I can run it when doing dodgy things to code I
> > don't understand... if there's some automated process running it,
> > that's just gravy on top.
> > 
> [snip]
> ___
> 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 0/5] Randomized UBO tests of doom

2016-01-12 Thread Dylan Baker
That sounds like a plan. Would you like to get Ian's original scripts
merged, and I'll update the cleanups I have for his scripts and send them
out?

Dylan

On Tue, Jan 12, 2016 at 2:41 PM, Timothy Arceri 
wrote:

> On Tue, 2015-11-10 at 16:46 -0800, Dylan Baker wrote:
> > Since gravy is so delicious,
> >
> > https://github.com/dcbaker/piglit.git wip/ubo-fuzzer
> >
> > bin/piglit run ubo-fuzzer output
> >
> > Obviously it's not at all feature complete, it's more proof of
> > concept
> > than anything else, but gravy.
>
> Hi Dylan,
>
> I took a quick look at your branch and I'd like to suggest a way
> forward on this.
>
> It looks like you made a bunch of small/fixes tidy ups to Ian's
> scripts, how about we get those sent out for review/comment then commit
> the script to the main piglit repo.
>
> Ilia and I can then rebase our modifications, resend for review and
> commit those.
>
> Then we can worry about gravy once we have all the work in one place.
>
> How does that sound?
>
> Tim
>
>
> >
> > On Tue, Nov 10, 2015 at 03:01 11AM -0500, Ilia Mirkin wrote:
> > > That's a full step ahead of my suggestion. I just want the thing in
> > > a
> > > shared place so that I can run it when doing dodgy things to code I
> > > don't understand... if there's some automated process running it,
> > > that's just gravy on top.
> > >
> > [snip]
> > ___
> > 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 0/5] Randomized UBO tests of doom

2016-01-12 Thread Ilia Mirkin
My fixes are one-liners (might just be one, I forget). At this point I
would very much like to see *anything* checked in, and we can improve
from there.

On Tue, Jan 12, 2016 at 6:04 PM, Dylan Baker  wrote:
> That sounds like a plan. Would you like to get Ian's original scripts
> merged, and I'll update the cleanups I have for his scripts and send them
> out?
>
> Dylan
>
> On Tue, Jan 12, 2016 at 2:41 PM, Timothy Arceri 
> wrote:
>>
>> On Tue, 2015-11-10 at 16:46 -0800, Dylan Baker wrote:
>> > Since gravy is so delicious,
>> >
>> > https://github.com/dcbaker/piglit.git wip/ubo-fuzzer
>> >
>> > bin/piglit run ubo-fuzzer output
>> >
>> > Obviously it's not at all feature complete, it's more proof of
>> > concept
>> > than anything else, but gravy.
>>
>> Hi Dylan,
>>
>> I took a quick look at your branch and I'd like to suggest a way
>> forward on this.
>>
>> It looks like you made a bunch of small/fixes tidy ups to Ian's
>> scripts, how about we get those sent out for review/comment then commit
>> the script to the main piglit repo.
>>
>> Ilia and I can then rebase our modifications, resend for review and
>> commit those.
>>
>> Then we can worry about gravy once we have all the work in one place.
>>
>> How does that sound?
>>
>> Tim
>>
>>
>> >
>> > On Tue, Nov 10, 2015 at 03:01 11AM -0500, Ilia Mirkin wrote:
>> > > That's a full step ahead of my suggestion. I just want the thing in
>> > > a
>> > > shared place so that I can run it when doing dodgy things to code I
>> > > don't understand... if there's some automated process running it,
>> > > that's just gravy on top.
>> > >
>> > [snip]
>> > ___
>> > 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] glsl-1.50-geometry-end-primitive: ensure position data is reasonably aligned

2016-01-12 Thread Ian Romanick
Reviewed-by: Ian Romanick 

On 01/08/2016 08:40 PM, srol...@vmware.com wrote:
> From: Roland Scheidegger 
> 
> The rect halves comparison is in fact not valid in general. The reason is that
> the same geometry does not have the same precision even if it it just shifted
> by some fixed amount in one direction.
> As an example, some calculated x value near 7 will be near 263 if drawn with
> a viewport x value of 256. The value near 7 has 5 bits more precision -
> when calculating the fixed-point values for rasterization (with subpixel
> accuracy), the lower value thus may be rounded in a different direction
> than the higher one, even with correct rounding (not even entirely sure what
> "correct" rounding here means, nearest-floor or nearest-even or whatever, the
> problem is independent from that). This can then cause different pixels to be
> covered by the primitive.
> This causes a failure with this test in llvmpipe when the rounding mode is
> changed slightly (from "mostly" nearest-away-from-zero to nearest-even). I was
> not able to reproduce this with this test on nvidia or amd hardware, but they
> are definitely affected in theory by the same issue (proven by some quick and
> dirty test).
> So, do floor(tmp*2048) / 2048 to ensure everything is reasonably aligned. This
> still retains some subpixel bits (but only very few).
> 
> This may be a problem with more tests, albeit most tend to use vertex data
> which is already sufficiently aligned (e.g. drawing simple aligned rects).
> 
> v2: use mul/floor/div sequence suggested by Ian Romanick instead of add/sub -
> trying to beat the compiler may not be reliable (as it could reorder
> operations).
> ---
>  tests/spec/glsl-1.50/execution/geometry/end-primitive.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/spec/glsl-1.50/execution/geometry/end-primitive.c 
> b/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
> index 6df3a89..97d8375 100644
> --- a/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
> +++ b/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
> @@ -105,7 +105,9 @@ static const char *spiral_text =
>   "  if (vertex_id % 2 == 1) r += 1.0;\n"
>   "  float max_r = b*sqrt(a*float(num_vertices)) + 1.0;\n"
>   "  r /= max_r;\n"
> - "  return r*vec2(cos(theta), sin(theta));\n"
> + "  vec2 tmp = r*vec2(cos(theta), sin(theta));\n"
> + "  // ensure reasonably aligned vertices\n"
> + "  return floor(tmp * 2048.0f) / 2048.0f;\n"
>   "}\n";
>  
>  /**
> 

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


Re: [Piglit] [PATCH] glsl-1.50-geometry-end-primitive: ensure position data is reasonably aligned

2016-01-12 Thread Jose Fonseca

On 12/01/16 17:51, Roland Scheidegger wrote:

ping?

Am 09.01.2016 um 05:40 schrieb srol...@vmware.com:

From: Roland Scheidegger 

The rect halves comparison is in fact not valid in general. The reason is that
the same geometry does not have the same precision even if it it just shifted
by some fixed amount in one direction.
As an example, some calculated x value near 7 will be near 263 if drawn with
a viewport x value of 256. The value near 7 has 5 bits more precision -
when calculating the fixed-point values for rasterization (with subpixel
accuracy), the lower value thus may be rounded in a different direction
than the higher one, even with correct rounding (not even entirely sure what
"correct" rounding here means, nearest-floor or nearest-even or whatever, the
problem is independent from that). This can then cause different pixels to be
covered by the primitive.
This causes a failure with this test in llvmpipe when the rounding mode is
changed slightly (from "mostly" nearest-away-from-zero to nearest-even). I was
not able to reproduce this with this test on nvidia or amd hardware, but they
are definitely affected in theory by the same issue (proven by some quick and
dirty test).
So, do floor(tmp*2048) / 2048 to ensure everything is reasonably aligned. This
still retains some subpixel bits (but only very few).

This may be a problem with more tests, albeit most tend to use vertex data
which is already sufficiently aligned (e.g. drawing simple aligned rects).

v2: use mul/floor/div sequence suggested by Ian Romanick instead of add/sub -
trying to beat the compiler may not be reliable (as it could reorder
operations).
---
  tests/spec/glsl-1.50/execution/geometry/end-primitive.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/spec/glsl-1.50/execution/geometry/end-primitive.c 
b/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
index 6df3a89..97d8375 100644
--- a/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
+++ b/tests/spec/glsl-1.50/execution/geometry/end-primitive.c
@@ -105,7 +105,9 @@ static const char *spiral_text =
"  if (vertex_id % 2 == 1) r += 1.0;\n"
"  float max_r = b*sqrt(a*float(num_vertices)) + 1.0;\n"
"  r /= max_r;\n"
-   "  return r*vec2(cos(theta), sin(theta));\n"
+   "  vec2 tmp = r*vec2(cos(theta), sin(theta));\n"
+   "  // ensure reasonably aligned vertices\n"
+   "  return floor(tmp * 2048.0f) / 2048.0f;\n"
"}\n";

  /**




Looks good to me too.  Short and simple.

Reviewed-by: Jose Fonseca 

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


[Piglit] [PATCH] arb_texture_view-mipgen: add test to verify correct format is used for mipgen

2016-01-12 Thread sroland
From: Roland Scheidegger 

At least mesa/st fails this right now (always uses the initial format for mip
gen).

v2: don't use piglit_display (not actually drawing anything), suggested
by Ilia Mirkin.
---
 tests/all.py  |   1 +
 tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
 tests/spec/arb_texture_view/mipgen.c  | 104 ++
 3 files changed, 106 insertions(+)
 create mode 100644 tests/spec/arb_texture_view/mipgen.c

diff --git a/tests/all.py b/tests/all.py
index d9f88d6..0a97d26 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2480,6 +2480,7 @@ with profile.group_manager(
 g(['arb_texture_view-cubemap-view'], 'cubemap-view')
 g(['arb_texture_view-texture-immutable-levels'], 'immutable_levels')
 g(['arb_texture_view-max-level'], 'max-level')
+g(['arb_texture_view-mipgen'], 'mipgen')
 g(['arb_texture_view-params'], 'params')
 g(['arb_texture_view-formats'], 'formats')
 g(['arb_texture_view-targets'], 'targets')
diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
b/tests/spec/arb_texture_view/CMakeLists.gl.txt
index 772f8b4..47b3320 100644
--- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
@@ -17,6 +17,7 @@ piglit_add_executable(arb_texture_view-formats formats.c 
common.c)
 piglit_add_executable(arb_texture_view-getteximage-srgb getteximage-srgb.c)
 piglit_add_executable(arb_texture_view-lifetime-format lifetime_format.c 
common.c)
 piglit_add_executable(arb_texture_view-max-level max-level.c)
+piglit_add_executable(arb_texture_view-mipgen mipgen.c)
 piglit_add_executable(arb_texture_view-params params.c)
 piglit_add_executable(arb_texture_view-queries queries.c)
 piglit_add_executable(arb_texture_view-rendering-formats rendering-formats.c)
diff --git a/tests/spec/arb_texture_view/mipgen.c 
b/tests/spec/arb_texture_view/mipgen.c
new file mode 100644
index 000..f29a95c
--- /dev/null
+++ b/tests/spec/arb_texture_view/mipgen.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright © 2016 VMware, Inc.
+ *
+ * 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.
+ */
+
+/**
+ * Verifies that mipmap generation uses the right format (from view,
+ * not what was originally specified).
+ */
+
+#include "piglit-util-gl.h"
+#include "common.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 20;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *TestName = "arb_texture_view-mipgen";
+
+/**
+ * Create view with different view format and generate mipmap.
+ */
+static bool
+test_mipgen(void)
+{
+   GLuint tex, new_tex;
+   GLint width = 4, height = 4, levels = 2;
+   bool pass = true;
+
+   glGenTextures(1, );
+   glBindTexture(GL_TEXTURE_2D, tex);
+
+   glTexStorage2D(GL_TEXTURE_2D, levels, GL_R8, width, height);
+
+   /* averaging these as snorm values should give 0 */
+   GLubyte buf[4][4] =
+   {{0xFF, 0x01, 0xFF, 0x01},
+{0xFF, 0x01, 0xFF, 0x01},
+{0xFF, 0x01, 0xFF, 0x01},
+{0xFF, 0x01, 0xFF, 0x01}};
+   GLbyte res[4];
+
+   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
+   GL_RED, GL_UNSIGNED_BYTE, buf);
+
+   glGenTextures(1, _tex);
+
+   glTextureView(new_tex, GL_TEXTURE_2D, tex,  GL_R8_SNORM, 0, 2, 0, 1);
+   glBindTexture(GL_TEXTURE_2D, new_tex);
+   glGenerateMipmap(GL_TEXTURE_2D);
+   glPixelStorei(GL_PACK_ALIGNMENT, 1);
+   glGetTexImage(GL_TEXTURE_2D, 1, GL_RED, GL_BYTE, );
+   pass = !res[0] && !res[1] && !res[2] && !res[3];
+
+   if (!pass) {
+   printf("expected 0, got %d %d %d %d\n",
+  res[0], res[1], res[2], res[3]);
+   }
+
+   glDeleteTextures(1, _tex);
+   glDeleteTextures(1, );
+
+  

[Piglit] [PATCH] arb_texture_view-mipgen: add test to verify correct format is used for mipgen

2016-01-12 Thread sroland
From: Roland Scheidegger 

At least mesa/st fails this right now (always uses the initial format for mip
gen).
---
 tests/all.py  |   1 +
 tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
 tests/spec/arb_texture_view/mipgen.c  | 102 ++
 3 files changed, 104 insertions(+)
 create mode 100644 tests/spec/arb_texture_view/mipgen.c

diff --git a/tests/all.py b/tests/all.py
index d9f88d6..0a97d26 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2480,6 +2480,7 @@ with profile.group_manager(
 g(['arb_texture_view-cubemap-view'], 'cubemap-view')
 g(['arb_texture_view-texture-immutable-levels'], 'immutable_levels')
 g(['arb_texture_view-max-level'], 'max-level')
+g(['arb_texture_view-mipgen'], 'mipgen')
 g(['arb_texture_view-params'], 'params')
 g(['arb_texture_view-formats'], 'formats')
 g(['arb_texture_view-targets'], 'targets')
diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
b/tests/spec/arb_texture_view/CMakeLists.gl.txt
index 772f8b4..47b3320 100644
--- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
@@ -17,6 +17,7 @@ piglit_add_executable(arb_texture_view-formats formats.c 
common.c)
 piglit_add_executable(arb_texture_view-getteximage-srgb getteximage-srgb.c)
 piglit_add_executable(arb_texture_view-lifetime-format lifetime_format.c 
common.c)
 piglit_add_executable(arb_texture_view-max-level max-level.c)
+piglit_add_executable(arb_texture_view-mipgen mipgen.c)
 piglit_add_executable(arb_texture_view-params params.c)
 piglit_add_executable(arb_texture_view-queries queries.c)
 piglit_add_executable(arb_texture_view-rendering-formats rendering-formats.c)
diff --git a/tests/spec/arb_texture_view/mipgen.c 
b/tests/spec/arb_texture_view/mipgen.c
new file mode 100644
index 000..0f96f77
--- /dev/null
+++ b/tests/spec/arb_texture_view/mipgen.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright © 2016 VMware, Inc.
+ *
+ * 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.
+ */
+
+/**
+ * Verifies that mipmap generation uses the right format (from view,
+ * not what was originally specified).
+ */
+
+#include "piglit-util-gl.h"
+#include "common.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 20;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *TestName = "arb_texture_view-mipgen";
+
+/**
+ * Create view with different view format and generate mipmap.
+ */
+static bool
+test_mipgen(void)
+{
+   GLuint tex, new_tex;
+   GLint width = 4, height = 4, levels = 2;
+   bool pass = true;
+
+   glGenTextures(1, );
+   glBindTexture(GL_TEXTURE_2D, tex);
+
+   glTexStorage2D(GL_TEXTURE_2D, levels, GL_R8, width, height);
+
+   /* averaging these as snorm values should give 0 */
+   GLubyte buf[4][4] =
+   {{0xFF, 0x01, 0xFF, 0x01},
+{0xFF, 0x01, 0xFF, 0x01},
+{0xFF, 0x01, 0xFF, 0x01},
+{0xFF, 0x01, 0xFF, 0x01}};
+   GLbyte res[4];
+
+   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
+   GL_RED, GL_UNSIGNED_BYTE, buf);
+
+   glGenTextures(1, _tex);
+
+   glTextureView(new_tex, GL_TEXTURE_2D, tex,  GL_R8_SNORM, 0, 2, 0, 1);
+   glBindTexture(GL_TEXTURE_2D, new_tex);
+   glGenerateMipmap(GL_TEXTURE_2D);
+   glPixelStorei(GL_PACK_ALIGNMENT, 1);
+   glGetTexImage(GL_TEXTURE_2D, 1, GL_RED, GL_BYTE, );
+   pass = !res[0] && !res[1] && !res[2] && !res[3];
+
+   if (!pass) {
+   printf("expected 0, got %d %d %d %d\n",
+  res[0], res[1], res[2], res[3]);
+   }
+
+   glDeleteTextures(1, _tex);
+   glDeleteTextures(1, );
+
+   return pass;
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = 

Re: [Piglit] [PATCH 0/5] Randomized UBO tests of doom

2016-01-12 Thread Dylan Baker
That is the plan I think? Timothy will merge Ian's scripts, and then we can
rebase cleanups and send them out for review?

On Tue, Jan 12, 2016 at 3:09 PM, Ilia Mirkin  wrote:

> My fixes are one-liners (might just be one, I forget). At this point I
> would very much like to see *anything* checked in, and we can improve
> from there.
>
> On Tue, Jan 12, 2016 at 6:04 PM, Dylan Baker 
> wrote:
> > That sounds like a plan. Would you like to get Ian's original scripts
> > merged, and I'll update the cleanups I have for his scripts and send them
> > out?
> >
> > Dylan
> >
> > On Tue, Jan 12, 2016 at 2:41 PM, Timothy Arceri 
> > wrote:
> >>
> >> On Tue, 2015-11-10 at 16:46 -0800, Dylan Baker wrote:
> >> > Since gravy is so delicious,
> >> >
> >> > https://github.com/dcbaker/piglit.git wip/ubo-fuzzer
> >> >
> >> > bin/piglit run ubo-fuzzer output
> >> >
> >> > Obviously it's not at all feature complete, it's more proof of
> >> > concept
> >> > than anything else, but gravy.
> >>
> >> Hi Dylan,
> >>
> >> I took a quick look at your branch and I'd like to suggest a way
> >> forward on this.
> >>
> >> It looks like you made a bunch of small/fixes tidy ups to Ian's
> >> scripts, how about we get those sent out for review/comment then commit
> >> the script to the main piglit repo.
> >>
> >> Ilia and I can then rebase our modifications, resend for review and
> >> commit those.
> >>
> >> Then we can worry about gravy once we have all the work in one place.
> >>
> >> How does that sound?
> >>
> >> Tim
> >>
> >>
> >> >
> >> > On Tue, Nov 10, 2015 at 03:01 11AM -0500, Ilia Mirkin wrote:
> >> > > That's a full step ahead of my suggestion. I just want the thing in
> >> > > a
> >> > > shared place so that I can run it when doing dodgy things to code I
> >> > > don't understand... if there's some automated process running it,
> >> > > that's just gravy on top.
> >> > >
> >> > [snip]
> >> > ___
> >> > 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_texture_view-mipgen: add test to verify correct format is used for mipgen

2016-01-12 Thread Ilia Mirkin
On Tue, Jan 12, 2016 at 7:20 PM,   wrote:
> From: Roland Scheidegger 
>
> At least mesa/st fails this right now (always uses the initial format for mip
> gen).
> ---
>  tests/all.py  |   1 +
>  tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
>  tests/spec/arb_texture_view/mipgen.c  | 102 
> ++
>  3 files changed, 104 insertions(+)
>  create mode 100644 tests/spec/arb_texture_view/mipgen.c
>
> diff --git a/tests/all.py b/tests/all.py
> index d9f88d6..0a97d26 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2480,6 +2480,7 @@ with profile.group_manager(
>  g(['arb_texture_view-cubemap-view'], 'cubemap-view')
>  g(['arb_texture_view-texture-immutable-levels'], 'immutable_levels')
>  g(['arb_texture_view-max-level'], 'max-level')
> +g(['arb_texture_view-mipgen'], 'mipgen')
>  g(['arb_texture_view-params'], 'params')
>  g(['arb_texture_view-formats'], 'formats')
>  g(['arb_texture_view-targets'], 'targets')
> diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt 
> b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> index 772f8b4..47b3320 100644
> --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
> +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> @@ -17,6 +17,7 @@ piglit_add_executable(arb_texture_view-formats formats.c 
> common.c)
>  piglit_add_executable(arb_texture_view-getteximage-srgb getteximage-srgb.c)
>  piglit_add_executable(arb_texture_view-lifetime-format lifetime_format.c 
> common.c)
>  piglit_add_executable(arb_texture_view-max-level max-level.c)
> +piglit_add_executable(arb_texture_view-mipgen mipgen.c)
>  piglit_add_executable(arb_texture_view-params params.c)
>  piglit_add_executable(arb_texture_view-queries queries.c)
>  piglit_add_executable(arb_texture_view-rendering-formats rendering-formats.c)
> diff --git a/tests/spec/arb_texture_view/mipgen.c 
> b/tests/spec/arb_texture_view/mipgen.c
> new file mode 100644
> index 000..0f96f77
> --- /dev/null
> +++ b/tests/spec/arb_texture_view/mipgen.c
> @@ -0,0 +1,102 @@
> +/*
> + * Copyright © 2016 VMware, Inc.
> + *
> + * 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.
> + */
> +
> +/**
> + * Verifies that mipmap generation uses the right format (from view,
> + * not what was originally specified).
> + */
> +
> +#include "piglit-util-gl.h"
> +#include "common.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_compat_version = 20;
> +
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
> PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const char *TestName = "arb_texture_view-mipgen";
> +
> +/**
> + * Create view with different view format and generate mipmap.
> + */
> +static bool
> +test_mipgen(void)
> +{
> +   GLuint tex, new_tex;
> +   GLint width = 4, height = 4, levels = 2;
> +   bool pass = true;
> +
> +   glGenTextures(1, );
> +   glBindTexture(GL_TEXTURE_2D, tex);
> +
> +   glTexStorage2D(GL_TEXTURE_2D, levels, GL_R8, width, height);
> +
> +   /* averaging these as snorm values should give 0 */
> +   GLubyte buf[4][4] =
> +   {{0xFF, 0x01, 0xFF, 0x01},
> +{0xFF, 0x01, 0xFF, 0x01},
> +{0xFF, 0x01, 0xFF, 0x01},
> +{0xFF, 0x01, 0xFF, 0x01}};
> +   GLbyte res[4];
> +
> +   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
> +   GL_RED, GL_UNSIGNED_BYTE, buf);
> +
> +   glGenTextures(1, _tex);
> +
> +   glTextureView(new_tex, GL_TEXTURE_2D, tex,  GL_R8_SNORM, 0, 2, 0, 1);
> +   glBindTexture(GL_TEXTURE_2D, new_tex);
> +   glGenerateMipmap(GL_TEXTURE_2D);
> +   glPixelStorei(GL_PACK_ALIGNMENT, 1);
> +   glGetTexImage(GL_TEXTURE_2D, 1, GL_RED, GL_BYTE, );
> +   pass = !res[0] && !res[1] && !res[2] &&