[Piglit] [PATCH V2] arb_shading_language_420pack: test multiple layout qualifiers on the same line

2016-01-13 Thread Timothy Arceri
While the spec is taking about multiple layout qualifiers we interpret that
to mean layout-qualifier-names can also occur multiple times within
a single layout qualifier.

In Section 4.4 (Layout Qualifiers) of the GLSL 4.40 spec it clarifies this:

   "More than one layout qualifier may appear in a single declaration.
   Additionally, the same layout-qualifier-name can occur multiple times
   within a layout qualifier or across multiple layout qualifiers in the
   same declaration"

The results from the Nvidia binary are a little all over the place with these
tests, most of the tests with arb_shading_language_420pack enabled fail but
if the GLSL version is changed to 4.20 they pass.
The only tests that pass with arb_shading_language_420pack enabled are the
global tests but that seems to be because they do not detect the duplicates
and fail the negative tests.

V2: fix version mismatch in location tests, and prefix variable with out
in global tests
---
 ...e-qualifier-in-single-declaration-420-pack.vert | 22 +
 ...ualifier-in-single-declaration-no-420-pack.vert | 21 
 ...n-qualifier-in-single-declaration-420-pack.vert | 33 +++
 ...ualifier-in-single-declaration-no-420-pack.vert | 32 ++
 ...iple-stream-in-single-declaration-420-pack.geom | 36 
 ...e-stream-in-single-declaration-no-420-pack.geom | 35 
 ...ream-in-single-global-declaration-420-pack.geom | 38 ++
 ...m-in-single-global-declaration-no-420-pack.geom | 37 +
 ...e-qualifier-in-single-declaration-420-pack.geom | 25 ++
 ...ualifier-in-single-declaration-no-420-pack.geom | 24 ++
 ...fier-in-single-global-declaration-420-pack.geom | 27 +++
 ...r-in-single-global-declaration-no-420-pack.geom | 37 +
 12 files changed, 367 insertions(+)
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-no-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-qualifier-in-single-declaration-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-qualifier-in-single-declaration-no-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-declaration-no-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-global-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-global-declaration-no-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-declaration-no-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-global-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-global-declaration-no-420-pack.geom

diff --git 
a/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
 
b/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
new file mode 100644
index 000..9551476
--- /dev/null
+++ 
b/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_separate_shader_objects 
GL_ARB_shading_language_420pack
+// check_link: false
+// [end config]
+//
+// From the ARB_shading_language_420pack spec:
+//
+//   "More than one layout qualifier may appear in a single declaration. If
+//   the same layout-qualifier-name occurs in multiple layout qualifiers for
+//   the same declaration, the last one overrides the former ones."
+
+#version 140
+#extension GL_ARB_separate_shader_objects : enable
+#extension GL_ARB_shading_language_420pack: enable
+
+layout(location=2) layout(location=1) out vec3 var;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_shading_la

Re: [Piglit] [PATCH] arb_shading_language_420pack: test multiple layout qualifiers on the same line

2016-01-13 Thread Ilia Mirkin
On Wed, Jan 13, 2016 at 11:48 PM, Timothy Arceri
 wrote:
