summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-15 15:30:13 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-15 15:30:13 -0600
commitb1f136dba21c688a2fa347a56ab8bf8c784dd51f (patch)
treeaf8b9d4b41a1c633e4aac2bdefbc9e8ec728cab9 /src/mesa/tnl
parentb4deb73fabf8aa545ba6ac25ca08f5d05ede2178 (diff)
Fix useabs logic in build_fog().
We always need to compute the absolute value of the fogcoord if we're passing it through for per-fragment fog.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vp_build.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index b28102b1b9..e7caa2fc1d 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -1110,8 +1110,6 @@ static void build_fog( struct tnl_program *p )
{
struct ureg fog = register_output(p, VERT_RESULT_FOGC);
struct ureg input;
- GLuint useabs = p->state->fog_source_is_depth && p->state->fog_mode &&
- (p->state->fog_mode != FOG_EXP2);
if (p->state->fog_source_is_depth) {
input = swizzle1(get_eye_position(p), Z);
@@ -1125,6 +1123,8 @@ static void build_fog( struct tnl_program *p )
STATE_FOG_PARAMS_OPTIMIZED);
struct ureg tmp = get_temp(p);
+ GLboolean useabs = (p->state->fog_mode != FOG_EXP2);
+
if (useabs) {
emit_op1(p, OPCODE_ABS, tmp, 0, input);
}
@@ -1156,7 +1156,10 @@ static void build_fog( struct tnl_program *p )
/* results = incoming fog coords (compute fog per-fragment later)
*
* KW: Is it really necessary to do anything in this case?
+ * BP: Yes, we always need to compute the absolute value, unless
+ * we want to push that down into the fragment program...
*/
+ GLboolean useabs = GL_TRUE;
emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, WRITEMASK_X, input);
}
}