[Piglit] [PATCH] shader_runner: Initialize gl_max_varying_components more often.

2016-05-17 Thread Eric Anholt
Back in the day it was called MAX_VARYING_FLOATS, which is an alias
for MAX_VARYING_COMPONENTS.  Fixes a bunch of varying-components tests
skipping on vc4.
---
 tests/shaders/shader_runner.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 239735cba1c9..b1d30185a29c 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3326,7 +3326,8 @@ piglit_init(int argc, char **argv)
piglit_is_extension_supported("GL_ARB_vertex_shader"))
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
  _max_vertex_uniform_components);
-   if (piglit_get_gl_version() >= 30 ||
+   if (piglit_get_gl_version() >= 20 ||
+   piglit_is_extension_supported("GL_ARB_vertex_shader") ||
piglit_is_extension_supported("GL_ARB_geometry_shader4") ||
piglit_is_extension_supported("GL_EXT_geometry_shader4"))
glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
-- 
2.8.0.rc3

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


[Piglit] [PATCH 0/4] Additional tests for ARB_vertex_attrib_64bit extension

2016-05-17 Thread Andres Gomez
This series provides additional tests for the ARB_vertex_attrib_64bit
extension:

https://www.opengl.org/registry/specs/ARB/vertex_attrib_64bit.txt

This work is complemented with the corresponding bug to add support
for this extension into the i965 shader backend at:

https://bugs.freedesktop.org/show_bug.cgi?id=94442

Cheers,
Andres (on behalf of the team that worked on this).

Alejandro Piñeiro (2):
  arb_vertex_attrib_64bit: add getactiveattrib test
  arb_vertex_attrib_64bit: add MAX_VERTEX_ATTRIB test

Andres Gomez (1):
  arb_vertex_attrib_64bit: Adds double vertex input tests generator

Antia Puentes (1):
  arb_vertex_attrib_64bit: add overlapping locations test

 generated_tests/CMakeLists.txt |   9 +
 generated_tests/gen_vs_in_fp64.py  | 380 +
 generated_tests/templates/gen_vs_in_fp64/base.mako |  27 ++
 .../columns_execution.vert.shader_test.mako|  41 +++
 .../gen_vs_in_fp64/columns_shader.vert.mako|  17 +
 .../gen_vs_in_fp64/execution.vert.shader_test.mako |  32 ++
 .../templates/gen_vs_in_fp64/execution_base.mako   |  85 +
 .../regular_execution.vert.shader_test.mako|  67 
 .../gen_vs_in_fp64/regular_shader.vert.mako|  19 ++
 .../templates/gen_vs_in_fp64/shader.vert.mako  |  16 +
 .../templates/gen_vs_in_fp64/shader_base.mako  |  12 +
 tests/all.py   |   5 +
 .../execution/CMakeLists.gl.txt|   3 +
 .../execution/getactiveattrib.c| 345 +++
 .../execution/max-vertex-attrib.c  | 123 +++
 .../execution/overlapping-locations.c  | 226 
 .../execution/vs-dvec3-input.shader_test   |  37 --
 17 files changed, 1407 insertions(+), 37 deletions(-)
 create mode 100644 generated_tests/gen_vs_in_fp64.py
 create mode 100644 generated_tests/templates/gen_vs_in_fp64/base.mako
 create mode 100644 
generated_tests/templates/gen_vs_in_fp64/columns_execution.vert.shader_test.mako
 create mode 100644 
generated_tests/templates/gen_vs_in_fp64/columns_shader.vert.mako
 create mode 100644 
generated_tests/templates/gen_vs_in_fp64/execution.vert.shader_test.mako
 create mode 100644 generated_tests/templates/gen_vs_in_fp64/execution_base.mako
 create mode 100644 
generated_tests/templates/gen_vs_in_fp64/regular_execution.vert.shader_test.mako
 create mode 100644 
generated_tests/templates/gen_vs_in_fp64/regular_shader.vert.mako
 create mode 100644 generated_tests/templates/gen_vs_in_fp64/shader.vert.mako
 create mode 100644 generated_tests/templates/gen_vs_in_fp64/shader_base.mako
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/getactiveattrib.c
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/max-vertex-attrib.c
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/overlapping-locations.c
 delete mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/vs-dvec3-input.shader_test

-- 
2.8.1

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


[Piglit] [PATCH 4/4] arb_vertex_attrib_64bit: add overlapping locations test

2016-05-17 Thread Andres Gomez
From: Antia Puentes 

Verifies that aliasing can be used successfully for vertex attributes
with 64-bit floating-point components, being aliasing the act to bind
more than one attribute name to the same location.

Contributed by Andres Gomez.
---
 tests/all.py   |   3 +
 .../execution/CMakeLists.gl.txt|   1 +
 .../execution/overlapping-locations.c  | 226 +
 3 files changed, 230 insertions(+)
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/overlapping-locations.c

diff --git a/tests/all.py b/tests/all.py
index aa88b1b..16b774f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4676,6 +4676,9 @@ with profile.group_manager(
 g(['arb_vertex_attrib_64bit-check-explicit-location'], 
'check-explicit-location')
 g(['arb_vertex_attrib_64bit-getactiveattrib'], 'getactiveattrib')
 g(['arb_vertex_attrib_64bit-max-vertex-attrib'], 'max-vertex-attrib')
+for test_type in ('shader', 'api'):
+g(['arb_vertex_attrib_64bit-overlapping-locations', test_type],
+  run_concurrent=False)
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt 
b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
index 114ee3c..fecc769 100644
--- a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
@@ -12,3 +12,4 @@ piglit_add_executable (arb_vertex_attrib_64bit-double_attribs 
double_attribs.c)
 piglit_add_executable (arb_vertex_attrib_64bit-check-explicit-location 
check-explicit-location.c)
 piglit_add_executable (arb_vertex_attrib_64bit-getactiveattrib  
getactiveattrib.c)
 piglit_add_executable (arb_vertex_attrib_64bit-max-vertex-attrib 
max-vertex-attrib.c)
+piglit_add_executable (arb_vertex_attrib_64bit-overlapping-locations 
overlapping-locations.c)
diff --git 
a/tests/spec/arb_vertex_attrib_64bit/execution/overlapping-locations.c 
b/tests/spec/arb_vertex_attrib_64bit/execution/overlapping-locations.c
new file mode 100644
index 000..13ee171
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/overlapping-locations.c
@@ -0,0 +1,226 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/** @file overlapping-locations.c
+ *
+ * From OpenGL 3.2 spec ("Compatibility profile"), page 89:
+ *
+ * "It is possible for an application to bind more than one
+ *  attribute name to the same location. This is referred to as
+ *  aliasing. This will only work if only one of the aliased
+ *  attributes is active in the executable program, or if no path
+ *  through the shader consumes more than one attribute of a set
+ *  of attributes aliased to the same location. A link error can
+ *  occur if the linker determines that every path through the
+ *  shader consumes multiple aliased attributes, but
+ *  implementations are not required to generate an error in this
+ *  case."
+ *
+ * This test verifies that aliasing can be used successfully for vertex
+ * attributes with 64-bit floating-point components.
+ *
+ * Based on GL_ARB_explicit_attrib_location's
+ * overlapping-locations-input-attribs.c
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 32;
+   config.supports_gl_core_version = 32;
+
+   config.window_width = 128;
+   config.window_height = 128;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+PIGLIT_GL_TEST_CONFIG_END
+
+static bool locations_in_shader;
+static unsigned prog, vao, vertex_buf;
+
+void
+compile_shader(void)
+{
+   GLuint element_buf;
+   unsigned int indices[6] = { 0, 1, 2, 0, 2, 3 };
+   double vertex_data[4][11] = {
+   /* 

[Piglit] [PATCH 2/4] arb_vertex_attrib_64bit: add getactiveattrib test

2016-05-17 Thread Andres Gomez
From: Alejandro Piñeiro 

This test extend the already existing getactiveattrib by testing the
new functions added by the ARB_vertex_attrib_64 specification.

One alternative option would be to directly extend that test. Having
said so, this kind of isolated subtests for the new functionality
defined on a specification is really common.

Contributed by Andres Gomez.
---
 tests/all.py   |   1 +
 .../execution/CMakeLists.gl.txt|   1 +
 .../execution/getactiveattrib.c| 345 +
 3 files changed, 347 insertions(+)
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/getactiveattrib.c

diff --git a/tests/all.py b/tests/all.py
index 97ce02a..53d3bf3 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4674,6 +4674,7 @@ with profile.group_manager(
 grouptools.join('spec', 'arb_vertex_attrib_64bit')) as g:
 g(['arb_vertex_attrib_64bit-double_attribs'], 'double_attribs')
 g(['arb_vertex_attrib_64bit-check-explicit-location'], 
'check-explicit-location')
+g(['arb_vertex_attrib_64bit-getactiveattrib'], 'getactiveattrib')
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt 
b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
index 3c9a980..9b19668 100644
--- a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
@@ -10,3 +10,4 @@ link_libraries (
 
 piglit_add_executable (arb_vertex_attrib_64bit-double_attribs double_attribs.c)
 piglit_add_executable (arb_vertex_attrib_64bit-check-explicit-location 
check-explicit-location.c)
+piglit_add_executable (arb_vertex_attrib_64bit-getactiveattrib  
getactiveattrib.c)
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/getactiveattrib.c 
b/tests/spec/arb_vertex_attrib_64bit/execution/getactiveattrib.c
new file mode 100644
index 000..4b2241c
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/getactiveattrib.c
@@ -0,0 +1,345 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getactiveattrib.c
+ * Verify that glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES return the expected
+ * values for the new tokens defined at ARB_vertex_attrib_64bit specification.
+ *
+ * This is based on tests/general/getactiveattrib.c
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 32;
+   config.supports_gl_core_version = 32;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+struct attribute {
+   /** Name of the attribute. */
+   const char *name;
+
+   /** Expected GLSL type of the attribute. */
+   GLenum type;
+};
+
+struct test {
+   const char *code;
+
+   /**
+* List of attributes to be checked
+*
+* \note
+* The list is terminated by an attribute with a \c NULL \c name
+* pointer.
+*/
+   struct attribute attributes[16];
+};
+
+static const struct test vertex_attrib_64bit_tests[] = {
+   /* Try all the possible types for vertex shader inputs added
+* at the spec. They could be added as 13 attributes on the
+* same vertex shader, but we would need to get them all
+* active. It is easier to read this way.
+*/
+   {
+   "#version 150\n"
+   "#extension GL_ARB_vertex_attrib_64bit: require\n"
+   "#extension GL_ARB_gpu_shader_fp64: require\n"
+   "in double _double;\n"
+   "void main() { gl_Position = vec4(float(_double)); }\n",
+   {
+   { "_double",GL_DOUBLE },
+   { NULL, }
+   }
+ 

[Piglit] [PATCH 3/4] arb_vertex_attrib_64bit: add MAX_VERTEX_ATTRIB test

2016-05-17 Thread Andres Gomez
From: Alejandro Piñeiro 

This test extend the already existing glsl-max-vertex-attrib test, by
testing the new functions added by the ARB_vertex_attrib_64
specification.

One alternative option would be to directly extend that test. Having
said so, this kind of isolated subtests for the new functionality
defined on a specification is really common.

Contributed by Andres Gomez.
---
 tests/all.py   |   1 +
 .../execution/CMakeLists.gl.txt|   1 +
 .../execution/max-vertex-attrib.c  | 123 +
 3 files changed, 125 insertions(+)
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/max-vertex-attrib.c

diff --git a/tests/all.py b/tests/all.py
index 53d3bf3..aa88b1b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4675,6 +4675,7 @@ with profile.group_manager(
 g(['arb_vertex_attrib_64bit-double_attribs'], 'double_attribs')
 g(['arb_vertex_attrib_64bit-check-explicit-location'], 
'check-explicit-location')
 g(['arb_vertex_attrib_64bit-getactiveattrib'], 'getactiveattrib')
+g(['arb_vertex_attrib_64bit-max-vertex-attrib'], 'max-vertex-attrib')
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt 
b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
index 9b19668..114ee3c 100644
--- a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
 piglit_add_executable (arb_vertex_attrib_64bit-double_attribs double_attribs.c)
 piglit_add_executable (arb_vertex_attrib_64bit-check-explicit-location 
check-explicit-location.c)
 piglit_add_executable (arb_vertex_attrib_64bit-getactiveattrib  
getactiveattrib.c)
+piglit_add_executable (arb_vertex_attrib_64bit-max-vertex-attrib 
max-vertex-attrib.c)
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/max-vertex-attrib.c 
b/tests/spec/arb_vertex_attrib_64bit/execution/max-vertex-attrib.c
new file mode 100644
index 000..8da8238
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/max-vertex-attrib.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * \file max-vertex-attrib.c
+ *
+ * Test setting vertex attrib value of GL_MAX_VERTEX_ATTRIBS attrib
+ * for the New Procedures and Functions defined by the
+ * GL_ARB_vertex_attrib_64bit extension.
+ *
+ * Note that this test is based on glsl-max-vertex-attrib.c which is
+ * already testing the already previously existing vertex attrib
+ * methods.
+ *
+ * Queries the value for GL_MAX_VERTEX_ATTRIBS and uses that as index
+ * to set a value. GL specification states that GL_INVALID_VALUE
+ * should occur if index >= GL_MAX_VERTEX_ATTRIBS.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 32;
+   config.supports_gl_core_version = 32;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static int test = 0;
+
+#define CHECK_GL_INVALID_VALUE \
+   if (glGetError() != GL_INVALID_VALUE) return PIGLIT_FAIL; \
+   else printf("max-vertex-attrib test %d passed\n", ++test);
+
+enum piglit_result
+piglit_display(void)
+{
+   return PIGLIT_FAIL;
+}
+
+static GLboolean
+run_test(void)
+{
+   GLdouble doublev[] = { 1.0, 1.0, 1.0, 1.0 };
+   GLdouble quad[] = { -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0 };
+
+   int maxAttribCount;
+
+   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, );
+
+   glVertexAttribL1d(maxAttribCount, doublev[0]);
+   CHECK_GL_INVALID_VALUE;
+
+   glVertexAttribL2d(maxAttribCount, doublev[0], doublev[1]);
+   CHECK_GL_INVALID_VALUE;
+
+   glVertexAttribL3d(maxAttribCount, 

Re: [Piglit] [PATCH 00/11] Port glsl-link-test to shader_runner

2016-05-17 Thread Dylan Baker
bump


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


Re: [Piglit] [PATCH v3 2/2] util: Suppress OpenCL deprecation warnings

2016-05-17 Thread Serge Martin
On Tuesday 17 May 2016 13:10:52 Dylan Baker wrote:
> Signed-off-by: Dylan Baker 

Reviewed-by: Serge Martin 

> ---
> 
> v3 - Use OpenCL deprecation macros (EdB)
> 
>  tests/util/piglit-util-cl-enum.h | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/util/piglit-util-cl-enum.h
> b/tests/util/piglit-util-cl-enum.h index 51336ce..e08d3c3 100644
> --- a/tests/util/piglit-util-cl-enum.h
> +++ b/tests/util/piglit-util-cl-enum.h
> @@ -25,6 +25,11 @@
>  #ifndef PIGLIT_UTIL_CL_ENUM_H
>  #define PIGLIT_UTIL_CL_ENUM_H
> 
> +#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
> +#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
> +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
> +#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
> +
>  #ifdef __APPLE__
>  #include 
>  #else

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


Re: [Piglit] [PATCH v3 1/2] tests/cl: Fix pointer warning

2016-05-17 Thread Serge Martin
On Tuesday 17 May 2016 13:10:51 Dylan Baker wrote:
> clCreatProgramWithBinary expects a "const unsigned char **", but the code
> passes an "unsighed char **". This is a particular kind of messiness
> that is hard to fix, so just cast when passing into
> clCreateProgramWithBinary.
> 
> Thanks to idr and Matt for help getting this right.
> 
> Signed-off-by: Dylan Baker 

Reviewed-by: Serge Martin 

> ---
>  tests/cl/api/create-program-with-binary.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/cl/api/create-program-with-binary.c
> b/tests/cl/api/create-program-with-binary.c index 4873b76..2a7894e 100644
> --- a/tests/cl/api/create-program-with-binary.c
> +++ b/tests/cl/api/create-program-with-binary.c
> @@ -119,7 +119,8 @@ static cl_program create_binary_program(const
> piglit_cl_context ctx)
> 
>   binary_program = clCreateProgramWithBinary (cl_ctx, ctx->num_devices,
> ctx->device_ids,
> -   sizes, binaries,
> +   sizes,
> +   (const unsigned char **) 
> binaries,
> NULL,
> );

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


[Piglit] [PATCH v3 1/2] tests/cl: Fix pointer warning

2016-05-17 Thread Dylan Baker
clCreatProgramWithBinary expects a "const unsigned char **", but the code
passes an "unsighed char **". This is a particular kind of messiness
that is hard to fix, so just cast when passing into
clCreateProgramWithBinary.

Thanks to idr and Matt for help getting this right.

Signed-off-by: Dylan Baker 
---
 tests/cl/api/create-program-with-binary.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/cl/api/create-program-with-binary.c 
b/tests/cl/api/create-program-with-binary.c
index 4873b76..2a7894e 100644
--- a/tests/cl/api/create-program-with-binary.c
+++ b/tests/cl/api/create-program-with-binary.c
@@ -119,7 +119,8 @@ static cl_program create_binary_program(const 
piglit_cl_context ctx)
 
binary_program = clCreateProgramWithBinary (cl_ctx, ctx->num_devices,
  ctx->device_ids,
- sizes, binaries,
+ sizes,
+ (const unsigned char **) 
binaries,
  NULL,
  );
 
-- 
2.8.2

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


[Piglit] [PATCH v3 2/2] util: Suppress OpenCL deprecation warnings

2016-05-17 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---

v3 - Use OpenCL deprecation macros (EdB)

 tests/util/piglit-util-cl-enum.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/util/piglit-util-cl-enum.h b/tests/util/piglit-util-cl-enum.h
index 51336ce..e08d3c3 100644
--- a/tests/util/piglit-util-cl-enum.h
+++ b/tests/util/piglit-util-cl-enum.h
@@ -25,6 +25,11 @@
 #ifndef PIGLIT_UTIL_CL_ENUM_H
 #define PIGLIT_UTIL_CL_ENUM_H
 
+#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
+#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
+#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
+#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
+
 #ifdef __APPLE__
 #include 
 #else
-- 
2.8.2

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


Re: [Piglit] [PATCH] spec/glsl-es-1.00/linker: test pass cases for invariant conditions

2016-05-17 Thread Dylan Baker
Quoting Lars Hamre (2016-05-06 13:23:48)
> These test the cases where gl_FragCoord and gl_PointCoord are
> allowed to be declared invariant.
> 
> Signed-off-by: Lars Hamre 
> 
> ---
> 
> NOTE: someone with access will need to commit this after the
>   review process
> 
>  .../linker/glsl-fcoord-invariant-pass.shader_test  | 27 +
>  .../linker/glsl-pcoord-invariant-pass.shader_test  | 28 
> ++
>  2 files changed, 55 insertions(+)
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> 
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test 
> b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> new file mode 100644
> index 000..76348a6
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> @@ -0,0 +1,27 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +#"For the built-in special variables, gl_FragCoord can
> +#only be declared invariant if and only if gl_Position is
> +#declared invariant. Similarly gl_PointCoord can only be
> +#declared invariant if and only if gl_PointSize is declared
> +#invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +invariant gl_Position;
> +void main() {
> +   gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_FragCoord;
> +void main() {
> +   gl_FragColor = vec4(gl_FragCoord.x);
> +}
> +
> +[test]
> +link success
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test 
> b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> new file mode 100644
> index 000..c0e9673
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> @@ -0,0 +1,28 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +#"For the built-in special variables, gl_FragCoord can
> +#only be declared invariant if and only if gl_Position is
> +#declared invariant. Similarly gl_PointCoord can only be
> +#declared invariant if and only if gl_PointSize is declared
> +#invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +invariant gl_PointSize;
> +void main() {
> +   gl_PointSize = 1.0;
> +   gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_PointCoord;
> +void main() {
> +   gl_FragColor = vec4(gl_PointCoord.x);
> +}
> +
> +[test]
> +link success
> --
> 2.5.5
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

Reviewed-by: Dylan Baker 

I'll go ahead and push this too.

Thanks.


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


Re: [Piglit] [PATCH 2/2] cl: add global offset test

2016-05-17 Thread Serge Martin
On Sunday 15 May 2016 17:39:25 Jan Vesely wrote:
> Signed-off-by: Jan Vesely 

As spotted by git am, there is some trailing spaces add the end of the array 
of the two 2D test.
With that removed :

Reviewed-by: Serge Martin 

> ---
>  tests/cl/program/execute/global-offset.cl | 85
> +++ 1 file changed, 85 insertions(+)
>  create mode 100644 tests/cl/program/execute/global-offset.cl
> 
> diff --git a/tests/cl/program/execute/global-offset.cl
> b/tests/cl/program/execute/global-offset.cl new file mode 100644
> index 000..ab373cf
> --- /dev/null
> +++ b/tests/cl/program/execute/global-offset.cl
> @@ -0,0 +1,85 @@
> +/*!
> +[config]
> +name: get_offset
> +clc_version_min: 10
> +
> +kernel_name: fill
> +
> +[test]
> +name: 1D, global_size 4 0 0, global_offset 9 0 0
> +dimensions: 1
> +global_size: 4 0 0
> +local_size: 4 0 0
> +global_offset: 9 0 0
> +arg_out: 0 buffer int[8] 9 9 10 9 11 9 12 9
> +
> +[test]
> +name: 1D, global_size 4 0 0, global_offset 9 8 0
> +dimensions: 1
> +global_size: 4 0 0
> +local_size: 4 0 0
> +global_offset: 9 8 0
> +arg_out: 0 buffer int[8] 9 9 10 9 11 9 12 9
> +
> +[test]
> +name: 1D, global_size 4 0 0, global_offset 9 8 7
> +dimensions: 1
> +global_size: 4 0 0
> +local_size: 4 0 0
> +global_offset: 9 8 7
> +arg_out: 0 buffer int[8] 9 9 10 9 11 9 12 9
> +
> +[test]
> +name: 2D, global_size 4 4 0, global_offset 9 8 0
> +dimensions: 2
> +global_size: 4 4 0
> +local_size: 4 4 0
> +global_offset: 9 8 0
> +arg_out: 0 buffer int[32]  809 809  810 809  811 809  812 809 \
> +   909 809  910 809  911 809  912 809 \
> +  1009 809 1010 809 1011 809 1012 809 \
> +  1109 809 1110 809  809 1112 809
> +
> +[test]
> +name: 2D, global_size 4 4 0, global_offset 9 8 7
> +dimensions: 2
> +global_size: 4 4 0
> +local_size: 4 4 0
> +global_offset: 9 8 7
> +arg_out: 0 buffer int[32]  809 809  810 809  811 809  812 809 \
> +   909 809  910 809  911 809  912 809 \
> +  1009 809 1010 809 1011 809 1012 809 \
> +  1109 809 1110 809  809 1112 809
> +
> +[test]
> +name: 3D, global_size 4 4 4, global_offset 9 8 7
> +dimensions: 3
> +global_size: 4 4 4
> +local_size: 4 4 4
> +global_offset: 9 8 7
> +arg_out: 0 buffer int[128]  70809 70809  70810 70809  70811 70809  70812
> 70809 \ +70909 70809  70910 70809  70911 70809 
> 70912 70809 \ +71009 70809  71010 70809  71011
> 70809  71012 70809 \ +71109 70809  71110 70809 
> 7 70809  71112 70809 \ +80809 70809  80810
> 70809  80811 70809  80812 70809 \ +80909 70809 
> 80910 70809  80911 70809  80912 70809 \ +81009
> 70809  81010 70809  81011 70809  81012 70809 \ +   
> 81109 70809  81110 70809  8 70809  81112 70809 \ + 
>   90809 70809  90810 70809  90811 70809  90812 70809 \ +   
> 90909 70809  90910 70809  90911 70809  90912 70809 \ + 
>   91009 70809  91010 70809  91011 70809  91012 70809 \ +   
> 91109 70809  91110 70809  9 70809  91112 70809
> \ +   100809 70809 100810 70809 100811 70809 100812
> 70809 \ +   100909 70809 100910 70809 100911 70809
> 100912 70809 \ +   101009 70809 101010 70809 101011
> 70809 101012 70809 \ +   101109 70809 101110 70809
> 10 70809 101112 70809 +
> +!*/
> +
> +kernel void fill(global int* out) {
> + unsigned int pos = get_local_id(0) + 4 * get_local_id(1) + 16 *
> get_local_id(2); +unsigned int id = get_global_id(0) +
> 100*get_global_id(1) + 1*get_global_id(2); +  unsigned int offset =
> get_global_offset(0) + 100 * get_global_offset(1) + 1 *
> get_global_offset(2); +   out[2*pos] = id;
> + out[2*pos+1] = offset;
> +}

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


Re: [Piglit] [PATCH 1/2] cl: add support for global offset

2016-05-17 Thread Serge Martin
On Sunday 15 May 2016 17:39:24 Jan Vesely wrote:
> Signed-off-by: Jan Vesely 

Review-by: Serge Martin 
> ---
>  tests/cl/api/create-program-with-binary.c|  2 +-
>  tests/cl/custom/buffer-flags.c   |  2 +-
>  tests/cl/custom/flush-after-enqueue-kernel.c |  2 +-
>  tests/cl/custom/r600-create-release-buffer-bug.c | 12 -
>  tests/cl/custom/run-simple-kernel.c  |  2 +-
>  tests/cl/custom/use-sub-buffer-in-kernel.c   |  4 +--
>  tests/cl/program/bitcoin-phatk.c |  2 +-
>  tests/cl/program/max-work-item-sizes.c   |  1 +
>  tests/cl/program/program-tester.c| 33
>  tests/util/piglit-util-cl.c  |
>  7 +++--
>  tests/util/piglit-util-cl.h  |  4 +++
>  11 files changed, 56 insertions(+), 15 deletions(-)
> 
> diff --git a/tests/cl/api/create-program-with-binary.c
> b/tests/cl/api/create-program-with-binary.c index 4873b76..4238331 100644
> --- a/tests/cl/api/create-program-with-binary.c
> +++ b/tests/cl/api/create-program-with-binary.c
> @@ -183,7 +183,7 @@ piglit_cl_test(const int argc,
>   size_t global_work_size = 1;
>   size_t local_work_size = 1;
>   cl_command_queue queue = ctx->command_queues[i];
> - if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1,
> + if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, NULL,
>   _work_size, _work_size)) {
>   fprintf(stderr, "Failed to execute binary kernel.");
>   piglit_merge_result(, PIGLIT_FAIL);
> diff --git a/tests/cl/custom/buffer-flags.c b/tests/cl/custom/buffer-flags.c
> index 6bf988f..115fb92 100644
> --- a/tests/cl/custom/buffer-flags.c
> +++ b/tests/cl/custom/buffer-flags.c
> @@ -130,7 +130,7 @@ buffer_test(piglit_cl_context *ctx,
> 
>   printf("Running the kernel...\n");
>   if (!piglit_cl_enqueue_ND_range_kernel(context->command_queues[0],
> - kernel, 1, , )) {
> + kernel, 1, NULL, , )) {
>   ret = PIGLIT_FAIL;
>   goto cleanup;
>   }
> diff --git a/tests/cl/custom/flush-after-enqueue-kernel.c
> b/tests/cl/custom/flush-after-enqueue-kernel.c index 00a0516..8d3fc8c
> 100644
> --- a/tests/cl/custom/flush-after-enqueue-kernel.c
> +++ b/tests/cl/custom/flush-after-enqueue-kernel.c
> @@ -92,7 +92,7 @@ piglit_cl_test(const int argc,
>   }
> 
>   if (!piglit_cl_enqueue_ND_range_kernel(context->command_queues[0],
> - kernel, 3, global_size, local_size)) {
> + kernel, 3, NULL, global_size, 
> local_size)) {
>   return PIGLIT_FAIL;
>   }
> 
> diff --git a/tests/cl/custom/r600-create-release-buffer-bug.c
> b/tests/cl/custom/r600-create-release-buffer-bug.c index 7c3a214..535e57d
> 100644
> --- a/tests/cl/custom/r600-create-release-buffer-bug.c
> +++ b/tests/cl/custom/r600-create-release-buffer-bug.c
> @@ -74,8 +74,8 @@ piglit_cl_test(const int argc,
>   return PIGLIT_FAIL;
>   }
> 
> - if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, _size,
> - _size)) {
> + if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, NULL,
> +_size, _size)) {
>   return PIGLIT_FAIL;
>   }
> 
> @@ -84,8 +84,8 @@ piglit_cl_test(const int argc,
>   return PIGLIT_FAIL;
>   }
> 
> - if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, _size,
> - _size)) {
> + if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, NULL,
> +_size, _size)) {
>   return PIGLIT_FAIL;
>   }
> 
> @@ -98,8 +98,8 @@ piglit_cl_test(const int argc,
>   return PIGLIT_FAIL;
>   }
> 
> - if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, _size,
> - _size)) {
> + if (!piglit_cl_enqueue_ND_range_kernel(queue, kernel, 1, NULL,
> +_size, _size)) {
>   return PIGLIT_FAIL;
>   }
> 
> diff --git a/tests/cl/custom/run-simple-kernel.c
> b/tests/cl/custom/run-simple-kernel.c index 48d7725..db529d2 100644
> --- a/tests/cl/custom/run-simple-kernel.c
> +++ b/tests/cl/custom/run-simple-kernel.c
> @@ -61,7 +61,7 @@ piglit_cl_test(const int argc,
>  sizeof(cl_int), );
>   piglit_cl_set_kernel_buffer_arg(kernel, 0, );
>   piglit_cl_execute_ND_range_kernel(context->command_queues[0], kernel, 1,
> -   _size, _size);
> +   NULL, _size, _size);
> 
>   /* Read the buffer and check the result */
>  

