[Piglit] [PATCH 05/14] arb_direct_state_access: Port texturesubimage to core profile

Ian Romanick idr at freedesktop.org
Wed Sep 9 13:20:58 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.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/spec/arb_direct_state_access/CMakeLists.gl.txt |  2 +-
 tests/spec/arb_direct_state_access/texturesubimage.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 11af64e..d92eefc 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -16,7 +16,7 @@ piglit_add_executable (arb_direct_state_access-gettransformfeedback gettransform
 piglit_add_executable (arb_direct_state_access-create-renderbuffers create-renderbuffers.c)
 piglit_add_executable (arb_direct_state_access-namedrenderbuffer namedrenderbuffer.c)
 piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c)
-piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c)
+piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c)
 piglit_add_executable (arb_direct_state_access-create-textures create-textures.c)
 piglit_add_executable (arb_direct_state_access-texture-storage texture-storage.c)
diff --git a/tests/spec/arb_direct_state_access/texturesubimage.c b/tests/spec/arb_direct_state_access/texturesubimage.c
index a1c1ce0..f21d9e4 100644
--- a/tests/spec/arb_direct_state_access/texturesubimage.c
+++ b/tests/spec/arb_direct_state_access/texturesubimage.c
@@ -33,10 +33,12 @@
 #include "piglit-util-gl.h"
 #include <stdlib.h>
 #include <string.h>
+#include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-	config.supports_gl_compat_version = 10;
+	config.supports_gl_core_version = 31;
+	config.supports_gl_compat_version = 20;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 			       PIGLIT_GL_VISUAL_DOUBLE;
@@ -62,6 +64,9 @@ subtest(GLenum target)
 {
 	bool pass = true;
 	GLuint tex;
+	GLuint prog;
+
+	prog = dsa_create_program(target);
 
 	/* Draw the reference image. */
 	glCreateTextures(target, 1, &tex);
@@ -85,10 +90,10 @@ subtest(GLenum target)
 				    refImg);
 	}
 
+	glUseProgram(prog);
 	glBindTextureUnit(0, tex);
-	glEnable(target);
 	glClear(GL_COLOR_BUFFER_BIT);
-	piglit_draw_rect_tex(0, 0, piglit_width, piglit_height, 0, 0, 1, 1);
+	piglit_draw_rect_tex(-1.0, -1.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0);
 	if (target == GL_TEXTURE_1D) {
 		pass = piglit_probe_image_ubyte(0, 0, piglit_width, 1,
 						 GL_RGBA, refImg)
@@ -100,6 +105,9 @@ subtest(GLenum target)
 			&& pass;
 	}
 
+	glUseProgram(0);
+	glDeleteProgram(prog);
+
 	if (!piglit_automatic)
 		piglit_present_results();
 
@@ -139,8 +147,6 @@ piglit_init(int argc, char **argv)
 
 	srand(0);
 
-	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
-
 	/* Make the image data for testing. */
 	refImg = random_image_data(piglit_width, piglit_height, depth);
 }
-- 
2.1.0



More information about the Piglit mailing list