> While the spec is taking about multiple layout qualifiers we interpert that
> to mean layout-qualifier-names can also occur multiple times within
> a single layout qualifier.
>
> In Section 4.4 (Layout Qualifiers) of the GLSL 4.40 spec it clarifies this:
>
>"More than one layout qualifier may appear in a single declaration.
>Additionally, the same layout-qualifier-name can occur multiple times
>within a layout qualifier or across multiple layout qualifiers in the
>same declaration"
>
> The results from the Nvidia binary are a little all over the place with these
> tests, most of the tests with arb_shading_language_420pack enabled fail but
> if the GLSL version is changed to 4.20 they pass.
> The only tests that pass with arb_shading_language_420pack enabled are the
> global tests but that seems to be because they not detect the duplicates
> and fail the negative tests.
> ---
>  ...e-qualifier-in-single-declaration-420-pack.vert | 22 +
>  ...ualifier-in-single-declaration-no-420-pack.vert | 21 
>  ...n-qualifier-in-single-declaration-420-pack.vert | 33 +++
>  ...ualifier-in-single-declaration-no-420-pack.vert | 32 ++
>  ...iple-stream-in-single-declaration-420-pack.geom | 36 
>  ...e-stream-in-single-declaration-no-420-pack.geom | 35 
>  ...ream-in-single-global-declaration-420-pack.geom | 38 
> ++
>  ...m-in-single-global-declaration-no-420-pack.geom | 37 +
>  ...e-qualifier-in-single-declaration-420-pack.geom | 25 ++
>  ...ualifier-in-single-declaration-no-420-pack.geom | 24 ++
>  ...fier-in-single-global-declaration-420-pack.geom | 27 +++
>  ...r-in-single-global-declaration-no-420-pack.geom | 37 +
>  12 files changed, 367 insertions(+)
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-no-420-pack.vert
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-qualifier-in-single-declaration-420-pack.vert
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-qualifier-in-single-declaration-no-420-pack.vert
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-declaration-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-declaration-no-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-global-declaration-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-global-declaration-no-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-declaration-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-declaration-no-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-global-declaration-420-pack.geom
>  create mode 100644 
> tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-global-declaration-no-420-pack.geom
>
> diff --git 
> a/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
>  
> b/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
> new file mode 100644
> index 000..10cb124
> --- /dev/null
> +++ 
> b/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_separate_shader_objects 
> GL_ARB_shading_language_420pack
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_shading_language_420pack spec:
> +//
> +//   "More than one layout qualifier may appear in a single declaration. If
> +//   the same layout-qualifier-name occurs in multiple layout qualifiers for
> +//   the same declaration, the last one overrides the former ones."
> +
> +#version 150

glsl_version is 140 above but 150 here. Please true these up. (Same
applies to the other test

[Piglit] [PATCH] arb_shading_language_420pack: test multiple layout qualifiers on the same line

2016-01-13 Thread Timothy Arceri
While the spec is taking about multiple layout qualifiers we interpert that
to mean layout-qualifier-names can also occur multiple times within
a single layout qualifier.

In Section 4.4 (Layout Qualifiers) of the GLSL 4.40 spec it clarifies this:

   "More than one layout qualifier may appear in a single declaration.
   Additionally, the same layout-qualifier-name can occur multiple times
   within a layout qualifier or across multiple layout qualifiers in the
   same declaration"

The results from the Nvidia binary are a little all over the place with these
tests, most of the tests with arb_shading_language_420pack enabled fail but
if the GLSL version is changed to 4.20 they pass.
The only tests that pass with arb_shading_language_420pack enabled are the
global tests but that seems to be because they not detect the duplicates
and fail the negative tests.
---
 ...e-qualifier-in-single-declaration-420-pack.vert | 22 +
 ...ualifier-in-single-declaration-no-420-pack.vert | 21 
 ...n-qualifier-in-single-declaration-420-pack.vert | 33 +++
 ...ualifier-in-single-declaration-no-420-pack.vert | 32 ++
 ...iple-stream-in-single-declaration-420-pack.geom | 36 
 ...e-stream-in-single-declaration-no-420-pack.geom | 35 
 ...ream-in-single-global-declaration-420-pack.geom | 38 ++
 ...m-in-single-global-declaration-no-420-pack.geom | 37 +
 ...e-qualifier-in-single-declaration-420-pack.geom | 25 ++
 ...ualifier-in-single-declaration-no-420-pack.geom | 24 ++
 ...fier-in-single-global-declaration-420-pack.geom | 27 +++
 ...r-in-single-global-declaration-no-420-pack.geom | 37 +
 12 files changed, 367 insertions(+)
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-no-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-qualifier-in-single-declaration-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-qualifier-in-single-declaration-no-420-pack.vert
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-declaration-no-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-global-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-in-single-global-declaration-no-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-declaration-no-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-global-declaration-420-pack.geom
 create mode 100644 
tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-stream-multiple-qualifier-in-single-global-declaration-no-420-pack.geom

diff --git 
a/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
 
b/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
new file mode 100644
index 000..10cb124
--- /dev/null
+++ 
b/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-declaration-420-pack.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_separate_shader_objects 
GL_ARB_shading_language_420pack
+// check_link: false
+// [end config]
+//
+// From the ARB_shading_language_420pack spec:
+//
+//   "More than one layout qualifier may appear in a single declaration. If
+//   the same layout-qualifier-name occurs in multiple layout qualifiers for
+//   the same declaration, the last one overrides the former ones."
+
+#version 150
+#extension GL_ARB_separate_shader_objects : enable
+#extension GL_ARB_shading_language_420pack: enable
+
+layout(location=2) layout(location=1) out vec3 var;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_shading_language_420pack/compiler/layout-qualifiers/multiple-location-multiple-qualifier-in-single-decl

Re: [Piglit] Ideas for testing ARB_shader_group_vote?

2016-01-13 Thread Ian Romanick
On 01/13/2016 02:23 PM, Matt Turner wrote:
> I think I've finished the implementation of ARB_shader_group_vote [1]

\o/

> for i965/fs [2], but I haven't come up with any ideas for testing it.
> 
> Please give me some ideas. :)