Re: [Piglit] [PATCH] spec/glsl-es-1.00/linker: test pass cases for invariant conditions

2016-05-17 Thread Lars Hamre
Gentle ping, if nobody has any issues I would appreciate a push.
In reference to this mesa patch:
https://lists.freedesktop.org/archives/mesa-dev/2016-May/116073.html

Regards,
Lars Hamre

On Fri, May 6, 2016 at 4:23 PM, Lars Hamre  wrote:
> These test the cases where gl_FragCoord and gl_PointCoord are
> allowed to be declared invariant.
>
> Signed-off-by: Lars Hamre 
>
> ---
>
> NOTE: someone with access will need to commit this after the
>   review process
>
>  .../linker/glsl-fcoord-invariant-pass.shader_test  | 27 +
>  .../linker/glsl-pcoord-invariant-pass.shader_test  | 28 
> ++
>  2 files changed, 55 insertions(+)
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
>
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test 
> b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> new file mode 100644
> index 000..76348a6
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> @@ -0,0 +1,27 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +#"For the built-in special variables, gl_FragCoord can
> +#only be declared invariant if and only if gl_Position is
> +#declared invariant. Similarly gl_PointCoord can only be
> +#declared invariant if and only if gl_PointSize is declared
> +#invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +invariant gl_Position;
> +void main() {
> +   gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_FragCoord;
> +void main() {
> +   gl_FragColor = vec4(gl_FragCoord.x);
> +}
> +
> +[test]
> +link success
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test 
> b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> new file mode 100644
> index 000..c0e9673
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> @@ -0,0 +1,28 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +#"For the built-in special variables, gl_FragCoord can
> +#only be declared invariant if and only if gl_Position is
> +#declared invariant. Similarly gl_PointCoord can only be
> +#declared invariant if and only if gl_PointSize is declared
> +#invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +invariant gl_PointSize;
> +void main() {
> +   gl_PointSize = 1.0;
> +   gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_PointCoord;
> +void main() {
> +   gl_FragColor = vec4(gl_PointCoord.x);
> +}
> +
> +[test]
> +link success
> --
> 2.5.5
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit