From: Eric Anholt Date: Wed, 9 Nov 2011 03:26:39 +0000 (-0800) Subject: i965/fs: Preserve the source register type when doing color writes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e988d816e16f9c0844424472d689486a833931c3;p=mesa.git 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 --- 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();