Re: [Piglit] [PATCH 11/24] arb_direct_state_access: Added tests for glGetCompressedTextureImage.

2015-01-20 Thread Ian Romanick
I know that these patches have landed.  After seeing Vinson's patches to
these test cases, I went back and found the original patches to provide
feedback.

On 12/15/2014 05:24 PM, Laura Ekstrand wrote:
 ---
  tests/all.py   |   3 +-
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |   2 +
  .../compressedtextureimage.c   | 288 ++
  .../getcompressedtextureimage.c| 418 
 +

It seems like there are two separate tests added in one commit.

  tests/util/piglit-util-gl.c|   2 +-
  tests/util/piglit-util-gl.h|   1 +
  6 files changed, 712 insertions(+), 2 deletions(-)
  create mode 100644 
 tests/spec/arb_direct_state_access/compressedtextureimage.c
  create mode 100644 
 tests/spec/arb_direct_state_access/getcompressedtextureimage.c
 
 diff --git a/tests/all.py b/tests/all.py
 index 8dfb5ac..b79ae8b 100644
 --- a/tests/all.py
 +++ b/tests/all.py
 @@ -4321,7 +4321,8 @@ 
 spec['ARB_direct_state_access']['gettextureimage-formats'] = 
 PiglitGLTest('arb_d
  spec['ARB_direct_state_access']['gettextureimage-luminance'] = 
 PiglitGLTest('arb_direct_state_access-gettextureimage-luminance', 
 run_concurrent=True)
  spec['ARB_direct_state_access']['gettextureimage-simple'] = 
 PiglitGLTest('arb_direct_state_access-gettextureimage-simple', 
 run_concurrent=True)
  spec['ARB_direct_state_access']['gettextureimage-targets'] = 
 PiglitGLTest('arb_direct_state_access-gettextureimage-targets', 
 run_concurrent=True)
 -
 +spec['ARB_direct_state_access']['compressedtextureimage'] = 
 PiglitGLTest('arb_direct_state_access-compressedtextureimage 
 GL_COMPRESSED_RGBA_FXT1_3DFX', run_concurrent=True)
 +spec['ARB_direct_state_access']['getcompressedtextureimage'] = 
 PiglitGLTest('arb_direct_state_access-getcompressedtextureimage', 
 run_concurrent=True)
  
  profile.tests['hiz'] = hiz
  profile.tests['fast_color_clear'] = fast_color_clear
 diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
 b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 index d5a496e..4e80a99 100644
 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 @@ -23,4 +23,6 @@ piglit_add_executable 
 (arb_direct_state_access-gettextureimage-formats gettextur
  piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
 gettextureimage-luminance.c)
  piglit_add_executable (arb_direct_state_access-gettextureimage-simple 
 gettextureimage-simple.c)
  piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
 gettextureimage-targets.c)
 +piglit_add_executable (arb_direct_state_access-compressedtextureimage 
 compressedtextureimage.c)
 +piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
 getcompressedtextureimage.c)
  # vim: ft=cmake:
 diff --git a/tests/spec/arb_direct_state_access/compressedtextureimage.c 
 b/tests/spec/arb_direct_state_access/compressedtextureimage.c
 new file mode 100644
 index 000..d8875b6
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/compressedtextureimage.c
 @@ -0,0 +1,288 @@
 +/*
 + * Copyright © 2011 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 compressedtextureimage.c
 + *
 + * Tests that fetching and uploading compressed texture data works
 + * correctly.
 + *
 + * The other compressed texture tests are about decoding of data that
 + * was uploaded from uncompressed, while this tries a round-trip after
 + * the initial upload, testing glGetCompressedTexImage() and
 + * glCompressedTexImage2D().
 + *
 + * Adapted for testing glGetCompressedTextureImage in ARB_direct_state_access
 + * by Laura Ekstrand la...@jlekstrand.net, November 2014.
 + */
 +
 +#include piglit-util-gl.h
 +
 +#define SIZE 128
 +
 

[Piglit] [PATCH 11/24] arb_direct_state_access: Added tests for glGetCompressedTextureImage.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   3 +-
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   2 +
 .../compressedtextureimage.c   | 288 ++
 .../getcompressedtextureimage.c| 418 +
 tests/util/piglit-util-gl.c|   2 +-
 tests/util/piglit-util-gl.h|   1 +
 6 files changed, 712 insertions(+), 2 deletions(-)
 create mode 100644 tests/spec/arb_direct_state_access/compressedtextureimage.c
 create mode 100644 
tests/spec/arb_direct_state_access/getcompressedtextureimage.c

diff --git a/tests/all.py b/tests/all.py
index 8dfb5ac..b79ae8b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4321,7 +4321,8 @@ 
spec['ARB_direct_state_access']['gettextureimage-formats'] = PiglitGLTest('arb_d
 spec['ARB_direct_state_access']['gettextureimage-luminance'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-luminance', 
run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-simple'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-simple', 
run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-targets'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-targets', 
run_concurrent=True)
-
+spec['ARB_direct_state_access']['compressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-compressedtextureimage 
GL_COMPRESSED_RGBA_FXT1_3DFX', run_concurrent=True)
+spec['ARB_direct_state_access']['getcompressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-getcompressedtextureimage', 
run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index d5a496e..4e80a99 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -23,4 +23,6 @@ piglit_add_executable 
(arb_direct_state_access-gettextureimage-formats gettextur
 piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
gettextureimage-luminance.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-simple 
gettextureimage-simple.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
gettextureimage-targets.c)
+piglit_add_executable (arb_direct_state_access-compressedtextureimage 
compressedtextureimage.c)
+piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/compressedtextureimage.c 
b/tests/spec/arb_direct_state_access/compressedtextureimage.c
new file mode 100644
index 000..d8875b6
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/compressedtextureimage.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright © 2011 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 compressedtextureimage.c
+ *
+ * Tests that fetching and uploading compressed texture data works
+ * correctly.
+ *
+ * The other compressed texture tests are about decoding of data that
+ * was uploaded from uncompressed, while this tries a round-trip after
+ * the initial upload, testing glGetCompressedTexImage() and
+ * glCompressedTexImage2D().
+ *
+ * Adapted for testing glGetCompressedTextureImage in ARB_direct_state_access
+ * by Laura Ekstrand la...@jlekstrand.net, November 2014.
+ */
+
+#include piglit-util-gl.h
+
+#define SIZE 128
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_width = (SIZE*2)+60;
+   config.window_height = SIZE+20;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+struct format {
+   const char *name;
+   GLenum token;
+   const char **extension;
+};
+
+static struct format