diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2016-05-09 10:14:48 +0200 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <siglesias@igalia.com> | 2016-05-16 09:55:33 +0200 |
commit | 66192b3c16b09fa7ba97574103fc3d883b3cbfdb (patch) | |
tree | 28633f14a7e76140f14150ec0b663a928e6acf60 | |
parent | 3cce67aff09a4c248e9a69a8b05a63ac6b3e4878 (diff) |
i965/fs: fix nir_intrinsic_store_output for doubles
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index c21c9c5db90..6cf25584103 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -3692,7 +3692,20 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr assert(const_offset && "Indirect output stores not allowed"); new_dest = offset(new_dest, bld, const_offset->u32[0]); - for (unsigned j = 0; j < instr->num_components; j++) { + unsigned num_components = instr->num_components; + unsigned bit_size = instr->src[0].is_ssa ? + instr->src[0].ssa->bit_size : instr->src[0].reg.reg->bit_size; + if (bit_size == 64) { + fs_reg tmp = + fs_reg(VGRF, alloc.allocate(2 * num_components), + BRW_REGISTER_TYPE_F); + shuffle_64bit_data_for_32bit_write( + bld, tmp, retype(src, BRW_REGISTER_TYPE_DF), num_components); + src = retype(tmp, src.type); + num_components *= 2; + } + + for (unsigned j = 0; j < num_components; j++) { bld.MOV(offset(new_dest, bld, j), offset(src, bld, j)); } break; |