summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/shader/arbprogparse.c7
-rw-r--r--src/mesa/shader/programopt.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index bb4c5b38d4..f5053d3289 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3922,6 +3922,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 = 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 f70c75cec8..ac5fe0f691 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; */
}