[Piglit] [PATCH 7/8] Fix bogus texture name used in fp-kil

Chris Forbes chrisf at ijw.co.nz
Sat Sep 1 18:17:32 PDT 2012


fp-kil assumed that `1` was an unused texture name. This isn't
true if running with -fbo, so use glGenTextures to get a name
that's really unused.

Also fixed a bogus comment.

V2: use correct type

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
---
 tests/shaders/fp-kil.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/fp-kil.c b/tests/shaders/fp-kil.c
index e154cb1..d82b59e 100644
--- a/tests/shaders/fp-kil.c
+++ b/tests/shaders/fp-kil.c
@@ -113,7 +113,7 @@ static const struct {
 		{ 0.0, 0.0, 0.0, 1.0 }
 	},
 
-	// Program 0
+	// Program 1
 	{
 		"texture #1",
 		0.125, 1.125,
@@ -264,6 +264,7 @@ void
 piglit_init(int argc, char **argv)
 {
 	int i, x, y;
+	GLuint texname;
 	GLubyte tex[4][4][4];
 
 	if (piglit_get_gl_version() < 13) {
@@ -293,9 +294,10 @@ piglit_init(int argc, char **argv)
 		}
 	}
 
+	glGenTextures(1, &texname);
 	glActiveTexture(GL_TEXTURE0);
 	glEnable(GL_TEXTURE_2D);
-	glBindTexture(GL_TEXTURE_2D, 1);
+	glBindTexture(GL_TEXTURE_2D, texname);
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0,
 	             GL_RGBA, GL_UNSIGNED_BYTE, tex);
 
-- 
1.7.12



More information about the Piglit mailing list