aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_mesa_to_tgsi.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-07-23 13:39:36 -0600
committerBrian Paul <[email protected]>2010-07-23 13:42:06 -0600
commite393350904a48d332d832881af9549400194608c (patch)
tree8a8096b511194fed04e95da162ee85f9ecdba73d /src/mesa/state_tracker/st_mesa_to_tgsi.c
parentc65f4fd5ae2ba4ac36d9bd86cdc492df0f1da1b3 (diff)
st/mesa: fix bug in emit_adjusted_wpos()
If we bias x,y we still need to pass through z,w in case the shader reads gl_FragCoord.z or .w. Fixes fd.o bug 29183 (piglit glsl-bug-22603). NOTE: This is a candidate for the 7.8 branch.
Diffstat (limited to 'src/mesa/state_tracker/st_mesa_to_tgsi.c')
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index bacd091853b..686ccb97344 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -738,9 +738,12 @@ emit_adjusted_wpos( struct st_translate *t,
struct ureg_dst wpos_temp = ureg_DECL_temporary(ureg);
struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]];
+ /* Note that we bias X and Y and pass Z and W through unchanged.
+ * The shader might also use gl_FragCoord.w and .z.
+ */
ureg_ADD(ureg,
- ureg_writemask(wpos_temp, TGSI_WRITEMASK_X | TGSI_WRITEMASK_Y),
- wpos_input, ureg_imm1f(ureg, value));
+ ureg_writemask(wpos_temp, TGSI_WRITEMASK_XYZW),
+ wpos_input, ureg_imm4f(ureg, value, value, 0.0f, 0.0f));
t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp);
}