You could start with a couple simple sanity tests:

- Render a suitably aligned quad where every fragment reads a solid
color texture.  The result of the texture lookup is used for the vote
condition.  Something like allInvocationsARB(color == expected_color)
should be true.  A variation would read from the same location two
identical textures in each fragment.  allInvocationsARB(color1 ==
color2) should be true.

- Render a suitably aligned quad where every fragment reads from two
different textures that have no corresponding texels with the same
color.  allInvocationsARB(color1 == color2) and anyInvocationARB(color1
== color2) should be false.  allInvocationsEqualARB(color1 == color2)
should be true.

I think the really hard part of testing this extension is testing:

In groups where some invocations do not execute the function call,
the value returned by the function is not affected by any
invocation not calling the function, even when  is
well-defined for that invocation.

Maybe do the above tests but have half the fragments (in a checkerboard
pattern) either discard() or use flow-control to avoid the calls to
allInvocationsARB, etc.  In the fragments that avoid the calls, be sure
to munge the values so that, were the calls made, they would give the
"wrong" answer.

> [1] https://www.opengl.org/registry/specs/ARB/shader_group_vote.txt
> [2] git://people.freedesktop.org/~mattst88/mesa arb_shader_group_vote
> ___
> 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_viewport_array: add GL_ARB_gpu_shader5 requirement for render_viewport_2

2016-01-13 Thread Ilia Mirkin
Reviewed-by: Ilia Mirkin 

