From e988d816e16f9c0844424472d689486a833931c3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Nov 2011 19:26:39 -0800 Subject: [PATCH] i965/fs: Preserve the source register type when doing color writes. When rendering to integer color buffers, we need to be careful to use MRFs of the correct type when emitting color writes. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 15009dcc57b..3e2feafec38 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -1853,7 +1853,7 @@ fs_visitor::emit_color_write(int index, int first_color_mrf, fs_reg color) * m + 7: a1 */ inst = emit(BRW_OPCODE_MOV, - fs_reg(MRF, first_color_mrf + index * reg_width), + fs_reg(MRF, first_color_mrf + index * reg_width, color.type), color); inst->saturate = c->key.clamp_fragment_color; } else { @@ -1874,19 +1874,22 @@ fs_visitor::emit_color_write(int index, int first_color_mrf, fs_reg color) * destination + 4. */ inst = emit(BRW_OPCODE_MOV, - fs_reg(MRF, BRW_MRF_COMPR4 + first_color_mrf + index), + fs_reg(MRF, BRW_MRF_COMPR4 + first_color_mrf + index, + color.type), color); inst->saturate = c->key.clamp_fragment_color; } else { push_force_uncompressed(); - inst = emit(BRW_OPCODE_MOV, fs_reg(MRF, first_color_mrf + index), + inst = emit(BRW_OPCODE_MOV, fs_reg(MRF, first_color_mrf + index, + color.type), color); inst->saturate = c->key.clamp_fragment_color; pop_force_uncompressed(); push_force_sechalf(); color.sechalf = true; - inst = emit(BRW_OPCODE_MOV, fs_reg(MRF, first_color_mrf + index + 4), + inst = emit(BRW_OPCODE_MOV, fs_reg(MRF, first_color_mrf + index + 4, + color.type), color); inst->saturate = c->key.clamp_fragment_color; pop_force_sechalf(); -- 2.30.2