Re: [Piglit] [PATCH] generated_tests/builtin_function.py: fix running with python 3.x

2015-11-11 Thread Jan Vesely
On Wed, 2015-11-11 at 15:02 -0800, baker.dyla...@gmail.com wrote:
> From: Dylan Baker 
> 
> The current code works under python 2.7, but not python 3.x. This
> patch
> corrects that by making the code work for both.

Fixes the build for me.
Tested-by: Jan Vesely 

> 
> Signed-off-by: Dylan Baker 
> ---
>  generated_tests/builtin_function.py | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/generated_tests/builtin_function.py
> b/generated_tests/builtin_function.py
> index 40ef70f..b587851 100644
> --- a/generated_tests/builtin_function.py
> +++ b/generated_tests/builtin_function.py
> @@ -1281,7 +1281,8 @@ def
> _make_vector_or_matrix_test_vectors(test_suite_dict):
> floats+vecs+mats+ints+ivecs+uints+uvecs],
>template='{0};\n  result += {1}')
>  # This can generate an overflow warning, this is expected
> -with warnings.catch_warnings(RuntimeWarning):
> +with warnings.catch_warnings():
> +warnings.simplefilter('ignore', RuntimeWarning)
>  f('op-assign-sub', 2, 110,
>lambda x, y: x - y, match_assignment_operators,
>[floats+vecs+mats+ints+ivecs+uints+uvecs,
> @@ -1326,7 +1327,8 @@ def
> _make_vector_or_matrix_test_vectors(test_suite_dict):
> floats+vecs+mats+ints+ivecs+uints+uvecs],
>template='({0} + {1})')
>  # This can generate an overflow warning, this is expected
> -with warnings.catch_warnings(RuntimeWarning):
> +with warnings.catch_warnings():
> +warnings.simplefilter('ignore', RuntimeWarning)
>  f('op-sub', 2, 110, lambda x, y: x - y, match_simple_binop,
>[floats+vecs+mats+ints+ivecs+uints+uvecs,
> floats+vecs+mats+ints+ivecs+uints+uvecs],


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 3/6] arb_vertex_program: Remove unnecessary fragment programs.

2015-11-11 Thread Kenneth Graunke
On Tuesday, November 10, 2015 10:46:20 PM Matt Turner wrote:
> These just performed actions the fixed-function processing would have
> done. Removing them allows these tests to execute on hardware that
> supports ARB_vertex_program but not ARB_fragment_program (like R200).

Patches 3-6 are:
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/6] shader_runner: Don't call glDeleteProgram on an ARB program.

2015-11-11 Thread Kenneth Graunke
On Tuesday, November 10, 2015 10:46:19 PM Matt Turner wrote:
> I don't feel good about this check, but it is done elsewhere in the same
> file ("prog == 0").
> ---
>  tests/shaders/shader_runner.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 4597b46..bb17381 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3081,8 +3081,12 @@ piglit_display(void)
>   if (piglit_automatic) {
>   free_subroutine_uniforms();
>   /* Free our resources, useful for valgrinding. */
> - glDeleteProgram(prog);
> - glUseProgram(0);
> + if (prog != 0) {
> + glDeleteProgram(prog);
> + glUseProgram(0);
> + } else {
> + glDeleteProgramsARB(1, &prog);
> + }
>   }
>  
>   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> 

Wow.  Nasty.

Both link_and_use_shaders() [GLSL] and compile_and_bind_program() [ARB]
set prog to a non-zero value.  So at first glance this seems utterly bunk.
However, compile_and_bind_program() creates a local "GLuint prog" variable
that shadows the global one, so it never actually sets this.  Heh.

I was about to say this was correct.

However, I don't see anything actually initializing the global prog
variable to 0...so won't this be using an uninitialized value?  (As
would the existing code you patterned this after?)


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 1/6] shader_runner: Check feature support before querying GL_MAX_*.

2015-11-11 Thread Kenneth Graunke
On Tuesday, November 10, 2015 10:46:18 PM Matt Turner wrote:
> Otherwise, these will generate an error (to be noticed sometime later
> when glGetError() is called), often resulting in a test failure.
> ---
>  tests/shaders/shader_runner.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 32ac7bd..4597b46 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
>   if (piglit_get_gl_version() >= 32)
>   glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
> &gl_max_vertex_output_components);
> - glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> -   &gl_max_fragment_uniform_components);
> - glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> -   &gl_max_vertex_uniform_components);
> - glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> -   &gl_max_varying_components);
> + if (piglit_get_gl_version() >= 20 ||
> + piglit_is_extension_supported("GL_ARB_fragment_shader"))
> + glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> +   &gl_max_fragment_uniform_components);
> + if (piglit_get_gl_version() >= 20 ||
> + piglit_is_extension_supported("GL_ARB_vertex_shader"))
> + glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> +   &gl_max_vertex_uniform_components);

Above this, we call piglit_require_GLSL()...it seems like that
ought to be causing us to skip in this case.  Maybe we don't
return early enough?

There's also piglit_require_vertex_shader() and
piglit_require_fragment_shader() if those are useful to you...

> + if (piglit_get_gl_version() >= 30 ||
> + piglit_is_extension_supported("GL_EXT_geometry_shader4"))
> + glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> +   &gl_max_varying_components);

There's also GL_ARB_geometry_shader4, which introduces this.

>   glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max_clip_planes);
>  #else
>   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS,
> 


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 00/11] OpenGL fast skipping for native tests.

2015-11-11 Thread Dylan Baker
bump

On Thu, Nov 05, 2015 at 02:16:38PM -0800, baker.dyla...@gmail.com wrote:
> From: Dylan Baker 
> 
> One of the problems with piglit is the runtime, especially on older
> platforms where large numbers of tests skip. The average runtime on HSW
> for a shader_runner test that skips is about .05 seconds. This seems
> pretty small, until one considers that there are ~3000 skipping shader
> tests, and that number will only grow as more feature are added to
> piglit.
> 
> This patch implements a Mixin class for Test derived classes that
> implements skipping based on OpenGL and OpenGL ES extensions, version,
> and shader language version. It relies on wflinfo for this information,
> but will fall back if wflinfo isn't available.
> 
> This mixin is provided to ShaderTest and GLSLParserTest, which already
> have this information readily available to them (or can easily gather
> it), and improves their run time on all platforms substantially.
> 
> On g965, this reduced piglit runtime for gpu.py by roughly 25%, using
> '-c' with two cores.
> 
> Patches 1-2: My global options series which has been on the list,
>  I'll likely merge that soon unless there are objections
> Patch 3: Fixes a bug in one of the test generators
> 
> The remaining patches implement the fast skipping feature.
> 
> The design of this mixin is conservative. I would prefer to run a few
> tests that could be skipped, but never skip one that could be run than
> the opposite.
> 
> It might also be worth having (though it is no way required) my patch to
> update glslparser to know about GLES 3.1 and GLES 3.2, since without it
> one test (at least for me) will go from fail to skip.
> 
> Dylan Baker (11):
>   framework: make options a global variable.
>   framework: Convert the codebase to use the new global Options
>   gen_builtin_uniform_tests.py: Add extensions to require section
>   framework/test/opengl.py: Add FastSkipMixin which checks extensions
>   framework/test/opengl.py: add support for GL(ES) version skipping.
>   framework/test/opengl.py: Add GLSL and GLSL ES fast skipping
>   framework/test/shader_test.py: Add fast skipping support for
> extensions
>   framework/test/shader_test.py: add GL and GLES version fast skipping.
>   framework/test/shader_test.py: add GLSL (ES) based skipping.
>   framework/test/glsl_parser_test.py: Add requirement based fast
> skipping
>   framework/test/glsl_parser_test.py: add support for GLSL (ES) based
> skipping.
> 
>  framework/backends/abstract.py   |  16 +-
>  framework/core.py|  50 
>  framework/options.py | 185 +
>  framework/profile.py |  55 ++--
>  framework/programs/run.py|  62 ++---
>  framework/test/base.py   |  14 +-
>  framework/test/gleantest.py  |   6 +-
>  framework/test/glsl_parser_test.py   |  20 +-
>  framework/test/opengl.py | 338 +++
>  framework/test/piglit_test.py|   4 +-
>  framework/test/shader_test.py| 104 +--
>  framework/tests/backends_tests.py|   8 +-
>  framework/tests/base_tests.py|  43 ++-
>  framework/tests/core_tests.py|  27 +-
>  framework/tests/gleantest_tests.py   |  17 +-
>  framework/tests/glsl_parser_test_tests.py|  75 -
>  framework/tests/json_tests.py|   8 +-
>  framework/tests/opengl_tests.py  | 399 
> +++
>  framework/tests/options_tests.py | 178 
>  framework/tests/piglit_test_tests.py |  26 +-
>  framework/tests/profile_tests.py |  33 ++-
>  framework/tests/shader_test_tests.py | 117 
>  generated_tests/gen_builtin_uniform_tests.py |   2 +
>  piglit-print-commands.py |  12 +-
>  tests/igt.py |   6 +-
>  tests/xts.py |   2 +-
>  tox.ini  |   4 +-
>  27 files changed, 1555 insertions(+), 256 deletions(-)
>  create mode 100644 framework/options.py
>  create mode 100644 framework/test/opengl.py
>  create mode 100644 framework/tests/opengl_tests.py
>  create mode 100644 framework/tests/options_tests.py
> 
> -- 
> 2.6.2
> 


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