On Wed, Jan 13, 2016 at 7:21 PM,   wrote:
> From: Roland Scheidegger 
>
> The test cannot work without this (and thus always failed if not present).
> ---
>  tests/spec/arb_viewport_array/render_viewport_2.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/spec/arb_viewport_array/render_viewport_2.c 
> b/tests/spec/arb_viewport_array/render_viewport_2.c
> index 963709b..7e8360f 100644
> --- a/tests/spec/arb_viewport_array/render_viewport_2.c
> +++ b/tests/spec/arb_viewport_array/render_viewport_2.c
> @@ -152,6 +152,7 @@ piglit_init(int argc, char **argv)
> GLuint program;
> GLuint vao;
> piglit_require_extension("GL_ARB_viewport_array");
> +   piglit_require_extension("GL_ARB_gpu_shader5");
>
> program = piglit_build_simple_program_multiple_shaders(
> GL_VERTEX_SHADER, vsSource,
> --
> 2.1.4
>
> ___
> 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_viewport_array: add GL_ARB_gpu_shader5 requirement for render_viewport_2

2016-01-13 Thread sroland
From: Roland Scheidegger 

The test cannot work without this (and thus always failed if not present).
---
 tests/spec/arb_viewport_array/render_viewport_2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/arb_viewport_array/render_viewport_2.c 
b/tests/spec/arb_viewport_array/render_viewport_2.c
index 963709b..7e8360f 100644
--- a/tests/spec/arb_viewport_array/render_viewport_2.c
+++ b/tests/spec/arb_viewport_array/render_viewport_2.c
@@ -152,6 +152,7 @@ piglit_init(int argc, char **argv)
GLuint program;
GLuint vao;
piglit_require_extension("GL_ARB_viewport_array");
+   piglit_require_extension("GL_ARB_gpu_shader5");
 
program = piglit_build_simple_program_multiple_shaders(
GL_VERTEX_SHADER, vsSource,
-- 
2.1.4

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


[Piglit] [PATCH 1/2] shader_runner: add basic ssbo probing support

2016-01-13 Thread Ilia Mirkin
---
 tests/shaders/shader_runner.c | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index c00fd61..f176fdb 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2694,6 +2694,41 @@ probe_atomic_counter(GLint counter_num, const char *op, 
uint32_t value)
 return true;
 }
 
+static bool
+probe_ssbo_uint(GLint ssbo_offset, const char *op, uint32_t value)
+{
+uint32_t *p;
+   uint32_t observed;
+   enum comparison cmp;
+   bool result;
+
+   process_comparison(op, &cmp);
+
+   glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, ssbo);
+   p = glMapBufferRange(GL_SHADER_STORAGE_BUFFER, ssbo_offset,
+sizeof(uint32_t), GL_MAP_READ_BIT);
+
+if (!p) {
+printf("Couldn't map ssbo to verify expected value.\n");
+return false;
+}
+
+   observed = *p;
+   result = compare_uint(value, observed, cmp);
+
+   if (!result) {
+   printf("SSBO %d test failed: Reference %s Observed\n",
+  ssbo_offset, comparison_string(cmp));
+   printf("  Reference: %u\n", value);
+   printf("  Observed:  %u\n", observed);
+   glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
+   return false;
+}
+
+glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
+return true;
+}
+
 enum piglit_result
 piglit_display(void)
 {
@@ -2939,6 +2974,10 @@ piglit_display(void)
if (!probe_atomic_counter(x, s, y)) {
piglit_report_result(PIGLIT_FAIL);
}
+   } else if (sscanf(line, "probe ssbo uint %d %s %d",
+ &x, s, &y) == 3) {
+   if (!probe_ssbo_uint(x, s, y))
+   pass = false;
} else if (sscanf(line,
  "relative probe rgba ( %f , %f ) "
  "( %f , %f , %f , %f )",
-- 
2.4.10

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


[Piglit] [PATCH 2/2] ssbo: add basic write test to demo shader_runner feature

2016-01-13 Thread Ilia Mirkin
---
 .../execution/basic-write.shader_test  | 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 
tests/spec/arb_shader_storage_buffer_object/execution/basic-write.shader_test

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/basic-write.shader_test 
b/tests/spec/arb_shader_storage_buffer_object/execution/basic-write.shader_test
new file mode 100644
index 000..deab272
--- /dev/null
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/basic-write.shader_test
@@ -0,0 +1,31 @@
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_shader_storage_buffer_object: require
+
+layout (std430) buffer ssbo {
+  uint a[];
+};
+uniform uint v;
+
+void main() {
+   gl_FragColor = vec4(0, 1, 0, 1);
+   if (ivec2(gl_FragCoord.xy) == ivec2(0)) {
+  a[0] = uint(a.length());
+  a[1] = v;
+   }
+}
+
+[test]
+ssbo 8
+
+uniform uint v 10
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
+probe ssbo uint 0 == 2
+probe ssbo uint 4 == 10
-- 
2.4.10

___
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-13 Thread Ian Romanick
On 01/13/2016 01:34 PM, Dylan Baker wrote:
> I seem to remember this, it was nvidia I think, if that helps you look
> for the email.

Looking at old messages in the thread... it looks like this was fixed in
shader-runner in
http://cgit.freedesktop.org/piglit/commit/?id=2b94faec18dc1f8f0d9241ec731408959320cd7c.

> On Wed, Jan 13, 2016 at 11:39 AM, Ian Romanick  > wrote:
> 
> There is at least one bigger bug in this series, and fixing it will
> require changes to shader-runner too.  I had some e-mail either from one
> of the guys at VMware or one of the guys at NVIDIA, but I can't find it.
> 
> My recollection is that there is some case in the generator (and
> shader-runner in general) that expects non-base elements of arrays to be
> advertised, but the spec says they should not be advertised.  I think
> the case was that for a UBO like
> 
> struct S {
> int i;
> float f;
> };
> 
> uniform U {
> S s[4];
> };
> 
> only s[0].i and s[0].f would be reported, but shader-runner expects all
> elements of s[] to be reported.
> 
> This will be annoying to fix because shader-runner relies on this to
> determine the offsets s[1].i and friends.
> 
> It should be relatively easy to figure out what the failure case is.  I
> think there's already a test in piglit that misuses the feature, and
> that test fails on NVIDIA's closed-source driver.
> 
> On 01/12/2016 03: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
> mailto:baker.dyla...@gmail.com>> 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
> mailto:t_arc...@yahoo.com.au>>
> >> 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] Ideas for testing ARB_shader_group_vote?

2016-01-13 Thread Matt Turner
On Wed, Jan 13, 2016 at 2:23 PM, Matt Turner  wrote:
> I think I've finished the implementation of ARB_shader_group_vote [1]
> for i965/fs [2], but I haven't come up with any ideas for testing it.
>
> Please give me some ideas. :)
>
> [1] https://www.opengl.org/registry/specs/ARB/shader_group_vote.txt
> [2] git://people.freedesktop.org/~mattst88/mesa arb_shader_group_vote

