i965/fs: shuffle 32bits into 64bits for doubles
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 31 Mar 2016 10:49:53 +0000 (11:49 +0100)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 17 May 2016 07:05:47 +0000 (09:05 +0200)
VS Thread Payload handles attributes in URB as vec4, no matter if they
are actually single or double precision.

So with double-precision types, value ends up in the registers split in
32bits chunks, in different positions.

We need to shuffle the chunks to get the doubles correctly.

v2:
 * Extra blank line. Add { } on if body (Ian Romanick)
 * Use dest directly (Kenneth Graunke)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 59a7a56630744f71ac22c624e6592aa6bb4d8de0..ad20dc8d92e61062413d1220743dbc91e517a60f 100644 (file)
@@ -3711,6 +3711,14 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
       for (unsigned j = 0; j < instr->num_components; j++) {
          bld.MOV(offset(dest, bld, j), offset(src, bld, j));
       }
+
+      if (type_sz(src.type) == 8) {
+         shuffle_32bit_load_result_to_64bit_data(bld,
+                                                 dest,
+                                                 retype(dest, BRW_REGISTER_TYPE_F),
+                                                 instr->num_components);
+      }
+
       break;
    }