[Piglit] [PATCH 5/6] Fix bogus texture name used in fp-kil
Chris Forbes
chrisf at ijw.co.nz
Sat Aug 25 01:12:06 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.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
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 3f35452..d9b78fe 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;
+ int 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