Re: [Piglit] [PATCH 01/24] arb_direct_state_access: DSA 2D Textures hello world test.

2014-12-18 Thread Laura Ekstrand
Oops.  I'll take it out.

On Mon, Dec 15, 2014 at 7:33 PM, Chris Forbes chr...@ijw.co.nz wrote:

 Did you mean to leave the non-DSA nvidia workaround in here? I
 understand this might have been useful for getting it working
 initially, but... if their driver is broken, it's broken.

 On Tue, Dec 16, 2014 at 2:24 PM, Laura Ekstrand la...@jlekstrand.net
 wrote:
  Dylan Baker: all.py: Add dsa tests.
  ---
   tests/all.py   |   2 +
   tests/spec/CMakeLists.txt  |   1 +
   .../spec/arb_direct_state_access/CMakeLists.gl.txt |  13 +++
   tests/spec/arb_direct_state_access/CMakeLists.txt  |   1 +
   tests/spec/arb_direct_state_access/dsa-textures.c  | 123
 +
   tests/spec/arb_direct_state_access/dsa-utils.c |  79 +
   tests/spec/arb_direct_state_access/dsa-utils.h |  51 +
   7 files changed, 270 insertions(+)
   create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.gl.txt
   create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.txt
   create mode 100644 tests/spec/arb_direct_state_access/dsa-textures.c
   create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.c
   create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.h
 
  diff --git a/tests/all.py b/tests/all.py
  index cfbe529..84639c2 100644
  --- a/tests/all.py
  +++ b/tests/all.py
  @@ -4306,6 +4306,8 @@ add_shader_test_dir(arb_derivative_control,
   import_glsl_parser_tests(arb_derivative_control,
testsDir + '/spec/arb_derivative_control',
 [''])
 
  +spec['ARB_direct_state_access'] = {}
  +spec['ARB_direct_state_access']['dsa-textures'] =
 PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)
 
   profile.tests['hiz'] = hiz
   profile.tests['fast_color_clear'] = fast_color_clear
  diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
  index dfd822b..697b00d 100644
  --- a/tests/spec/CMakeLists.txt
  +++ b/tests/spec/CMakeLists.txt
  @@ -114,3 +114,4 @@ add_subdirectory (arb_blend_func_extended)
   add_subdirectory (ext_unpack_subimage)
   add_subdirectory (arb_vertex_array_object)
   add_subdirectory (oes_texture_float)
  +add_subdirectory (arb_direct_state_access)
  diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
  new file mode 100644
  index 000..cb0f7da
  --- /dev/null
  +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
  @@ -0,0 +1,13 @@
  +include_directories(
  +   ${GLEXT_INCLUDE_DIR}
  +   ${OPENGL_INCLUDE_PATH}
  +)
  +
  +link_libraries (
  +   piglitutil_${piglit_target_api}
  +   ${OPENGL_gl_LIBRARY}
  +   ${OPENGL_glu_LIBRARY}
  +)
  +
  +piglit_add_executable (arb_direct_state_access-dsa-textures
 dsa-textures.c dsa-utils.c)
  +# vim: ft=cmake:
  diff --git a/tests/spec/arb_direct_state_access/CMakeLists.txt
 b/tests/spec/arb_direct_state_access/CMakeLists.txt
  new file mode 100644
  index 000..144a306
  --- /dev/null
  +++ b/tests/spec/arb_direct_state_access/CMakeLists.txt
  @@ -0,0 +1 @@
  +piglit_include_target_api()
  diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c
 b/tests/spec/arb_direct_state_access/dsa-textures.c
  new file mode 100644
  index 000..468d23e
  --- /dev/null
  +++ b/tests/spec/arb_direct_state_access/dsa-textures.c
  @@ -0,0 +1,123 @@
  +/*
  + * Copyright 2014 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 dsa-textures.c
  + *
  + * Tests the direct state access functionality for creating,
 initializing, and
  + * rendering texture objects.
  + */
  +#include piglit-util-gl.h
  +#include dsa-utils.h
  +
  +#include stdlib.h
  +
  +static const char* glversion;
  +static bool nv340_23; /* Are we using the NVIDIA 340.23 driver? */
  +
  

[Piglit] [PATCH 01/24] arb_direct_state_access: DSA 2D Textures hello world test.

2014-12-15 Thread Laura Ekstrand
Dylan Baker: all.py: Add dsa tests.
---
 tests/all.py   |   2 +
 tests/spec/CMakeLists.txt  |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |  13 +++
 tests/spec/arb_direct_state_access/CMakeLists.txt  |   1 +
 tests/spec/arb_direct_state_access/dsa-textures.c  | 123 +
 tests/spec/arb_direct_state_access/dsa-utils.c |  79 +
 tests/spec/arb_direct_state_access/dsa-utils.h |  51 +
 7 files changed, 270 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.txt
 create mode 100644 tests/spec/arb_direct_state_access/dsa-textures.c
 create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.c
 create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.h

