[Piglit] [PATCH 20/25] arb_direct_state_access: Port getcompressedtextureimage to core profile

Ian Romanick idr at freedesktop.org
Mon May 18 13:50:13 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

The "supports_gl_compat_version = 10" was rubbish anyway because DSA
requires OpenGL 2.0.

Since cube maps are required since OpenGL 1.3, the test for it is no
longer needed.  In fact, Mesa does not advertise this extension in core
profile (because duh), so checking for it is harmful.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/spec/arb_direct_state_access/CMakeLists.gl.txt     |  2 +-
 .../arb_direct_state_access/getcompressedtextureimage.c  | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 8ed5417..9351c66 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -29,7 +29,7 @@ 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-targets gettextureimage-targets.c)
 piglit_add_executable (arb_direct_state_access-compressedtextureimage compressedtextureimage.c)
-piglit_add_executable (arb_direct_state_access-getcompressedtextureimage getcompressedtextureimage.c)
+piglit_add_executable (arb_direct_state_access-getcompressedtextureimage getcompressedtextureimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-texture-storage-multisample texture-storage-multisample.c)
 piglit_add_executable (arb_direct_state_access-texture-buffer texture-buffer.c)
 piglit_add_executable (arb_direct_state_access-create-samplers create-samplers.c)
diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
index 66b99af..c1b8f87 100644
--- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
+++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
@@ -26,11 +26,14 @@
  * @file getcompressedtextureimage.c
  */
 #include "piglit-util-gl.h"
+#include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.window_width = 216;
-	config.supports_gl_compat_version = 10;
+
+	config.supports_gl_compat_version = 20;
+	config.supports_gl_core_version = 31;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 			       PIGLIT_GL_VISUAL_DOUBLE;
@@ -48,15 +51,19 @@ show_image(GLubyte *data, int num_layers, const char *title)
 	GLuint name;
 	int i;
 	char junk[50];
+	GLuint prog = 0;
 
 	if (!piglit_automatic) {
+		prog = dsa_create_program(GL_TEXTURE_2D);
+		glUseProgram(prog);
+		dsa_set_xform(prog, piglit_width, piglit_height);
+
 		/* Create the texture handle. */
 		glCreateTextures(GL_TEXTURE_2D, 1, &name);
 		glTextureStorage2D(name, 1, GL_RGBA8, IMAGE_WIDTH,
 			IMAGE_HEIGHT);
 		glTextureParameteri(name, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 		glTextureParameteri(name, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-		glEnable(GL_TEXTURE_2D);
 		glBindTextureUnit(0, name);
 
 		/* Draw the layers, separated by some space */
@@ -83,6 +90,8 @@ show_image(GLubyte *data, int num_layers, const char *title)
 		printf("\n");
 
 		glDeleteTextures(1, &name);
+		glUseProgram(0);
+		glDeleteProgram(prog);
 	}
 }
 
@@ -351,15 +360,12 @@ piglit_init(int argc, char **argv)
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_texture_storage");
 
-	if (!piglit_is_extension_supported("GL_ARB_texture_cube_map"))
-		clear_target_mask(GL_TEXTURE_CUBE_MAP);
 	if (!piglit_is_extension_supported("GL_EXT_texture_array"))
 		clear_target_mask(GL_TEXTURE_2D_ARRAY);
 	if (!piglit_is_extension_supported("GL_ARB_texture_cube_map_array"))
 		clear_target_mask(GL_TEXTURE_CUBE_MAP_ARRAY);
 
 	glClearColor(0.5, 0.5, 0.5, 1);
-	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 }
 
 enum piglit_result
-- 
2.1.0



More information about the Piglit mailing list