[Piglit] [PATCH] generated_tests/builtin_function.py: fix running with python 3.x

2015-11-11 Thread baker . dylan . c
From: Dylan Baker 

The current code works under python 2.7, but not python 3.x. This patch
corrects that by making the code work for both.

Signed-off-by: Dylan Baker 
---
 generated_tests/builtin_function.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/generated_tests/builtin_function.py 
b/generated_tests/builtin_function.py
index 40ef70f..b587851 100644
--- a/generated_tests/builtin_function.py
+++ b/generated_tests/builtin_function.py
@@ -1281,7 +1281,8 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict):
floats+vecs+mats+ints+ivecs+uints+uvecs],
   template='{0};\n  result += {1}')
 # This can generate an overflow warning, this is expected
-with warnings.catch_warnings(RuntimeWarning):
+with warnings.catch_warnings():
+warnings.simplefilter('ignore', RuntimeWarning)
 f('op-assign-sub', 2, 110,
   lambda x, y: x - y, match_assignment_operators,
   [floats+vecs+mats+ints+ivecs+uints+uvecs,
@@ -1326,7 +1327,8 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict):
floats+vecs+mats+ints+ivecs+uints+uvecs],
   template='({0} + {1})')
 # This can generate an overflow warning, this is expected
-with warnings.catch_warnings(RuntimeWarning):
+with warnings.catch_warnings():
+warnings.simplefilter('ignore', RuntimeWarning)
 f('op-sub', 2, 110, lambda x, y: x - y, match_simple_binop,
   [floats+vecs+mats+ints+ivecs+uints+uvecs,
floats+vecs+mats+ints+ivecs+uints+uvecs],
-- 
2.6.2

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


[Piglit] [PATCH 5/7] arb_enhanced_layouts: test component qualifier for overlaps

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../compiler/component-layout/overlap-double.vert  | 31 ++
 .../compiler/component-layout/overlap-illegal.vert | 32 +++
 .../compiler/component-layout/overlap-legal.vert   | 47 ++
 3 files changed, 110 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-legal.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert
new file mode 100644
index 000..255ecdf
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert
@@ -0,0 +1,31 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Location aliasing is causing two variables or block members to have the
+//   same location number. Component aliasing is assigning the same (or
+//   overlapping) component numbers for two location aliases. (Recall if
+//   component is not used, components are assigned starting with 0.) With one
+//   exception, location aliasing is allowed only if it does not cause
+//   component aliasing; it is a compile-time or link-time error to cause
+//   component aliasing."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y components
+layout(location = 7, component = 0) out double a;
+
+// consumes Y component
+layout(location = 7, component = 1) out float b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
new file mode 100644
index 000..d7d15e6
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
@@ -0,0 +1,32 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Location aliasing is causing two variables or block members to have the
+//   same location number. Component aliasing is assigning the same (or
+//   overlapping) component numbers for two location aliases. (Recall if
+//   component is not used, components are assigned starting with 0.) With one
+//   exception, location aliasing is allowed only if it does not cause
+//   component aliasing; it is a compile-time or link-time error to cause
+//   component aliasing."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume Y/Z/W components
+layout(location = 0, component = 1) out vec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+  a = vec3(1.0);
+  b = 0.0;
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-legal.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-legal.vert
new file mode 100644
index 000..adcbe19
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-legal.vert
@@ -0,0 +1,47 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Location aliasing is causing two variables or block members to have the
+//   same location number. Component aliasing is assigning the same (or
+//   overlapping) component numbers for two location aliases. (Recall if
+//   component is not used, components are assigned starting with 0.) With one
+//   exception, location aliasing is allowed only if it does not cause
+//   component aliasing; it is a compile-time or link-time error to cause
+//   component aliasing."
+//
+//   ...
+//
+//   "The one exception where component aliasing is permitted is for two input
+//   variables (not block members) to a vertex shader, which are allowed to
+//   have component aliasing. This vertex-variable component aliasing is
+//   intended only to support vertex shaders where each execution path
+//   accesses at most one input per each aliased component.  Implementations
+//   are permitted, but not required, to generate link-time errors if they
+//   detect that every path through the verte

[Piglit] [PATCH 7/7] arb_enhanced_layouts: add linking tests for component layout qualifier

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../intrastage-vs-mismatch.shader_test | 43 +
 .../component-layout/intrastage-vs.shader_test | 43 +
 .../component-layout/vs-to-fs-mismatch.shader_test | 45 ++
 .../linker/component-layout/vs-to-fs.shader_test   | 45 ++
 4 files changed, 176 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test

diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
new file mode 100644
index 000..08c1d99
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
@@ -0,0 +1,43 @@
+# This test verifies that a link error is generated if intrastage
+# component qualifiers don't match.
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume Y/Z/W components of 32 vectors
+layout(location = 0, component = 1) out vec3 a[32];
+
+// consumes X component of first vector
+layout(location = 0, component = 0) out float b;
+
+void f()
+{
+  a[3] = vec3(0.0);
+  b = float(1.0);
+}
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+  a[0] = vec3(1.0);
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
new file mode 100644
index 000..0f0a770
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
@@ -0,0 +1,43 @@
+# This test verifies that a no error is generated if intrastage
+# component qualifiers match.
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void f()
+{
+  a[3] = vec3(0.0);
+  b = float(1.0);
+}
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+  a[0] = vec3(1.0);
+}
+
+[test]
+link success
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
new file mode 100644
index 000..d61c6c6
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
@@ -0,0 +1,45 @@
+# Test for link error between vertex and fragment shaders when
+# component qualifiers don't match.
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+  a[0] = vec3(1.0);
+  b = float(0.5);
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consume Y/Z/W components of 32 vectors
+layout(location = 0, component = 1) in vec3 a[32];
+
+// consumes X component of first vector
+layout(location = 0, component = 0) in float b;
+
+void main()
+{
+  color = vec4(b, a[0]);
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test
new file mode 100644
index 000..c1d71e8
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shade

[Piglit] [PATCH 6/7] arb_enhanced_layouts: test mismatching component types

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../type-mismatch-signed-float-illegal.vert| 28 +++
 .../type-mismatch-signed-float.vert| 58 ++
 .../type-mismatch-signed-unsigned-illegal.vert | 28 +++
 .../type-mismatch-signed-unsigned.vert | 57 +
 .../type-mismatch-unsigned-float-illegal.vert  | 28 +++
 .../type-mismatch-unsigned-float.vert  | 57 +
 6 files changed, 256 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-illegal.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-unsigned-float-illegal.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-unsigned-float.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
new file mode 100644
index 000..4464b51
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Further, when location aliasing, the aliases sharing the location must
+//   have the same underlying numerical type (floating-point or integer) and
+//   the same auxiliary storage and interpolation qualification"
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components
+layout(location = 0) out ivec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+  a = ivec3(0);
+  b = 1.0;
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float.vert
new file mode 100644
index 000..2a46aa2
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float.vert
@@ -0,0 +1,58 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Further, when location aliasing, the aliases sharing the location must
+//   have the same underlying numerical type (floating-point or integer) and
+//   the same auxiliary storage and interpolation qualification"
+//
+//   ...
+//
+//   "The one exception where component aliasing is permitted is for two input
+//   variables (not block members) to a vertex shader, which are allowed to
+//   have component aliasing. This vertex-variable component aliasing is
+//   intended only to support vertex shaders where each execution path
+//   accesses at most one input per each aliased component.  Implementations
+//   are permitted, but not required, to generate link-time errors if they
+//   detect that every path through the vertex shader executable accesses
+//   multiple inputs aliased to any single component."
+//
+//   Issue 16 from the ARB_enhanced_layouts spec:
+//
+//   "We do allow this for vertex shader inputs, because we've supported
+//   "aliasing" behavior since OpenGL 2.0. This allows for an "uber-shader"
+//with variables like:
+//
+//  layout(location=3) in float var1;
+//  layout(location=3) in int var2;
+//
+//   where sometimes it uses  and sometimes .  Since we don't
+//   treat the code above (with overlapping components) as an error, it
+//   would be strange to treat non-overlapping component assignments as an
+//   error."
+
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+uniform int i;
+
+// consume X/Y/Z components
+layout(location = 0) in ivec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) in float b;
+
+void main()
+{
+  if (i == 1)
+gl_Position = vec4(a, 1.0);
+  else
+gl_Position = vec4(b);
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-illegal.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-ille

[Piglit] [PATCH 4/7] arb_enhanced_layouts: test component qualifier for overflows

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../compiler/component-layout/overflow-double.vert | 24 ++
 .../compiler/component-layout/overflow-dvec2.vert  | 24 ++
 .../compiler/component-layout/overflow-vec2.vert   | 21 +++
 .../compiler/component-layout/overflow-vec3.vert   | 21 +++
 .../compiler/component-layout/overflow-vec4.vert   | 21 +++
 .../compiler/component-layout/overflow.vert| 22 
 6 files changed, 133 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-double.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-dvec2.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec2.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec3.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec4.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-double.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-double.vert
new file mode 100644
index 000..da60aa3
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-double.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "A variable or block member starting at component N will consume
+//   components N, N+1, N+2, ... up through its size. It is a compile-time
+//   error if this sequence of components gets larger than 3. A scalar double
+//   will consume two of these components, and a dvec2 will consume all four
+//   components available within a location."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 3) out double b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-dvec2.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-dvec2.vert
new file mode 100644
index 000..baa0575
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-dvec2.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "A variable or block member starting at component N will consume
+//   components N, N+1, N+2, ... up through its size. It is a compile-time
+//   error if this sequence of components gets larger than 3. A scalar double
+//   will consume two of these components, and a dvec2 will consume all four
+//   components available within a location."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 2) out dvec2 b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec2.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec2.vert
new file mode 100644
index 000..c139a1b
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec2.vert
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "A variable or block member starting at component N will consume
+//   components N, N+1, N+2, ... up through its size. It is a compile-time
+//   error if this sequence of components gets larger than 3."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 3) out vec2 b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec3.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec3.vert
new file mode 100644
index 000..dd51850
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overflow-vec3.vert
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//

[Piglit] [PATCH 3/7] arb_enhanced_layouts: test invalid types to use component qualifier with

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../compiler/component-layout/block-array.frag | 22 +++
 .../compiler/component-layout/block.frag   | 23 
 .../compiler/component-layout/matrix-array.vert| 20 +
 .../compiler/component-layout/matrix.vert  | 20 +
 .../compiler/component-layout/struct-array.frag| 25 ++
 .../compiler/component-layout/struct.frag  | 25 ++
 6 files changed, 135 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/struct-array.frag
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/struct.frag

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag
new file mode 100644
index 000..423089b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 1, component = 0) in block {
+   float f;
+} name[2];
+
+float foo(void) {
+   return name[0].f;
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag
new file mode 100644
index 000..3802009
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 1, component = 0) in block {
+   float f;
+};
+
+float foo(void) {
+   return f;
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert
new file mode 100644
index 000..2ef8aa2
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 1) out mat3 a[32];
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert
new file mode 100644
index 000..6569a02
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 1) out mat3 a;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct-array.frag 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/struc

