Re: [Piglit] [PATCH 1/2] arb_program_interface_query: GetProgramResourceIndex test

2015-03-01 Thread Tapani Pälli



On 02/27/2015 06:04 PM, Ilia Mirkin wrote:

On Fri, Feb 27, 2015 at 4:32 AM, Tapani Pälli tapani.pa...@intel.com wrote:

Test passes on Nvidia GTX 660 (binary driver version 331.38).

Signed-off-by: Tapani Pälli tapani.pa...@intel.com
---
  tests/all.py   |   1 +
  .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
  .../arb_program_interface_query/resource-index.c   | 210 +
  3 files changed, 212 insertions(+)
  create mode 100644 tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 8b9426a..d19b20a 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2049,6 +2049,7 @@ for test_type in ('shader', 'api'):

  arb_program_interface_query = spec['ARB_program_interface_query']
  add_plain_test(arb_program_interface_query, 
['arb_program_interface_query-resource-location'])
+add_plain_test(arb_program_interface_query, 
['arb_program_interface_query-resource-index'])

  # Group ARB_explicit_uniform_location
  arb_explicit_uniform_location = spec['ARB_explicit_uniform_location']
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 6fb7eaf..2028553 100644
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,3 +10,4 @@ link_libraries (
  )

  piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
+piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
diff --git a/tests/spec/arb_program_interface_query/resource-index.c 
b/tests/spec/arb_program_interface_query/resource-index.c
new file mode 100644
index 000..a496c65
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/resource-index.c
@@ -0,0 +1,210 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file resource-index.c
+ *
+ * Tests GetProgramResourceIndex interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ * The command returns the unsigned integer index assigned to a
+ * resource named name in the interface type programInterface of
+ * program object program.  The error INVALID_ENUM is generated if
+ * programInterface is ATOMIC_COUNTER_BUFFER, since active atomic
+ * counter buffer resources are not assigned name strings.
+ *
+ * If name exactly matches the name string of one of the active
+ * resources for programInterface, the index of the matched
+ * resource is returned. Additionally, if name would exactly match
+ * the name string of an active resource if [0] were appended to name,
+ * the index of the matched resource is returned.  Otherwise, name is
+ * considered not to be the name of an active resource, and INVALID_INDEX
+ * is returned.  Note that if an interface enumerates a single active
+ * resource list entry for an array variable (e.g., a[0]), a name
+ * identifying any array element other than the first (e.g., a[1])
+ * is not considered to match.
+ *
+ * For the interface TRANSFORM_FEEDBACK_VARYING, the value INVALID_INDEX
+ * should be returned when querying the index assigned to the special
+ * names gl_NextBuffer, gl_SkipComponents1, gl_SkipComponents2,
+ * gl_SkipComponents3, and gl_SkipComponents4.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 32;
+   config.supports_gl_core_version = 32;


You should really have just one of these... I think the compat one can go.


ok


+   config.window_visual = PIGLIT_GL_VISUAL_RGB;
+
+PIGLIT_GL_TEST_CONFIG_END
+


[...]


+
+void
+piglit_init(int argc, char **argv)
+{
+   GLuint prog, shader;
+   bool pass = true;
+   const char **marker = xfb_markers;
+
+   

[Piglit] [Bug 89329] glsl-deriv-varyings regression

2015-03-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=89329

--- Comment #3 from lu hua huax...@intel.com ---
I also see this fail on all platforms.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] shaders: add test to check (0 cmp x+y) optimization

2015-03-01 Thread Samuel Iglesias Gonsálvez
On Fri, 2015-02-27 at 08:16 -0800, Ian Romanick wrote:
 Why were these implemented as C tests instead of shader-runner tests?
 

Oh, you are right. They should be shader-runner tests. Please ignore
these patches, I will send a new version of them but implemented as
shader-runner tests instead.

Thanks,

