diff options
author | Eric Anholt <eric@anholt.net> | 2009-11-13 14:45:29 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-11-13 14:45:29 -0800 |
commit | 3d36d6b4cf735e93a6ae5eadf28e671252fb5303 (patch) | |
tree | 429a4ad66dfcea3a4d3b9c1f3135425250eec75b /src/mesa/drivers/dri/i965/brw_wm_emit.c | |
parent | 99077e77927ec26edf85bfef81a6d433171c3a1e (diff) | |
parent | 514544f373b6e6fae11b7b4426949b8ad64c441b (diff) |
Merge remote branch 'origin/mesa_7_6_branch'
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_emit.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_emit.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index abad5d2692..d91fad0f45 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -855,22 +855,32 @@ static void emit_tex( struct brw_wm_compile *c, abort(); } - if (inst->tex_shadow) { - nr = 4; - emit |= WRITEMASK_W; - } + /* For shadow comparisons, we have to supply u,v,r. */ + if (inst->tex_shadow) + nr = 3; msgLength = 1; for (i = 0; i < nr; i++) { - static const GLuint swz[4] = {0,1,2,2}; - if (emit & (1<<i)) - brw_MOV(p, brw_message_reg(msgLength+1), arg[swz[i]]); + if (emit & (1<<i)) + brw_MOV(p, brw_message_reg(msgLength+1), arg[i]); else brw_MOV(p, brw_message_reg(msgLength+1), brw_imm_f(0)); msgLength += 2; } + /* Fill in the cube map array index value. */ + if (BRW_IS_IGDNG(p->brw) && inst->tex_shadow) { + brw_MOV(p, brw_message_reg(msgLength+1), brw_imm_f(0)); + msgLength += 2; + } + + /* Fill in the shadow comparison reference value. */ + if (inst->tex_shadow) { + brw_MOV(p, brw_message_reg(msgLength+1), arg[2]); + msgLength += 2; + } + responseLength = 8; /* always */ if (BRW_IS_IGDNG(p->brw)) { |