[Piglit] [PATCH 1/7] arb_enhanced_layouts: add basic component qualifier tests

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../compiler/component-layout/basic.vert   | 20 ++
 .../compiler/component-layout/block-member.frag| 23 +
 .../compiler/component-layout/interleaved.vert | 20 ++
 .../compiler/component-layout/no-location.vert | 24 ++
 4 files changed, 87 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert
new file mode 100644
index 000..74ca27b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y/Z components
+layout(location = 0) in vec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) in float b;
+
+void main()
+{
+  gl_Position = vec4(a, b);
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag
new file mode 100644
index 000..6dea3af
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Of these, variables and block members (but not blocks) additionally
+//   allow the component layout qualifier."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+#extension GL_ARB_separate_shader_objects: require
+
+in block {
+   layout(location = 1, component = 3) float f;
+};
+
+float foo(void) {
+   return f;
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert
new file mode 100644
index 000..f150353
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consumes W component of 32 vectors
+layout(location = 0, component = 3) in float a[32];
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) in vec3 b[32];
+
+void main()
+{
+  gl_Position = vec4(a[0], b[31]);
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert
new file mode 100644
index 000..64d75ed
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to use component without also specifying the
+//location qualifier (order does not matter)."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+layout(location = 0) in vec3 a;
+
+// no location
+layout(component = 3) in float b;
+
+void main()
+{
+  gl_Position = vec4(a, b);
+}
-- 
2.4.3

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


[Piglit] [PATCH 2/7] arb_enhanced_layouts: add basic component qualifier tests for doubles

2015-11-11 Thread Timothy Arceri
From: Timothy Arceri 

---
 .../component-layout/double-component-1.vert   | 21 +
 .../component-layout/double-component-3.vert   | 21 +
 .../compiler/component-layout/dvec2.vert   | 22 ++
 .../compiler/component-layout/dvec3.vert   | 20 
 .../compiler/component-layout/dvec4.vert   | 20 
 5 files changed, 104 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
new file mode 100644
index 000..c8da165
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to use component 1 or 3 as the beginning of a
+//   double or dvec2."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 1) out double b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
new file mode 100644
index 000..d054cd2
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to use component 1 or 3 as the beginning of a
+//   double or dvec2."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 3) out dvec2 b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert
new file mode 100644
index 000..090aac0
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "A scalar double will consume two of these components, and a dvec2 will
+//   consume all four components available within a location. A dvec3 or dvec4
+//   can only be declared without specifying a component."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 0) out dvec2 b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
new file mode 100644
index 000..1927658
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "A dvec3 or dvec4 can only be declared without specifying a component."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 1) out dvec3 b;
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
new file mode 100644
index 000..3558417
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
@@ -0,0 +1

[Piglit] [PATCH] framework: handle crash codes like piglit native tests

2015-11-11 Thread baker . dylan . c
From: Dylan Baker 

This changes the behavior of the dEQP integration such that a status
that is < 0 on unix or (< 0 || == 3) on windows will be a crash rather
than a fail. A status > 0 (except 3 on windows) will still be marked
fail.

This makes use of the helper function from framework/test/base.py
rather than calling super() (which would still call the helper) because
we don't want to get the warn status that we would also inherit.

cc: Jason Ekstrand 
Signed-off-by: Dylan Baker 
---
 framework/test/base.py|  5 ++--
 framework/test/deqp.py| 24 +++-
 framework/tests/deqp_tests.py | 53 ++-
 3 files changed, 53 insertions(+), 29 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index bf00396..e130ec5 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -47,6 +47,7 @@ __all__ = [
 'TestRunError',
 'ValgrindMixin',
 'WindowResizeMixin',
+'is_crash_returncode',
 ]
 
 
@@ -112,7 +113,7 @@ class ProcessTimeout(threading.Thread):
 return self.status
 
 
-def _is_crash_returncode(returncode):
+def is_crash_returncode(returncode):
 """Determine whether the given process return code correspond to a
 crash.
 """
@@ -204,7 +205,7 @@ class Test(object):
 def interpret_result(self):
 """Convert the raw output of the test into a form piglit understands.
 """
-if _is_crash_returncode(self.result.returncode):
+if is_crash_returncode(self.result.returncode):
 # check if the process was terminated by the timeout
 if self.timeout > 0 and self.__proc_timeout.join() > 0:
 self.result.result = 'timeout'
diff --git a/framework/test/deqp.py b/framework/test/deqp.py
index 8290faf..0107e2b 100644
--- a/framework/test/deqp.py
+++ b/framework/test/deqp.py
@@ -24,7 +24,8 @@ import subprocess
 
 # Piglit modules
 from framework import core, grouptools, exceptions
-from framework.profile import Test, TestProfile
+from framework.profile import TestProfile
+from framework.test.base import Test, is_crash_returncode
 
 __all__ = [
 'DEQPBaseTest',
@@ -142,16 +143,17 @@ class DEQPBaseTest(Test):
 return command + self.extra_args
 
 def interpret_result(self):
-if self.result.returncode != 0:
+if is_crash_returncode(self.result.returncode):
+self.result.result = 'crash'
+elif self.result.returncode != 0:
 self.result.result = 'fail'
-return
-
-for line in self.result.out.split('\n'):
-line = line.lstrip()
-for k, v in self.__RESULT_MAP.iteritems():
-if line.startswith(k):
-self.result.result = v
-return
+else:
+for line in self.result.out.split('\n'):
+line = line.lstrip()
+for k, v in self.__RESULT_MAP.iteritems():
+if line.startswith(k):
+self.result.result = v
 
 # We failed to parse the test output. Fallback to 'fail'.
-self.result.result = 'fail'
+if self.result.result == 'notrun':
+self.result.result = 'fail'
diff --git a/framework/tests/deqp_tests.py b/framework/tests/deqp_tests.py
index d9327ec..6acf7e9 100644
--- a/framework/tests/deqp_tests.py
+++ b/framework/tests/deqp_tests.py
@@ -25,6 +25,9 @@ tests
 
 """
 
+from __future__ import absolute_import, division, print_function
+
+import mock
 import nose.tools as nt
 
 from framework import profile, grouptools, exceptions
@@ -137,25 +140,43 @@ def test_DEQPBaseTest_command():
 nt.eq_(test.command[-1], 'extra')
 
 
-def test_DEQPBaseTest_interpret_result_returncode():
-"""deqp.DEQPBaseTest.interpret_result: if returncode is not 0 result is 
fail
-"""
-test = _DEQPTestTest('a.deqp.test')
-test.result.returncode = 1
-test.interpret_result()
-
-nt.eq_(test.result.result, 'fail')
+class TestDEQPBaseTestInterpretResult(object):
+"""Tests for DEQPBaseTest.interpret_result.
 
+This specifically tests the part that searches stdout.
 
-def test_DEQPBaseTest_interpret_result_fallthrough():
-"""deqp.DEQPBaseTest.interpret_result: if no case is hit set to fail
 """
-test = _DEQPTestTest('a.deqp.test')
-test.result.returncode = 0
-test.result.out = ''
-test.interpret_result()
-
-nt.eq_(test.result.result, 'fail')
+def __init__(self):
+self.test = None
+
+def setup(self):
+self.test = _DEQPTestTest('a.deqp.test')
+
+def test_crash(self):
+"""deqp.DEQPBaseTest.interpret_result: if returncode is < 0 stauts is 
crash"""
+self.test.result.returncode = -9
+self.test.interpret_result()
+nt.eq_(self.test.result.result, 'crash')
+
+def test_returncode_fail(self):
+"""deqp.DEQPBaseTest.interpret_result: if returncode is > 0 result is 
fail"""
+self.test.re

Re: [Piglit] [PATCH v3 5/5] arb-enhanced-layouts: explicit-offset: add linker test

2015-11-11 Thread Timothy Arceri
On Wed, 2015-11-11 at 18:14 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Check if the linker throws an error when the offset across two
> identically named blocks' members are not the same.
> 
> v2:
>  - Rework into intra- and interstage tests (Tim).
>  - Tweak shader comment (wrong ...)
> 
> Signed-off-by: Emil Velikov 

These look better now thanks.

Reviewed-by: Timothy Arceri 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v3 4/5] arb-enhanced-layouts: explicit-offset: test offset wrt (self) alignment

2015-11-11 Thread Timothy Arceri
On Wed, 2015-11-11 at 18:14 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> As per the spec hunk:
>"The specified offset must be a
>multiple of the base alignment of the type of the block member it
>qualifies, or a compile-time error results."
> 
> v2:
>  - Fix typo - enhanced-layout > enhanced-layouts
>  - Prefix uniform tests with ubo
>  - Add ssbo equivalent tests
>  - Quote the correct spec hunk in commit msg
> 
> v3:
>  - Remove trailing whitespace (Tim)
>  - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
>  - Change check_link to true to match below test results (Tim)

Again I think you had this right the first time, the spec clearly says compile
-time error. Sorry for the confusion.

> 
> Test results (Tim):
> Nvidia GeForce 840M - NVIDIA 352.41: pass
> 
> Signed-off-by: Emil Velikov 
> ---
>  .../ssbo-offset-multiple-of-base-member-align.vert | 27
> ++
>  .../ubo-offset-multiple-of-base-member-align.vert  | 26
> +
>  2 files changed, 53 insertions(+)
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-offset-multiple-of-base-member-align.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-offset-multiple-of-base-member-align.vert
> 
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -offset-multiple-of-base-member-align.vert
> b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-offset
> -multiple-of-base-member-align.vert
> new file mode 100644
> index 000..231d445
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-offset
> -multiple-of-base-member-align.vert
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_enhanced_layouts
> GL_ARB_shader_storage_buffer_object
> +// check_link: true
> +// [end config]
> +//
> +// ARB_enhanced_layouts spec says:
> +//"The specified offset must be a
> +//multiple of the base alignment of the type of the block member it
> +//qualifies, or a compile-time error results."
> +//
> +// Tests for successful compilation, when the block is of std140 layout.
> +//
> +
> +#version 140
> +#extension GL_ARB_enhanced_layouts : enable
> +#extension GL_ARB_shader_storage_buffer_object : enable
> +
> +layout(std430) buffer b {
> +   layout(offset = 0) float f1;
> +   layout(offset = 2) float f2; // Wrong: offset must be aligned to


I think this should be:

layout(offset = 6) float f2;

Otherwise the test could pass because the offset lies within the previous
member of the block not because the alignment is wrong.

Same goes for UBOs.

With these changes and removing the link time check.

Reviewed-by: Timothy Arceri 


> multiple of sizeof(float)
> +};
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo
> -offset-multiple-of-base-member-align.vert
> b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-offset
> -multiple-of-base-member-align.vert
> new file mode 100644
> index 000..60a9705
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-offset
> -multiple-of-base-member-align.vert
> @@ -0,0 +1,26 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_enhanced_layouts
> +// check_link: true
> +// [end config]
> +//
> +// ARB_enhanced_layouts spec says:
> +//"The specified offset must be a
> +//multiple of the base alignment of the type of the block member it
> +//qualifies, or a compile-time error results."
> +//
> +// Tests for successful compilation, when the block is of std140 layout.
> +//
> +
> +#version 140
> +#extension GL_ARB_enhanced_layouts : enable
> +
> +layout(std140) uniform block {
> +   layout(offset = 0) float f1;
> +   layout(offset = 2) float f2; // Wrong: offset must be aligned to
> multiple of sizeof(float)
> +};
> +
> +void main()
> +{
> +}
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v3 3/5] arb-enhanced-layouts: explicit-offset: relative offset values

