From: Brian Paul Date: Wed, 1 Apr 2009 13:35:07 +0000 (-0600) Subject: glsl: fix texgen state variable tokens in emit_statevars() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8dd6594bf1d597b883af44e5d724a181c1e2b53;p=mesa.git glsl: fix texgen state variable tokens in emit_statevars() This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays. See bug 20986. --- diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 9858a0f7fdc..83e76b77db3 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -457,28 +457,36 @@ emit_statevars(const char *name, int array_len, tokens[0] = STATE_TEXENV_COLOR; } else if (strcmp(name, "gl_EyePlaneS") == 0) { - tokens[0] = STATE_TEXGEN_EYE_S; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_S; } else if (strcmp(name, "gl_EyePlaneT") == 0) { - tokens[0] = STATE_TEXGEN_EYE_T; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_T; } else if (strcmp(name, "gl_EyePlaneR") == 0) { - tokens[0] = STATE_TEXGEN_EYE_R; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_R; } else if (strcmp(name, "gl_EyePlaneQ") == 0) { - tokens[0] = STATE_TEXGEN_EYE_Q; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_Q; } else if (strcmp(name, "gl_ObjectPlaneS") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_S; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_S; } else if (strcmp(name, "gl_ObjectPlaneT") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_T; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_T; } else if (strcmp(name, "gl_ObjectPlaneR") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_R; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_R; } else if (strcmp(name, "gl_ObjectPlaneQ") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_Q; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_Q; } else { return -1; /* invalid array name */