diff --git a/tests/all.py b/tests/all.py
index cfbe529..84639c2 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4306,6 +4306,8 @@ add_shader_test_dir(arb_derivative_control,
 import_glsl_parser_tests(arb_derivative_control,
  testsDir + '/spec/arb_derivative_control', [''])
 
+spec['ARB_direct_state_access'] = {}
+spec['ARB_direct_state_access']['dsa-textures'] = 
PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index dfd822b..697b00d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -114,3 +114,4 @@ add_subdirectory (arb_blend_func_extended)
 add_subdirectory (ext_unpack_subimage)
 add_subdirectory (arb_vertex_array_object)
 add_subdirectory (oes_texture_float)
+add_subdirectory (arb_direct_state_access)
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
new file mode 100644
index 000..cb0f7da
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
+# vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c 
b/tests/spec/arb_direct_state_access/dsa-textures.c
new file mode 100644
index 000..468d23e
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/dsa-textures.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2014 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 dsa-textures.c
+ *
+ * Tests the direct state access functionality for creating, initializing, and
+ * rendering texture objects.
+ */
+#include piglit-util-gl.h
+#include dsa-utils.h
+
+#include stdlib.h
+
+static const char* glversion;
+static bool nv340_23; /* Are we using the NVIDIA 340.23 driver? */
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+GLfloat*
+random_image_data(void)
+{
+   int i;
+   GLfloat *img = malloc(4*piglit_width*piglit_height*sizeof(GLfloat));
+   for (i = 0; i  4*piglit_width*piglit_height; ++i) {
+   img[i] = (float) rand() / RAND_MAX;
+   }
+   return img;
+} /* random_image_data */
+
+void
+piglit_init(int argc, char **argv)
+{
+   

Re: [Piglit] [PATCH 01/24] arb_direct_state_access: DSA 2D Textures hello world test.

2014-12-15 Thread Chris Forbes
Did you mean to leave the non-DSA nvidia workaround in here? I
understand this might have been useful for getting it working
initially, but... if their driver is broken, it's broken.

On Tue, Dec 16, 2014 at 2:24 PM, Laura Ekstrand la...@jlekstrand.net wrote:
 Dylan Baker: all.py: Add dsa tests.
 ---
  tests/all.py   |   2 +
  tests/spec/CMakeLists.txt  |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |  13 +++
  tests/spec/arb_direct_state_access/CMakeLists.txt  |   1 +
  tests/spec/arb_direct_state_access/dsa-textures.c  | 123 
 +
  tests/spec/arb_direct_state_access/dsa-utils.c |  79 +
  tests/spec/arb_direct_state_access/dsa-utils.h |  51 +
  7 files changed, 270 insertions(+)
  create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.gl.txt
  create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.txt
  create mode 100644 tests/spec/arb_direct_state_access/dsa-textures.c
  create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.c
  create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.h

 diff --git a/tests/all.py b/tests/all.py
 index cfbe529..84639c2 100644
 --- a/tests/all.py
 +++ b/tests/all.py
 @@ -4306,6 +4306,8 @@ add_shader_test_dir(arb_derivative_control,
  import_glsl_parser_tests(arb_derivative_control,
   testsDir + '/spec/arb_derivative_control', [''])

 +spec['ARB_direct_state_access'] = {}
 +spec['ARB_direct_state_access']['dsa-textures'] = 
 PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)

  profile.tests['hiz'] = hiz
  profile.tests['fast_color_clear'] = fast_color_clear
 diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
 index dfd822b..697b00d 100644
 --- a/tests/spec/CMakeLists.txt
 +++ b/tests/spec/CMakeLists.txt
 @@ -114,3 +114,4 @@ add_subdirectory (arb_blend_func_extended)
  add_subdirectory (ext_unpack_subimage)
  add_subdirectory (arb_vertex_array_object)
  add_subdirectory (oes_texture_float)
 +add_subdirectory (arb_direct_state_access)
 diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
 b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 new file mode 100644
 index 000..cb0f7da
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 @@ -0,0 +1,13 @@
 +include_directories(
 +   ${GLEXT_INCLUDE_DIR}
 +   ${OPENGL_INCLUDE_PATH}
 +)
 +
 +link_libraries (
 +   piglitutil_${piglit_target_api}
 +   ${OPENGL_gl_LIBRARY}
 +   ${OPENGL_glu_LIBRARY}
 +)
 +
 +piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
 dsa-utils.c)
 +# vim: ft=cmake:
 diff --git a/tests/spec/arb_direct_state_access/CMakeLists.txt 
 b/tests/spec/arb_direct_state_access/CMakeLists.txt
 new file mode 100644
 index 000..144a306
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/CMakeLists.txt
 @@ -0,0 +1 @@
 +piglit_include_target_api()
 diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c 
 b/tests/spec/arb_direct_state_access/dsa-textures.c
 new file mode 100644
 index 000..468d23e
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/dsa-textures.c
 @@ -0,0 +1,123 @@
 +/*
 + * Copyright 2014 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 dsa-textures.c
 + *
 + * Tests the direct state access functionality for creating, initializing, 
 and
 + * rendering texture objects.
 + */
 +#include piglit-util-gl.h
 +#include dsa-utils.h
 +
 +#include stdlib.h
 +
 +static const char* glversion;
 +static bool nv340_23; /* Are we using the NVIDIA 340.23 driver? */
 +
 +PIGLIT_GL_TEST_CONFIG_BEGIN
 +
 +   config.supports_gl_compat_version = 13;
 +
 +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 +   PIGLIT_GL_VISUAL_DOUBLE;
 +
 +PIGLIT_GL_TEST_CONFIG_END
 +