Sam 

 On 02/27/2015 05:57 AM, Samuel Iglesias Gonsálvez wrote:
  This patch is meant to check that a Mesa patch [0] fixes a bug in (0 cmp
  x+y) optimization, as it was suggested by Ian [1]. Patch 2/2 checks (x+y
  cmp 0) optimization.
  
  My idea is to push these patches into master branch next week in order
  to have everything in place before pushing Mesa patch [0]. I am going to
  wait some days more before pushing them, just in case someone wants to
  review them.
  
  Thanks,
  
  Sam
  
  [0]
  http://lists.freedesktop.org/archives/mesa-dev/2015-February/077740.html
  [1]
  http://lists.freedesktop.org/archives/mesa-dev/2015-February/077767.html
  
  
  On Wed, 2015-02-25 at 15:03 +0100, Samuel Iglesias Gonsalvez wrote:
  ---
   tests/all.py  |   1 +
   tests/shaders/CMakeLists.gl.txt   |   1 +
   tests/shaders/glsl-opt-0-cmp-xy.c | 130 
  ++
   3 files changed, 132 insertions(+)
   create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.c
 
  diff --git a/tests/all.py b/tests/all.py
  index 40f38cf..d07ae35 100644
  --- a/tests/all.py
  +++ b/tests/all.py
  @@ -506,6 +506,7 @@ add_concurrent_test(shaders, ['glsl-link-bug30552'])
   add_concurrent_test(shaders, ['glsl-link-bug38015'])
   add_concurrent_test(shaders, ['glsl-link-empty-prog-01'])
   add_concurrent_test(shaders, ['glsl-link-empty-prog-02'])
  +add_concurrent_test(shaders, ['glsl-opt-0-cmp-xy'])
   shaders['GLSL link single global initializer, 2 shaders'] = \
   PiglitGLTest(['glsl-link-test',
 os.path.join('shaders', 
  'glsl-link-initializer-01a.vert'),
  diff --git a/tests/shaders/CMakeLists.gl.txt 
  b/tests/shaders/CMakeLists.gl.txt
  index 3efc6bf..521282b 100644
  --- a/tests/shaders/CMakeLists.gl.txt
  +++ b/tests/shaders/CMakeLists.gl.txt
  @@ -145,6 +145,7 @@ piglit_add_executable (glsl-routing glsl-routing.c)
   piglit_add_executable (shader_runner shader_runner.c parser_utils.c)
   piglit_add_executable (glsl-vs-point-size glsl-vs-point-size.c)
   piglit_add_executable (glsl-sin glsl-sin.c)
  +piglit_add_executable (glsl-opt-0-cmp-xy glsl-opt-0-cmp-xy.c)
   IF (UNIX)
 target_link_libraries(glsl-sin m)
   ENDIF (UNIX)
  diff --git a/tests/shaders/glsl-opt-0-cmp-xy.c 
  b/tests/shaders/glsl-opt-0-cmp-xy.c
  new file mode 100644
  index 000..65cb555
  --- /dev/null
  +++ b/tests/shaders/glsl-opt-0-cmp-xy.c
  @@ -0,0 +1,130 @@
  +/*
  + * Copyright © 2015 Intel Corporation
  + *
  + * Permission is hereby granted, free of charge, to any person obtaining a
  + * copy of this software and associated documentation files (the 
  Software),
  + * to deal in the Software without restriction, including without 
  limitation
  + * the rights to use, copy, modify, merge, publish, distribute, 
  sublicense,
  + * and/or sell copies of the Software, and to permit persons to whom the
  + * Software is furnished to do so, subject to the following conditions:
  + *
  + * The above copyright notice and this permission notice (including the 
  next
  + * paragraph) shall be included in all copies or substantial portions of 
  the
  + * Software.
  + *
  + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, 
  EXPRESS OR
  + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
  MERCHANTABILITY,
  + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT 
  SHALL
  + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
  OTHER
  + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
  DEALINGS
  + * IN THE SOFTWARE.
  + *
  + * Authors:
  + *Samuel Iglesias Gonsalvez sigles...@igalia.com
  + *
  + */
  +
  +/** @file glsl-opt-0-cmp-xy.c
  + *
  + * It checks (0 cmp x+y) optimization (if any) works fine.
  + *
  + * Test renders two rectangles: left rect's color is green, right rect's 
  color
  + * is red. Left rectangle's width is one pixel larger than right 
  rectangle's.
  + *
  + */
  +
  +#include piglit-util-gl.h
  +
  +PIGLIT_GL_TEST_CONFIG_BEGIN
  +
  +config.supports_gl_compat_version = 10;
  +config.window_visual = PIGLIT_GL_VISUAL_RGB | 
  PIGLIT_GL_VISUAL_DOUBLE;
  +config.window_width = 50;
  +config.window_height = 50;
  +
  +PIGLIT_GL_TEST_CONFIG_END
  +
  +static char vs_code[] =
  +uniform float a;\n
  +
  +void main()\n
  +{\n
  +gl_Position = ftransform();\n
  +}\n;
  +
  +static char fs_code[] =
  +uniform float a;\n
  +
  +void main()\n
  +{\n
  +if (0.0 = (a - 1.0))\n
  +gl_FragColor = vec4(0, 1, 0, 1);\n
 

[Piglit] [PATCH v2 2/2] shaders: add test to check (x+y cmp 0) optimization

2015-03-01 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com
---

v2:
* Implement it as shader_runner test

 tests/shaders/glsl-opt-xy-cmp-0.shader_test | 33 +
 1 file changed, 33 insertions(+)
 create mode 100644 tests/shaders/glsl-opt-xy-cmp-0.shader_test

diff --git a/tests/shaders/glsl-opt-xy-cmp-0.shader_test 
b/tests/shaders/glsl-opt-xy-cmp-0.shader_test
new file mode 100644
index 000..97aa1fe
--- /dev/null
+++ b/tests/shaders/glsl-opt-xy-cmp-0.shader_test
@@ -0,0 +1,33 @@
+/* Test (x+y cmp 0) optimization. */
+
+[require]
+GLSL = 1.10
+
+[vertex shader]
+
+void main()
+{
+   gl_Position = ftransform();
+}
+
+[fragment shader]
+
+uniform float a;
+
+void main()
+{
+   if ((a - 1.0) = 0.0)
+   gl_FragColor = vec4(0, 1, 0, 1);
+   else
+   gl_FragColor = vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+uniform float a 0
+draw rect -1 -1 1 2
+uniform float a 2
+draw rect 0 -1 1 2
+probe rgb 125 0 0.0 1.0 0.0
+probe rgb 0 0 1.0 0.0 0.0
-- 
2.1.4

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


[Piglit] [PATCH v3] arb_program_interface_query: GetProgramResourceIndex test

2015-03-01 Thread Tapani Pälli
Test passes on Nvidia GTX 660 (binary driver version 331.38).

v2: separate atomic counter index subtest (Ilia Mirkin)
+ code and shader cleanups
+ added subroutine index query test

v3: fix indentation (argh!)

Signed-off-by: Tapani Pälli tapani.pa...@intel.com
---
 tests/all.py   |   1 +
 .../arb_program_interface_query/CMakeLists.gl.txt  |   1 +
 .../arb_program_interface_query/resource-index.c   | 284 +
 3 files changed, 286 insertions(+)
 create mode 100644 tests/spec/arb_program_interface_query/resource-index.c

diff --git a/tests/all.py b/tests/all.py
index 0738de7..253f745 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2049,6 +2049,7 @@ for test_type in ('shader', 'api'):
 
 arb_program_interface_query = spec['ARB_program_interface_query']
 add_concurrent_test(arb_program_interface_query, 
['arb_program_interface_query-resource-location'])
+add_concurrent_test(arb_program_interface_query, 
['arb_program_interface_query-resource-index'])
 
 # Group ARB_explicit_uniform_location
 arb_explicit_uniform_location = spec['ARB_explicit_uniform_location']
diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt 
b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
index 6fb7eaf..2028553 100644
--- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt
@@ -10,3 +10,4 @@ link_libraries (
 )
 
 piglit_add_executable (arb_program_interface_query-resource-location 
resource-location.c)
+piglit_add_executable (arb_program_interface_query-resource-index 
resource-index.c)
diff --git a/tests/spec/arb_program_interface_query/resource-index.c 
b/tests/spec/arb_program_interface_query/resource-index.c
new file mode 100644
index 000..5c3538f
--- /dev/null
+++ b/tests/spec/arb_program_interface_query/resource-index.c
@@ -0,0 +1,284 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file resource-index.c
+ *
+ * Tests GetProgramResourceIndex interface.
+ *
+ * From the GL_ARB_program_interface_query spec:
+ * The command returns the unsigned integer index assigned to a
+ * resource named name in the interface type programInterface of
+ * program object program.  The error INVALID_ENUM is generated if
+ * programInterface is ATOMIC_COUNTER_BUFFER, since active atomic
+ * counter buffer resources are not assigned name strings.
+ *
+ * If name exactly matches the name string of one of the active
+ * resources for programInterface, the index of the matched
+ * resource is returned. Additionally, if name would exactly match
+ * the name string of an active resource if [0] were appended to name,
+ * the index of the matched resource is returned.  Otherwise, name is
+ * considered not to be the name of an active resource, and INVALID_INDEX
+ * is returned.  Note that if an interface enumerates a single active
+ * resource list entry for an array variable (e.g., a[0]), a name
+ * identifying any array element other than the first (e.g., a[1])
+ * is not considered to match.
+ *
+ * For the interface TRANSFORM_FEEDBACK_VARYING, the value INVALID_INDEX
+ * should be returned when querying the index assigned to the special
+ * names gl_NextBuffer, gl_SkipComponents1, gl_SkipComponents2,
+ * gl_SkipComponents3, and gl_SkipComponents4.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 32;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+const char *xfb_markers[] = {
+   gl_NextBuffer,
+   gl_SkipComponents1,
+   gl_SkipComponents2,
+   gl_SkipComponents3,
+   gl_SkipComponents4,
+   NULL
+};
+
+static const char vs_text[] =
+   #version 150\n
+   in vec4 input0;\n
+   in vec4 input1;\n
+   uniform ubo { vec4