[Piglit] [PATCH 1/4] textureSize: Fix filter setup so that integer rect textures are complete.

Eric Anholt eric at anholt.net
Fri Apr 13 16:35:31 PDT 2012


We were leaving things as linear filtering, which is invalid for
integer textures.
---
 tests/texturing/shaders/textureSize.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/texturing/shaders/textureSize.c b/tests/texturing/shaders/textureSize.c
index cfcf8d1..ec91878 100644
--- a/tests/texturing/shaders/textureSize.c
+++ b/tests/texturing/shaders/textureSize.c
@@ -151,11 +151,15 @@ generate_texture()
 
 	glGenTextures(1, &tex);
 	glBindTexture(target, tex);
-	if (target != GL_TEXTURE_RECTANGLE) {
+	if (target == GL_TEXTURE_RECTANGLE) {
+		glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+		glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+	} else {
 		glTexParameteri(target, GL_TEXTURE_MIN_FILTER,
 				GL_NEAREST_MIPMAP_NEAREST);
 		glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	}
+
 	glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 	glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
-- 
1.7.10



More information about the Piglit mailing list