Oh, and I should say that the real difficulty seems to be in figuring
out how to do this with invocations with multiple active subspans
(like in most SIMD8/SIMD16 invocations on i965).
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] Ideas for testing ARB_shader_group_vote?

2016-01-13 Thread Matt Turner
I think I've finished the implementation of ARB_shader_group_vote [1]
for i965/fs [2], but I haven't come up with any ideas for testing it.

Please give me some ideas. :)

[1] https://www.opengl.org/registry/specs/ARB/shader_group_vote.txt
[2] git://people.freedesktop.org/~mattst88/mesa arb_shader_group_vote
___
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-13 Thread Dylan Baker
I seem to remember this, it was nvidia I think, if that helps you look for
the email.

On Wed, Jan 13, 2016 at 11:39 AM, Ian Romanick  wrote:

> There is at least one bigger bug in this series, and fixing it will
> require changes to shader-runner too.  I had some e-mail either from one
> of the guys at VMware or one of the guys at NVIDIA, but I can't find it.
>
> My recollection is that there is some case in the generator (and
> shader-runner in general) that expects non-base elements of arrays to be
> advertised, but the spec says they should not be advertised.  I think
> the case was that for a UBO like
>
> struct S {
> int i;
> float f;
> };
>
> uniform U {
> S s[4];
> };
>
> only s[0].i and s[0].f would be reported, but shader-runner expects all
> elements of s[] to be reported.
>
> This will be annoying to fix because shader-runner relies on this to
> determine the offsets s[1].i and friends.
>
> It should be relatively easy to figure out what the failure case is.  I
> think there's already a test in piglit that misuses the feature, and
> that test fails on NVIDIA's closed-source driver.
>
> On 01/12/2016 03: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 0/5] Randomized UBO tests of doom

2016-01-13 Thread Ian Romanick
There is at least one bigger bug in this series, and fixing it will
require changes to shader-runner too.  I had some e-mail either from one
of the guys at VMware or one of the guys at NVIDIA, but I can't find it.

My recollection is that there is some case in the generator (and
shader-runner in general) that expects non-base elements of arrays to be
advertised, but the spec says they should not be advertised.  I think
the case was that for a UBO like

struct S {
int i;
float f;
};

uniform U {
S s[4];
};

only s[0].i and s[0].f would be reported, but shader-runner expects all
elements of s[] to be reported.

This will be annoying to fix because shader-runner relies on this to
determine the offsets s[1].i and friends.

It should be relatively easy to figure out what the failure case is.  I
think there's already a test in piglit that misuses the feature, and
that test fails on NVIDIA's closed-source driver.

On 01/12/2016 03: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


[Piglit] [PATCH 2/2 v2] arb_stencil_texturing: Verify that glBlitFramebuffer does not corrupt state

2016-01-13 Thread Ian Romanick
From: Ian Romanick 

I recently found (by inspection) that
glBlitFramebuffer(GL_STENCIL_BUFFER_BIT) from a GL_READ_FRAMEBUFFER with
a GL_TEXTURE_RECTANGLE target stencil texture would corrupt the
GL_DEPTH_STENCIL_TEXTURE_MODE.

NOTE: The GL_TEXTURE_RECTANGLE subtest fails on GEN8+.

v2: Remove all mention of GL_TEXTURE_3D.  Ilia pointed out that even
GL_STENCIL_INDEX is never allowed for GL_TEXTURE_3D targets.
GL_ARB_texture_stencil8 allows GL_STENCIL_INDEX8 with glTexImage3D only
for the array-like texture targets.

Signed-off-by: Ian Romanick 
---
 tests/all.py   |   7 +
 tests/spec/arb_stencil_texturing/CMakeLists.gl.txt |   1 +
 .../arb_stencil_texturing/blit_corrupts_state.c| 313 +
 3 files changed, 321 insertions(+)
 create mode 100644 tests/spec/arb_stencil_texturing/blit_corrupts_state.c