2015-11-11 Thread Timothy Arceri
On Wed, 2015-11-11 at 18:14 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Check if one member is (attempted to be) positioned on top of another,
> and that the assigned offset(s) increase naturally.
> 
> v2:
>  - Fix typo - enhanced-layout > enhanced-layouts
>  - Prefix uniform tests with ubo
>  - Add ssbo equivalent tests
> 
> v3:
>  - Remove trailing whitespace (Tim)
>  - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
>  - Tweak glsl shader comment (Tim)
>  - Drop XXX and Note(s) (Tim)
>  - Change check_link to true to match below test results (Tim)

Hi Emil,

I thought we agreed this should be left as false? As you pointed out the spec
clearly says this is a compile-time error. You can note in the commit message
that this fails on Nvidia as its checking for the error at link time rather
than compile-time.

With this changed back:
Reviewed-by: Timothy Arceri 

> 
> Test results (Tim):
> Nvidia GeForce 840M - NVIDIA 352.41: pass
> 
> Signed-off-by: Emil Velikov 
> ---
>  .../explicit-offsets/ssbo-decreasing-offset.vert   | 29
> ++
>  .../ssbo-members-stamping-each-other.vert  | 29
> ++
>  .../ssbo-multiple-members-same-offset.vert | 29
> ++
>  .../explicit-offsets/ubo-decreasing-offset.vert| 27
> 
>  .../ubo-members-stamping-each-other.vert   | 28
> +
>  .../ubo-multiple-members-same-offset.vert  | 28
> +
>  6 files changed, 170 insertions(+)
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-decreasing-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-members-stamping-each-other.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-multiple-members-same-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-decreasing-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-members-stamping-each-other.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-multiple-members-same-offset.vert
> 
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -decreasing-offset.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-decreasing-offset.vert
> new file mode 100644
> index 000..dc6583e
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -decreasing-offset.vert
> @@ -0,0 +1,29 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_enhanced_layouts
> GL_ARB_shader_storage_buffer_object
> +// check_link: true
> +// [end config]
> +//
> +// ARB_enhanced_layouts spec says:
> +//"It is a compile-time error to
> +//specify an *offset* that is smaller than the offset of the previous
> +//member in the block..."
> +//
> +// Tests whether assigning a smaller offset for sequential member triggers
> +// a compile-time error.
> +//
> +
> +#version 140
> +#extension GL_ARB_enhanced_layouts : enable
> +#extension GL_ARB_shader_storage_buffer_object : enable
> +
> +
> +layout(std430) buffer b {
> +   layout(offset = 32) vec4 var1;
> +   layout(offset = 0) vec4 var2; // Wrong: offset must be larger than
> that of a previous member
> +};
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -members-stamping-each-other.vert
> b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-members
> -stamping-each-other.vert
> new file mode 100644
> index 000..34afc06
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-members
> -stamping-each-other.vert
> @@ -0,0 +1,29 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_enhanced_layouts
> GL_ARB_shader_storage_buffer_object
> +// check_link: true
> +// [end config]
> +//
> +// ARB_enhanced_layouts spec says:
> +//"It is a compile-time error to
> +//specify an *offset* that is smaller than the offset of the previous
> +//member in the block or that lies within the previous member of the
> +//block."
> +//
> +// Tests whether assigning the same offsets for multiple members trigger
> +// a compile-time error.
> +//
> +
> +#version 140
> +#extension GL_ARB_enhanced_layouts : enable
> +#extension GL_ARB_shader_storage_buffer_object : enable
> +
> +layout(std430) buffer b {
> +   layout(offset = 0) vec4 var1;
> +   layout(offset = 8) vec4 var2; // Wrong: must use 16+ as offset
> +};
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -multiple-members-same-offset.vert
> b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-multiple
> -members-same-offset.vert
> new file mode 100644
> 

