summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-01-28 10:44:04 -0700
committerBrian Paul <[email protected]>2009-01-28 10:44:04 -0700
commit72f0b4a55ba36bb8571b4c11d0098361f766814e (patch)
treee1eb2886e15058c5457982cdb0d82cefbf5b67e2
parent54c62ba5c36f3e2b279151f5df851d2ceee15319 (diff)
mesa: additional GL_INVALID_OPERATION tests for texture swizzle
-rw-r--r--src/mesa/main/texparam.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 695bff00970..41c914e5b32 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -368,6 +368,11 @@ set_tex_parameteri(GLcontext *ctx,
if (ctx->Extensions.EXT_texture_swizzle) {
const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
const GLint swz = comp_to_swizzle(params[0]);
+ if (swz < 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(swizzle 0x%x)", params[0]);
+ return;
+ }
ASSERT(comp < 4);
if (swz >= 0) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -390,8 +395,8 @@ set_tex_parameteri(GLcontext *ctx,
set_swizzle_component(&texObj->_Swizzle, comp, swz);
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)",
- params[comp]);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(swizzle 0x%x)", params[comp]);
return;
}
}