diff --git a/tests/all.py b/tests/all.py
index 9365bc3..31c9b75 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1829,6 +1829,13 @@ with profile.group_manager(
 grouptools.join('spec', 'ARB_stencil_texturing')) as g:
 g(['arb_stencil_texturing-draw'], 'draw')
 
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ARB_stencil_texturing', 'glBlitFramebuffer 
corrupts state')) as g:
+for t in ['1D', '2D', 'CUBE_MAP', '1D_ARRAY', '2D_ARRAY', 
'CUBE_MAP_ARRAY', '2D_MULTISAMPLE', '2D_MULTISAMPLE_ARRAY', 'RECTANGLE']:
+target = 'GL_TEXTURE_' + t
+g(['arb_stencil_texturing-blit_corrupts_state', target], target)
+
 # Group ARB_sync
 with profile.group_manager(
 PiglitGLTest, grouptools.join('spec', 'ARB_sync')) as g:
diff --git a/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt 
b/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt
index cb469b7..c9fb0ab 100644
--- a/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt
+++ b/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt
@@ -8,4 +8,5 @@ link_libraries (
${OPENGL_gl_LIBRARY}
 )
 
+piglit_add_executable (arb_stencil_texturing-blit_corrupts_state 
blit_corrupts_state.c)
 piglit_add_executable (arb_stencil_texturing-draw draw.c)