Re: [Piglit] [PATCH v3 1/5] arb-enhanced-layouts: explicit-offset: add block layout tests

2015-11-11 Thread Timothy Arceri
On Wed, 2015-11-11 at 18:14 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> As per the spec the block must be of std140 (or std430 if using ssbo)
> layout.
> 
> v2:
>  - Fix typo - enhanced-layout > enhanced-layouts
>  - Prefix uniform tests with ubo
>  - Add ssbo equivalent tests
> 
> v3:
>  - Remove trailing whitespace (Tim)
>  - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
> 
> Test results (Tim):
> Nvidia GeForce 840M - NVIDIA 352.41: pass

Thanks for working on these Emil :)

This is really picky but normally the commit message uses underscores for the
extension arb_enhanced_layouts -> arb-enhanced-layouts feel free to leave as
is this time around.

Reviewed-by: Timothy Arceri 

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


Re: [Piglit] [PATCH v3 2/5] arb-enhanced-layouts: explicit-offset: basic/sanity offset values

2015-11-11 Thread Timothy Arceri
On Wed, 2015-11-11 at 18:14 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Check if both numberical and const expressions are accepted as valid
> offset. Also try a negative value as offset.
> 
> v2:
>  - Fix typo - enhanced-layout > enhanced-layouts
>  - Prefix uniform tests with ubo
>  - Add ssbo equivalent tests
> 
> v3:
>  - Remove trailing whitespace (Tim)
>  - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
>  - Swap offsets for negative-offset test.
> 
> Test results (Tim):
> Nvidia GeForce 840M - NVIDIA 352.41: pass
> 
> Signed-off-by: Emil Velikov 
> ---
>  .../ssbo-integral-constant-expression-offset.vert  | 29
> ++
>  .../explicit-offsets/ssbo-negative-offset.vert | 28
> +
>  .../explicit-offsets/ssbo-numerical-offset.vert| 27
> 
>  .../ubo-integral-constant-expression-offset.vert   | 28
> +
>  .../explicit-offsets/ubo-negative-offset.vert  | 27
> 
>  .../explicit-offsets/ubo-numerical-offset.vert | 26 +++
>  6 files changed, 165 insertions(+)
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-integral-constant-expression-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-negative-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-numerical-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-integral-constant-expression-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-negative-offset.vert
>  create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ubo-numerical-offset.vert
> 
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -integral-constant-expression-offset.vert
> b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-integral
> -constant-expression-offset.vert
> new file mode 100644
> index 000..5139537
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -integral-constant-expression-offset.vert
> @@ -0,0 +1,29 @@
> +// [config]
> +// expect_result: pass
> +// 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 *offset* qualifier forces the qualified member to start at or
> after the
> +//specified integral-constant-expression, which will be its byte offset
> +//from the beginning of the buffer."
> +//
> +// Tests if constant expressions are accepted as offset.
> +//
> +
> +#version 140
> +#extension GL_ARB_enhanced_layouts : enable
> +#extension GL_ARB_shader_storage_buffer_object : enable
> +
> +const int start = 8;
> +
> +layout(std430) buffer b {
> +   layout(offset = start + 0) vec4 var1;
> +   layout(offset = start + 32) vec4 var2;
> +};
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -negative-offset.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-negative-offset.vert
> new file mode 100644
> index 000..4eab958
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -negative-offset.vert
> @@ -0,0 +1,28 @@
> +// [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 *offset* qualifier forces the qualified member to start at or
> after the
> +//specified integral-constant-expression, which will be its byte offset
> +//from the beginning of the buffer."
> +//
> +// Tests if negative offsets trigger a compile-time error.
> +// Note: not explicitly mentioned in the spec.
> +//
> +
> +#version 140
> +#extension GL_ARB_enhanced_layouts : enable
> +#extension GL_ARB_shader_storage_buffer_object : enable
> +
> +layout(std430) buffer b {
> +   layout(offset = -2) vec4 var1; // Wrong: offset cannot be negative
> value
> +   layout(offset = 0) vec4 var2;
> +};
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -numerical-offset.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit
> -offsets/ssbo-numerical-offset.vert
> new file mode 100644
> index 000..2fa724d
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo
> -numerical-offset.vert
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: pass
> +// 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 *offset* qualifier fo

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

