aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2017-06-16 19:02:48 -0700
committerIan Romanick <[email protected]>2018-05-04 15:27:50 -0700
commitdf80ffa4aaf18433d8e3e97b7cb86426a1e8654b (patch)
treeeb3b452100ba8dc1cd7d4516e64af87dc07d14e9 /src
parentf2db3be6200410ffd269f8789f3c97292ce03b0f (diff)
ffvertex: Don't try to read output registers in fog calculation
Gallium drivers use _mesa_remove_output_reads() via st_program to lower output reads away. It seems better to just generate the right thing in the first place. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/ffvertex_prog.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index 1c755592bd9..dfb494bd8c1 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -1297,12 +1297,14 @@ static void build_fog( struct tnl_program *p )
struct ureg input;
switch (p->state->fog_distance_mode) {
- case FDM_EYE_RADIAL: /* Z = sqrt(Xe*Xe + Ye*Ye + Ze*Ze) */
+ case FDM_EYE_RADIAL: { /* Z = sqrt(Xe*Xe + Ye*Ye + Ze*Ze) */
+ struct ureg tmp = get_temp(p);
input = get_eye_position(p);
- emit_op2(p, OPCODE_DP3, fog, WRITEMASK_X, input, input);
- emit_op1(p, OPCODE_RSQ, fog, WRITEMASK_X, fog);
- emit_op1(p, OPCODE_RCP, fog, WRITEMASK_X, fog);
+ emit_op2(p, OPCODE_DP3, tmp, WRITEMASK_X, input, input);
+ emit_op1(p, OPCODE_RSQ, tmp, WRITEMASK_X, tmp);
+ emit_op1(p, OPCODE_RCP, fog, WRITEMASK_X, tmp);
break;
+ }
case FDM_EYE_PLANE: /* Z = Ze */
input = get_eye_position_z(p);
emit_op1(p, OPCODE_MOV, fog, WRITEMASK_X, input);