diff --git a/tests/spec/arb_stencil_texturing/blit_corrupts_state.c 
b/tests/spec/arb_stencil_texturing/blit_corrupts_state.c
new file mode 100644
index 000..5c84041
--- /dev/null
+++ b/tests/spec/arb_stencil_texturing/blit_corrupts_state.c
@@ -0,0 +1,313 @@
+/*
+ * Copyright © 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 (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 blit-corrupts-state.c
+ * Tests for a bug in glBlitFramebuffer corrupting 
GL_DEPTH_STENCIL_TEXTURE_MODE
+ *
+ * The default state for GL_DEPTH_STENCIL_TEXTURE_MODE is GL_DEPTH_COMPONENT.
+ * Create two GL_DEPTH_STENCIL textures and two framebuffer objects.  Attach
+ * one texture to each of the FBOs, and blit stencil from one to the other.
+ * After the blit operation verify that the state of
+ * GL_DEPTH_STENCIL_TEXTURE_MODE has not changed.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 30;
+   config.supports_gl_core_version = 31;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static bool
+check_texture_state(GLenum target, unsigned line)
+{
+   GLint value;
+
+   glGetTexParameteriv(target,
+   GL_DEPTH_STENCIL_TEXTURE_MODE,
+   &value);
+   if (value != GL_DEPTH_COMPONENT) {
+   printf("%s, %d: Expected GL_DEPTH_COMPONENT, got %s "
+  "(0x%04x).\n",
+  __func__, line,
+  piglit_get_gl_enum_name(value),
+  value);
+   return false;
+   }
+
+   return true;
+}
+
+static void
+setup_texture(GLenum target)
+{
+   /* All of the non-multisample targets should have the minification and
+* the magnification set to GL_NEAREST.  Setting the filters for

Re: [Piglit] [PATCH 2/2] arb_stencil_texturing: Verify that glBlitFramebuffer does not corrupt state

2016-01-13 Thread Ian Romanick
On 01/13/2016 09:02 AM, Ilia Mirkin wrote:
> On Wed, Jan 13, 2016 at 4:08 AM, Ian Romanick  wrote:
>> From: Ian Romanick 
>>
>> I recently found (by inspection) that
>> glBlitFramebuffer(GL_STENCIL_BUFFER_BIT) from a GL_READ_FRAMEBUFFER with
>> a GL_TEXTURE_RECTANGLE target stencil texture would corrupt the
>> GL_DEPTH_STENCIL_TEXTURE_MODE.
>>
>> I was not able to fully test the GL_TEXTURE_3D mode.  If I set
>> MESA_EXTENSION_OVERRIDE=+GL_ARB_texture_stencil8 to test 3D textures,
>> the test fails due to a GL error in glTexImage3D:
>>
>> Mesa: User error: GL_INVALID_OPERATION in glTexImage3D(bad target for 
>> depth texture)
> 
> I don't think 3D textures are ever legal for depth (and thus,
> presumably, stencil)... are they?

You are correct.  I saw in the "New Tokens" section of
GL_ARB_texture_stencil8 that GL_STENCIL_INDEX8 is accepted by
glTexImage3D, but I didn't check the set of targets.  glTexImage3D
accepts it only for cube maps and the various array texture targets.
I'll pull GL_TEXTURE_3D support out of the patch.  That will simplify
things a bit.

>   -ilia

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


Re: [Piglit] [PATCH 1/2] arb_stencil_texturing: Fix GL version requirements

2016-01-13 Thread Kenneth Graunke
On Wednesday, January 13, 2016 1:08:15 AM PST Ian Romanick wrote:
> From: Ian Romanick 
> 
> Realistically, the test needs OpenGL 3.0 because it requires GLSL 1.30.
> I doubt there will ever be a driver that can do GL_ARB_stencil_texturing
> that doesn't also support OpenGL 3.0.
> 
> Signed-off-by: Ian Romanick 

Reviewed-by: Kenneth Graunke 


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 2/2] arb_stencil_texturing: Verify that glBlitFramebuffer does not corrupt state

2016-01-13 Thread Ilia Mirkin
On Wed, Jan 13, 2016 at 4:08 AM, Ian Romanick  wrote:
> From: Ian Romanick 
>
> I recently found (by inspection) that
> glBlitFramebuffer(GL_STENCIL_BUFFER_BIT) from a GL_READ_FRAMEBUFFER with
> a GL_TEXTURE_RECTANGLE target stencil texture would corrupt the
> GL_DEPTH_STENCIL_TEXTURE_MODE.
>
> I was not able to fully test the GL_TEXTURE_3D mode.  If I set
> MESA_EXTENSION_OVERRIDE=+GL_ARB_texture_stencil8 to test 3D textures,
> the test fails due to a GL error in glTexImage3D:
>
> Mesa: User error: GL_INVALID_OPERATION in glTexImage3D(bad target for 
> depth texture)

I don't think 3D textures are ever legal for depth (and thus,
presumably, stencil)... are they?

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


[Piglit] [PATCH v3] EXT_multisampled_render_to_texture: functional test

2016-01-13 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)
v3: - GLES3 error code overrides extension error code.

Signed-off-by: Magnus Wendt 
---
 tests/all.py   |   9 +
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gles3.txt   |   7 +
 .../CMakeLists.txt |   1 +
 .../api-errors.c   | 287 
 .../ext_multisampled_render_to_texture/minmax.c|  58 
 .../ext_multisampled_render_to_texture/render.c| 366 +
 7 files changed, 729 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..69f515d
--- /dev/null
+++ b/tests/spec/ext_multisampled_render_to_texture/api-errors.c
@@ -0,0 +1,287 @@
+/*
+ * 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 

[Piglit] [PATCH 2/2] arb_stencil_texturing: Verify that glBlitFramebuffer does not corrupt state

2016-01-13 Thread Ian Romanick
From: Ian Romanick 

I recently found (by inspection) that
glBlitFramebuffer(GL_STENCIL_BUFFER_BIT) from a GL_READ_FRAMEBUFFER with
a GL_TEXTURE_RECTANGLE target stencil texture would corrupt the
GL_DEPTH_STENCIL_TEXTURE_MODE.

I was not able to fully test the GL_TEXTURE_3D mode.  If I set
MESA_EXTENSION_OVERRIDE=+GL_ARB_texture_stencil8 to test 3D textures,
the test fails due to a GL error in glTexImage3D:

Mesa: User error: GL_INVALID_OPERATION in glTexImage3D(bad target for depth 
texture)

Hopefully someone can test this on a different driver that properly
supports GL_ARB_texture_stencil8.

NOTE: The GL_TEXTURE_RECTANGLE subtest fails on GEN8+.

Signed-off-by: Ian Romanick 
---
 tests/all.py   |   7 +
 tests/spec/arb_stencil_texturing/CMakeLists.gl.txt |   1 +
 .../arb_stencil_texturing/blit_corrupts_state.c| 340 +
 3 files changed, 348 insertions(+)
 create mode 100644 tests/spec/arb_stencil_texturing/blit_corrupts_state.c

diff --git a/tests/all.py b/tests/all.py
index 9365bc3..f6a0ff5 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1829,6 +1829,13 @@ with profile.group_manager(
 grouptools.join('spec', 'ARB_stencil_texturing')) as g:
 g(['arb_stencil_texturing-draw'], 'draw')
 
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ARB_stencil_texturing', 'glBlitFramebuffer 
corrupts state')) as g:
+for t in ['1D', '2D', '3D', 'CUBE_MAP', '1D_ARRAY', '2D_ARRAY', 
'CUBE_MAP_ARRAY', '2D_MULTISAMPLE', '2D_MULTISAMPLE_ARRAY', 'RECTANGLE']:
+target = 'GL_TEXTURE_' + t
+g(['arb_stencil_texturing-blit_corrupts_state', target], target)
+
 # Group ARB_sync
 with profile.group_manager(
 PiglitGLTest, grouptools.join('spec', 'ARB_sync')) as g:
diff --git a/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt 
b/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt
index cb469b7..c9fb0ab 100644
--- a/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt
+++ b/tests/spec/arb_stencil_texturing/CMakeLists.gl.txt
@@ -8,4 +8,5 @@ link_libraries (
${OPENGL_gl_LIBRARY}
 )
 
+piglit_add_executable (arb_stencil_texturing-blit_corrupts_state 
blit_corrupts_state.c)
 piglit_add_executable (arb_stencil_texturing-draw draw.c)
diff --git a/tests/spec/arb_stencil_texturing/blit_corrupts_state.c 
b/tests/spec/arb_stencil_texturing/blit_corrupts_state.c
new file mode 100644
index 000..ea52ebb
--- /dev/null
+++ b/tests/spec/arb_stencil_texturing/blit_corrupts_state.c
@@ -0,0 +1,340 @@
+/*
+ * Copyright © 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 (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 blit-corrupts-state.c
+ * Tests for a bug in glBlitFramebuffer corrupting 
GL_DEPTH_STENCIL_TEXTURE_MODE
+ *
+ * The default state for GL_DEPTH_STENCIL_TEXTURE_MODE is GL_DEPTH_COMPONENT.
+ * Create two GL_DEPTH_STENCIL textures and two framebuffer objects.  Attach
+ * one texture to each of the FBOs, and blit stencil from one to the other.
+ * After the blit operation verify that the state of
+ * GL_DEPTH_STENCIL_TEXTURE_MODE has not changed.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 30;
+   config.supports_gl_core_version = 31;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static bool
+check_texture_state(GLenum target, unsigned line)
+{
+   GLint value;
+
+   glGetTexParameteriv(target,
+   GL_DEPTH_STENCIL_TEXTURE_MODE,
+   &value);
+   if (value != GL_DEPTH_COMPONENT) {
+   printf("%s, %d: Expected GL_DEPTH_COMPONENT, got %s "
+  "(0x%04x).\n",
+  __func__, line,
+  piglit_get_gl_enum_name(value),
+  value);
+   return false;
+   }
+
+   return true;
+}
+
+static void
+setup_texture(GLenum target)
+{
+ 

[Piglit] [PATCH 1/2] arb_stencil_texturing: Fix GL version requirements

2016-01-13 Thread Ian Romanick
From: Ian Romanick 

Realistically, the test needs OpenGL 3.0 because it requires GLSL 1.30.
I doubt there will ever be a driver that can do GL_ARB_stencil_texturing
that doesn't also support OpenGL 3.0.

Signed-off-by: Ian Romanick 
Cc: Kenneth Graunke 
---
 tests/spec/arb_stencil_texturing/draw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/spec/arb_stencil_texturing/draw.c 
b/tests/spec/arb_stencil_texturing/draw.c
index 184c105..fa6ea42 100644
--- a/tests/spec/arb_stencil_texturing/draw.c
+++ b/tests/spec/arb_stencil_texturing/draw.c
@@ -52,7 +52,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 20;
+   config.supports_gl_compat_version = 30;
config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
config.window_width = 256 * 2 + 3;
config.window_height = 256 * 2 + 3;
@@ -271,7 +271,6 @@ void
 piglit_init(int argc, char **argv)
 {
piglit_require_extension("GL_ARB_stencil_texturing");
-   piglit_require_GLSL_version(130); /* for usampler2D */
 
setup_textures();
setup_shaders();
-- 
2.5.0

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