2015-11-11 Thread Ilia Mirkin
On Wed, Nov 11, 2015 at 2:05 PM, Matt Turner  wrote:
> On Wed, Nov 11, 2015 at 6:44 AM, Ilia Mirkin  wrote:
>> On Wed, Nov 11, 2015 at 1:46 AM, Matt Turner  wrote:
>>> Otherwise, these will generate an error (to be noticed sometime later
>>> when glGetError() is called), often resulting in a test failure.
>>> ---
>>>  tests/shaders/shader_runner.c | 18 --
>>>  1 file changed, 12 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
>>> index 32ac7bd..4597b46 100644
>>> --- a/tests/shaders/shader_runner.c
>>> +++ b/tests/shaders/shader_runner.c
>>> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
>>> if (piglit_get_gl_version() >= 32)
>>> glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
>>>   &gl_max_vertex_output_components);
>>> -   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>>> - &gl_max_fragment_uniform_components);
>>> -   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>>> - &gl_max_vertex_uniform_components);
>>> -   glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
>>> - &gl_max_varying_components);
>>> +   if (piglit_get_gl_version() >= 20 ||
>>> +   piglit_is_extension_supported("GL_ARB_fragment_shader"))
>>> +   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>>> + &gl_max_fragment_uniform_components);
>>> +   if (piglit_get_gl_version() >= 20 ||
>>> +   piglit_is_extension_supported("GL_ARB_vertex_shader"))
>>> +   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>>> + &gl_max_vertex_uniform_components);
>>> +   if (piglit_get_gl_version() >= 30 ||
>>> +   piglit_is_extension_supported("GL_EXT_geometry_shader4"))
>>
>> I'll admit to not having gone to check the specs, but you almost
>> certainly mean GL_EXT_gpu_shader4 here, no?
>
> I don't think so. I just looked at what defines
> GL_MAX_VARYING_COMPONENTS{,_EXT} in GL/glext.h and it's GL 3.0 or
> GL_EXT_geometry_shader4. GL_EXT_geometry_shader4's spec confirms it,
> and GL_EXT_gpu_shader4 does not define MAX_VARYING_COMPONENTS.

Indeed. I guess that's because VS and GS can output diff quantities of
data? Whatever. This patch is

Reviewed-by: Ilia Mirkin 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


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

2015-11-11 Thread Matt Turner
On Wed, Nov 11, 2015 at 6:44 AM, Ilia Mirkin  wrote:
> On Wed, Nov 11, 2015 at 1:46 AM, Matt Turner  wrote:
>> Otherwise, these will generate an error (to be noticed sometime later
>> when glGetError() is called), often resulting in a test failure.
>> ---
>>  tests/shaders/shader_runner.c | 18 --
>>  1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
>> index 32ac7bd..4597b46 100644
>> --- a/tests/shaders/shader_runner.c
>> +++ b/tests/shaders/shader_runner.c
>> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
>> if (piglit_get_gl_version() >= 32)
>> glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
>>   &gl_max_vertex_output_components);
>> -   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>> - &gl_max_fragment_uniform_components);
>> -   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>> - &gl_max_vertex_uniform_components);
>> -   glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
>> - &gl_max_varying_components);
>> +   if (piglit_get_gl_version() >= 20 ||
>> +   piglit_is_extension_supported("GL_ARB_fragment_shader"))
>> +   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
>> + &gl_max_fragment_uniform_components);
>> +   if (piglit_get_gl_version() >= 20 ||
>> +   piglit_is_extension_supported("GL_ARB_vertex_shader"))
>> +   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
>> + &gl_max_vertex_uniform_components);
>> +   if (piglit_get_gl_version() >= 30 ||
>> +   piglit_is_extension_supported("GL_EXT_geometry_shader4"))
>
> I'll admit to not having gone to check the specs, but you almost
> certainly mean GL_EXT_gpu_shader4 here, no?

I don't think so. I just looked at what defines
GL_MAX_VARYING_COMPONENTS{,_EXT} in GL/glext.h and it's GL 3.0 or
GL_EXT_geometry_shader4. GL_EXT_geometry_shader4's spec confirms it,
and GL_EXT_gpu_shader4 does not define MAX_VARYING_COMPONENTS.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v3 1/5] arb-enhanced-layouts: explicit-offset: add block layout tests

2015-11-11 Thread Emil Velikov
From: Emil Velikov 

As per the spec the block must be of std140 (or std430 if using ssbo)
layout.

v2:
 - Fix typo - enhanced-layout > enhanced-layouts
 - Prefix uniform tests with ubo
 - Add ssbo equivalent tests

v3:
 - Remove trailing whitespace (Tim)
 - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)

Test results (Tim):
Nvidia GeForce 840M - NVIDIA 352.41: pass

Signed-off-by: Emil Velikov 
---
 .../explicit-offsets/ssbo-packed-layout.vert   | 26 ++
 .../explicit-offsets/ssbo-shared-layout.vert   | 26 ++
 .../explicit-offsets/ssbo-std140-layout.vert   | 26 ++
 .../explicit-offsets/ssbo-std430-layout.vert   | 26 ++
 .../explicit-offsets/ubo-packed-layout.vert| 25 +
 .../explicit-offsets/ubo-shared-layout.vert| 25 +
 .../explicit-offsets/ubo-std140-layout.vert| 25 +
 7 files changed, 179 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-packed-layout.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-shared-layout.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-std140-layout.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert
new file mode 100644
index 000..5b7d52c
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.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 *offset* qualifier can only be used on block members of 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) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert
new file mode 100644
index 000..42966b0
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.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 *offset* qualifier can only be used on block members of 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) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
new file mode 100644
index 000..43305f9
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: pass
+// 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 *offset* qualifier can only be used on block members of blocks
+//declared with *std140* or *std430* layouts.
+//
+// Tests for successful compilation, when the block is of std140 layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std140) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert
new file mode 100644
index 

[Piglit] [PATCH v3 5/5] arb-enhanced-layouts: explicit-offset: add linker test

2015-11-11 Thread Emil Velikov
From: Emil Velikov 

Check if the linker throws an error when the offset across two
identically named blocks' members are not the same.

v2:
 - Rework into intra- and interstage tests (Tim).
 - Tweak shader comment (wrong ...)

Signed-off-by: Emil Velikov 
---
 ...sbo-different-offset-across-shaders.shader_test | 35 ++
 ...ubo-different-offset-across-shaders.shader_test | 32 +
 ...sbo-different-offset-across-shaders.shader_test | 41 ++
 ...ubo-different-offset-across-shaders.shader_test | 40 +
 4 files changed, 148 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ssbo-different-offset-across-shaders.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ubo-different-offset-across-shaders.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ssbo-different-offset-across-shaders.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ubo-different-offset-across-shaders.shader_test

