diff options
author | Zou Nan hai <nanhai.zou@intel.com> | 2007-10-09 14:14:59 +0800 |
---|---|---|
committer | Zou Nan hai <nanhai.zou@intel.com> | 2007-10-09 14:14:59 +0800 |
commit | 82d4aa40551fe86a04346c3eea944f8ce7ae8d28 (patch) | |
tree | dcdc1746c21db6a90f286d04996d79531b16dcb1 | |
parent | ac985708f4820173bdc4509d032bdabeb93a0590 (diff) |
shadow sampler fix.
1. spec requite result (0, 0, 0, 1) instead of (0, 0, 0, 0)
2. support shadow sampler in simd8
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_emit.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_glsl.c | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 5660b55516..1f7158f7a7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -702,6 +702,8 @@ static void emit_tex( struct brw_wm_compile *c, msgLength, 0); + if (shadow) + brw_MOV(p, dst[3], brw_imm_f(1.0)); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 58cdf72e37..8133c384f3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1027,8 +1027,10 @@ static void emit_tex(struct brw_wm_compile *c, GLuint msg_len; GLuint i, nr; GLuint emit; + GLboolean shadow = (c->key.shadowtex_mask & (1<<inst->TexSrcUnit)) ? 1 : 0; payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); + for (i = 0; i < 4; i++) dst[i] = get_dst_reg(c, inst, i, 1); for (i = 0; i < 4; i++) @@ -1061,6 +1063,11 @@ static void emit_tex(struct brw_wm_compile *c, msg_len += 1; } + if (shadow) { + brw_MOV(p, brw_message_reg(5), brw_imm_f(0)); + brw_MOV(p, brw_message_reg(6), src[2]); + } + brw_SAMPLE(p, retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), 1, @@ -1070,8 +1077,11 @@ static void emit_tex(struct brw_wm_compile *c, inst->DstReg.WriteMask, BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE, 4, - 4, + shadow ? 6 : 4, 0); + + if (shadow) + brw_MOV(p, dst[3], brw_imm_f(1.0)); } static void post_wm_emit( struct brw_wm_compile *c ) |