summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-07-03 18:53:58 +0200
committerJakob Bornecrantz <[email protected]>2009-07-03 18:53:58 +0200
commit862488075c5537b0613753b0d14c267527fc6199 (patch)
treefd4d51272c86fbc88c12e2d16649547f3ca7b8df /src/mesa/shader
parent060c7f2321f72503c14f9f3f7bb27d59d8a90224 (diff)
parent94e1117c9ba259665cd8e790369dcd4c789a2f93 (diff)
Merge branch 'mesa_7_5_branch'
Conflicts: src/mesa/main/dlist.c src/mesa/vbo/vbo_save_api.c
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/arbprogparse.c7
-rw-r--r--src/mesa/shader/programopt.c1
-rw-r--r--src/mesa/shader/slang/slang_builtin.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 7e166830fd5..bc65aba39a1 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3973,6 +3973,13 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
if (program->FogOption)
program->Base.InputsRead |= FRAG_BIT_FOGC;
+
+ /* XXX: assume that ARB fragment programs don't have access to the
+ * FrontFacing and PointCoord values stuffed into the fog
+ * coordinate in GLSL shaders.
+ */
+ if (program->Base.InputsRead & FRAG_BIT_FOGC)
+ program->UsesFogFragCoord = GL_TRUE;
if (program->Base.Instructions)
_mesa_free(program->Base.Instructions);
diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c
index f70c75cec8e..ac5fe0f691f 100644
--- a/src/mesa/shader/programopt.c
+++ b/src/mesa/shader/programopt.c
@@ -396,6 +396,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
fprog->Base.Instructions = newInst;
fprog->Base.NumInstructions = inst - newInst;
fprog->Base.InputsRead |= FRAG_BIT_FOGC;
+ fprog->UsesFogFragCoord = GL_TRUE;
/* XXX do this? fprog->FogOption = GL_NONE; */
}
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c
index 83e76b77db3..154609c26e7 100644
--- a/src/mesa/shader/slang/slang_builtin.c
+++ b/src/mesa/shader/slang/slang_builtin.c
@@ -85,7 +85,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
{ "gl_TextureMatrixTranspose", STATE_TEXTURE_MATRIX, 0 },
{ "gl_TextureMatrixInverseTranspose", STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE },
- { "gl_NormalMatrix", STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE },
+ { "gl_NormalMatrix", STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVERSE },
{ NULL, 0, 0 }
};