diff --git 
a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ssbo-different-offset-across-shaders.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ssbo-different-offset-across-shaders.shader_test
new file mode 100644
index 000..6d06ef5
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ssbo-different-offset-across-shaders.shader_test
@@ -0,0 +1,35 @@
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 64) vec4 var2; // Wrong: members and their respective 
offset across identically named blocks must be the same
+};
+
+void main()
+{
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ubo-different-offset-across-shaders.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ubo-different-offset-across-shaders.shader_test
new file mode 100644
index 000..b391fd6
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/interstage-ubo-different-offset-across-shaders.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140) uniform b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140) uniform b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 64) vec4 var2; // Wrong: members and their respective 
offset across identically named blocks must be the same
+};
+
+void main()
+{
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ssbo-different-offset-across-shaders.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ssbo-different-offset-across-shaders.shader_test
new file mode 100644
index 000..dee2da0
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ssbo-different-offset-across-shaders.shader_test
@@ -0,0 +1,41 @@
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 32) vec4 var2;
+};
+
+void f()
+{
+  var1 = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 64) vec4 var2; // Wrong: members and their respective 
offset across identically named blocks must be the same
+};
+
+void f();
+
+void main()
+{
+  f();
+
+  gl_Position = gl_Vertex;
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ubo-different-offset-across-shaders.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/intrastage-ubo-different-offset-across-shaders.shader_test
new file mode 100644
index 000..ac22303
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/explicit-o

[Piglit] [PATCH v3 4/5] arb-enhanced-layouts: explicit-offset: test offset wrt (self) alignment

2015-11-11 Thread Emil Velikov
From: Emil Velikov 

As per the spec hunk:
   "The specified offset must be a
   multiple of the base alignment of the type of the block member it
   qualifies, or a compile-time error results."

v2:
 - Fix typo - enhanced-layout > enhanced-layouts
 - Prefix uniform tests with ubo
 - Add ssbo equivalent tests
 - Quote the correct spec hunk in commit msg

v3:
 - Remove trailing whitespace (Tim)
 - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
 - Change check_link to true to match below test results (Tim)

Test results (Tim):
Nvidia GeForce 840M - NVIDIA 352.41: pass

Signed-off-by: Emil Velikov 
---
 .../ssbo-offset-multiple-of-base-member-align.vert | 27 ++
 .../ubo-offset-multiple-of-base-member-align.vert  | 26 +
 2 files changed, 53 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-offset-multiple-of-base-member-align.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-offset-multiple-of-base-member-align.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-offset-multiple-of-base-member-align.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-offset-multiple-of-base-member-align.vert
new file mode 100644
index 000..231d445
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-offset-multiple-of-base-member-align.vert
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: true
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"The specified offset must be a
+//multiple of the base alignment of the type of the block member it
+//qualifies, or a compile-time error results."
+//
+// Tests for successful compilation, when the block is of std140 layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = 0) float f1;
+   layout(offset = 2) float f2; // Wrong: offset must be aligned to 
multiple of sizeof(float)
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-offset-multiple-of-base-member-align.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-offset-multiple-of-base-member-align.vert
new file mode 100644
index 000..60a9705
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-offset-multiple-of-base-member-align.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"The specified offset must be a
+//multiple of the base alignment of the type of the block member it
+//qualifies, or a compile-time error results."
+//
+// Tests for successful compilation, when the block is of std140 layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140) uniform block {
+   layout(offset = 0) float f1;
+   layout(offset = 2) float f2; // Wrong: offset must be aligned to 
multiple of sizeof(float)
+};
+
+void main()
+{
+}
-- 
2.6.2

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


[Piglit] [PATCH v3 3/5] arb-enhanced-layouts: explicit-offset: relative offset values

2015-11-11 Thread Emil Velikov
From: Emil Velikov 

Check if one member is (attempted to be) positioned on top of another,
and that the assigned offset(s) increase naturally.

v2:
 - Fix typo - enhanced-layout > enhanced-layouts
 - Prefix uniform tests with ubo
 - Add ssbo equivalent tests

v3:
 - Remove trailing whitespace (Tim)
 - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
 - Tweak glsl shader comment (Tim)
 - Drop XXX and Note(s) (Tim)
 - Change check_link to true to match below test results (Tim)

Test results (Tim):
Nvidia GeForce 840M - NVIDIA 352.41: pass

Signed-off-by: Emil Velikov 
---
 .../explicit-offsets/ssbo-decreasing-offset.vert   | 29 ++
 .../ssbo-members-stamping-each-other.vert  | 29 ++
 .../ssbo-multiple-members-same-offset.vert | 29 ++
 .../explicit-offsets/ubo-decreasing-offset.vert| 27 
 .../ubo-members-stamping-each-other.vert   | 28 +
 .../ubo-multiple-members-same-offset.vert  | 28 +
 6 files changed, 170 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-decreasing-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-members-stamping-each-other.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-multiple-members-same-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-decreasing-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-members-stamping-each-other.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-multiple-members-same-offset.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-decreasing-offset.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-decreasing-offset.vert
new file mode 100644
index 000..dc6583e
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-decreasing-offset.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: true
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"It is a compile-time error to
+//specify an *offset* that is smaller than the offset of the previous
+//member in the block..."
+//
+// Tests whether assigning a smaller offset for sequential member triggers
+// a compile-time error.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+
+layout(std430) buffer b {
+   layout(offset = 32) vec4 var1;
+   layout(offset = 0) vec4 var2; // Wrong: offset must be larger than that 
of a previous member
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-members-stamping-each-other.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-members-stamping-each-other.vert
new file mode 100644
index 000..34afc06
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-members-stamping-each-other.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: true
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"It is a compile-time error to
+//specify an *offset* that is smaller than the offset of the previous
+//member in the block or that lies within the previous member of the
+//block."
+//
+// Tests whether assigning the same offsets for multiple members trigger
+// a compile-time error.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = 0) vec4 var1;
+   layout(offset = 8) vec4 var2; // Wrong: must use 16+ as offset
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-multiple-members-same-offset.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-multiple-members-same-offset.vert
new file mode 100644
index 000..c5030ef
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-multiple-members-same-offset.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 
GL_ARB_shader_storage_buffer_object
+// check_link: true
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//"It is a compile-time error to
+//specify an *offset* that is smaller than the offset of the previous
+//member in the block or that lies within the previous member of the
+//block."
+//
+// Tests whether assigning the same offsets fo

[Piglit] [PATCH v3 5/5] arb-enhanced-layouts: explicit-offset piglits

2015-11-11 Thread Emil Velikov
Hi all,

Updated tests based on the feedback received so far:
 - Dropped trailing white space
 - Change glsl version to 1.40 for the ssbo tests
 - Add check_link true to the compiler tests for compliance with 
official Nvidia driver
 - Test only one thing at a time (some negative tests had two issues)
 - Rework link tests into separate inter/intra stage ones.

Comments and suggestions are appreciated.
Emil

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


[Piglit] [PATCH v3 2/5] arb-enhanced-layouts: explicit-offset: basic/sanity offset values

2015-11-11 Thread Emil Velikov
From: Emil Velikov 

Check if both numberical and const expressions are accepted as valid
offset. Also try a negative value as offset.

v2:
 - Fix typo - enhanced-layout > enhanced-layouts
 - Prefix uniform tests with ubo
 - Add ssbo equivalent tests

v3:
 - Remove trailing whitespace (Tim)
 - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)
 - Swap offsets for negative-offset test.

Test results (Tim):
Nvidia GeForce 840M - NVIDIA 352.41: pass

Signed-off-by: Emil Velikov 
---
 .../ssbo-integral-constant-expression-offset.vert  | 29 ++
 .../explicit-offsets/ssbo-negative-offset.vert | 28 +
 .../explicit-offsets/ssbo-numerical-offset.vert| 27 
 .../ubo-integral-constant-expression-offset.vert   | 28 +
 .../explicit-offsets/ubo-negative-offset.vert  | 27 
 .../explicit-offsets/ubo-numerical-offset.vert | 26 +++
 6 files changed, 165 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-integral-constant-expression-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-negative-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-numerical-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-integral-constant-expression-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-negative-offset.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-numerical-offset.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-integral-constant-expression-offset.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-integral-constant-expression-offset.vert
