From d2540e6d4bdcfcda195f6dcf43f75b810001c227 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Fri, 30 Nov 2007 12:04:04 +0800 Subject: i965: if source depth to render target is set, it should be handled in fb_write. --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mesa/drivers/dri/i965/brw_wm_glsl.c') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 4b273fefe9..e738086fef 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -324,6 +324,20 @@ static void emit_fb_write(struct brw_wm_compile *c, nr += 8; brw_pop_insn_state(p); } + + if (c->key.source_depth_to_render_target) + { + if (c->key.computes_depth) { + src0 = get_src_reg(c, &inst->SrcReg[2], 2, 1); + brw_MOV(p, brw_message_reg(nr), src0); + } else { + src0 = get_src_reg(c, &inst->SrcReg[1], 1, 1); + brw_MOV(p, brw_message_reg(nr), src0); + } + + nr += 2; + } + fire_fb_write(c, 0, nr); } -- cgit v1.2.3