new file mode 100644
index 000..5139537
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-integral-constant-expression-offset.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// 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 *offset* qualifier forces the qualified member to start at or after 
the
+//specified integral-constant-expression, which will be its byte offset
+//from the beginning of the buffer."
+//
+// Tests if constant expressions are accepted as offset.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+const int start = 8;
+
+layout(std430) buffer b {
+   layout(offset = start + 0) vec4 var1;
+   layout(offset = start + 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-negative-offset.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-negative-offset.vert
new file mode 100644
index 000..4eab958
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-negative-offset.vert
@@ -0,0 +1,28 @@
+// [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 *offset* qualifier forces the qualified member to start at or after 
the
+//specified integral-constant-expression, which will be its byte offset
+//from the beginning of the buffer."
+//
+// Tests if negative offsets trigger a compile-time error.
+// Note: not explicitly mentioned in the spec.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+   layout(offset = -2) vec4 var1; // Wrong: offset cannot be negative value
+   layout(offset = 0) vec4 var2;
+};
+
+void main()
+{
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-numerical-offset.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-numerical-offset.vert
new file mode 100644
index 000..2fa724d
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-numerical-offset.vert
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: pass
+// 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 *offset* qualifier forces the qualified member to start at or after 
the
+//specified integral-constant-expression, which will be its byte offset
+//from the beginning of the buffer."
+//
+// Tests if numerical expressions are accepted as offset.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buff

[Piglit] [PATCH] texwrap: do no short circuit remaining tests if one fails

2015-11-11 Thread Emil Velikov
From: Emil Velikov 

Noticed as some of these have been intermittently failing on llvmpipe,
resulting in a few "not run" test across mesa release checks.

Signed-off-by: Emil Velikov 
---

XXX:
At some point we'd want to do a tree-wide:
 - s/GLboolean pass/bool pass/
 - s/pass = pass && foo/pass &= foo/
 - s/pass = foo && pass/pass &= foo/

We might want to convert the test to use the piglit_probe_pixels over
it's custom ones.

-Emil

 tests/texturing/texwrap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index fbe9068..60ffa73 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -1134,7 +1134,7 @@ static GLboolean test_format_npot(const struct 
format_desc *format, GLboolean np
 * It has to be enabled on the command line.
 */
if (!texture_swizzle && !npot && !test_border_color && 
has_texture_swizzle) {
-   pass = pass && test_format_npot_swizzle(format, npot, 
1);
+   pass = test_format_npot_swizzle(format, npot, 1) && 
pass;
}
}
return pass;
@@ -1149,7 +1149,7 @@ static GLboolean test_format(const struct format_desc 
*format)
} else {
pass = test_format_npot(format, 0);
if (has_npot && !test_border_color) {
-   pass = pass && test_format_npot(format, 1);
+   pass = test_format_npot(format, 1) && pass;
}
}
return pass;
@@ -1163,7 +1163,7 @@ enum piglit_result piglit_display()
pass = test_format(init_format ? init_format : 
&test->format[0]);
} else {
if (init_format) {
-   pass = pass && test_format(init_format);
+   pass = test_format(init_format) && pass;
} else {
int i;
for (i = 0; i < test->num_formats; i++) {
-- 
2.6.2

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


Re: [Piglit] [PATCH] generated_tests/builtin_function.py: hide RuntimeWarnings

2015-11-11 Thread Dylan Baker
Yeah. I noticed that right after I pushed it. I have a patch to fix it
already. I'll send it out or push it today.
On Nov 10, 2015 23:23, "Jan Vesely"  wrote:

> On Tue, 2015-11-10 at 13:44 -0800, Dylan Baker wrote:
> > On Tue, Nov 10, 2015 at 12:37:31PM -0800, Vinson Lee wrote:
> > > On Fri, Nov 6, 2015 at 12:35 PM,   wrote:
> > > > From: Dylan Baker 
> > > >
> > > > These warnings are expected, it's better to hide expected
> > > > warnings and
> > > > provide a comment about them being expected than to have them
> > > > clutter
> > > > the output of the build system.
> > > >
> > > > Signed-off-by: Dylan Baker 
> > [snip]
> > >
> > > I found this comment about the warning.
> > > https://bugs.freedesktop.org/show_bug.cgi?id=40697#c5
> > >
> > > Reviewed-by: Vinson Lee 
> >
> > Thanks Vinson, I've updated the commit message with that reference
> > and
> > pushed this patch.
>
> I know it's not officially supported, but the patch breaks the build
> with python3:
> $ python3 generated_tests/gen_shader_precision_tests.py
> Traceback (most recent call last):
>   File "generated_tests/gen_shader_precision_tests.py", line 53, in
> 
> from builtin_function import *
>   File "/home/orome/piglit/generated_tests/builtin_function.py", line
> 1479, in 
> _make_vector_or_matrix_test_vectors(test_suite)
>   File "/home/orome/piglit/generated_tests/builtin_function.py", line
> 1284, in _make_vector_or_matrix_test_vectors
> with warnings.catch_warnings(RuntimeWarning):
> TypeError: __init__() takes 1 positional argument but 2 were given
>
> $ python3 --version
>
> Jan
>
>
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
>
> --
> Jan Vesely 
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


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

2015-11-11 Thread Ilia Mirkin
On Wed, Nov 11, 2015 at 1:46 AM, Matt Turner  wrote:
> Otherwise, these will generate an error (to be noticed sometime later
> when glGetError() is called), often resulting in a test failure.
> ---
>  tests/shaders/shader_runner.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 32ac7bd..4597b46 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
> if (piglit_get_gl_version() >= 32)
> glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
>   &gl_max_vertex_output_components);
> -   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> - &gl_max_fragment_uniform_components);
> -   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> - &gl_max_vertex_uniform_components);
> -   glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> - &gl_max_varying_components);
> +   if (piglit_get_gl_version() >= 20 ||
> +   piglit_is_extension_supported("GL_ARB_fragment_shader"))
> +   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> + &gl_max_fragment_uniform_components);
> +   if (piglit_get_gl_version() >= 20 ||
> +   piglit_is_extension_supported("GL_ARB_vertex_shader"))
> +   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> + &gl_max_vertex_uniform_components);
> +   if (piglit_get_gl_version() >= 30 ||
> +   piglit_is_extension_supported("GL_EXT_geometry_shader4"))

I'll admit to not having gone to check the specs, but you almost
certainly mean GL_EXT_gpu_shader4 here, no?

> +   glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> + &gl_max_varying_components);
> glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max_clip_planes);
>  #else
> glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS,
> --
> 2.4.9
>
> ___
> 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] Patchwork

2015-11-11 Thread Martin Peres

On 10/11/15 21:52, Dylan Baker wrote:

Hi ladies and gents,

I've just finished (mostly) cleaning up patchwork, removing tests that
have been superseded, rejected, sent to the wrong list, etc.

We now have four pages of patches for review that are outstanding, some
as far back as 2013, and some for features we have no tests for
currently.

Some of these patches are reviewed (although they may require some
rebasing).

https://patchwork.freedesktop.org/project/piglit/patches/?page=1

Thanks a lot Dylan!

I will have a look at the ones from Laura for DSA in the coming month.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] khr_texture_compression_astc: add precision to sampler

2015-11-11 Thread Tapani Pälli
Samplers not have default precision in fragment stage,
default must be set manually or it must be set explicitly.

Signed-off-by: Tapani Pälli 
---
 .../khr_texture_compression_astc/khr_compressed_astc-miptree-array.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c 
b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c
index 75ef366..e332bad 100644
--- 
a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c
+++ 
b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c
@@ -238,7 +238,7 @@ piglit_init(int argc, char **argv)
"#version 300 es\n"
"precision highp float;\n"
"\n"
-   "uniform sampler2DArray tex;\n"
+   "uniform highp sampler2DArray tex;\n"
"uniform int index;\n"
"in vec2 tex_coord;\n"
"out vec4 fragment_color;\n"
-- 
2.4.3

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