i965: add double support packing support to gs inputs
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 10 Jun 2016 04:23:58 +0000 (14:23 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 7 Jul 2016 00:26:43 +0000 (10:26 +1000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 87ffd291451b80cf09961bc6f7e95534b7f27f9a..1a03c0e7161b9320d91e043ee0da3ebdc114d60a 100644 (file)
@@ -2127,6 +2127,7 @@ fs_visitor::emit_gs_input_load(const fs_reg &dst,
       }
       fs_reg tmp = fs_reg(VGRF, alloc.allocate(4), dst.type);
       tmp_dst = tmp;
+      first_component = first_component / 2;
    }
 
    for (unsigned iter = 0; iter < num_iterations; iter++) {
@@ -2136,7 +2137,7 @@ fs_visitor::emit_gs_input_load(const fs_reg &dst,
             unsigned read_components = num_components + first_component;
             fs_reg tmp = bld.vgrf(dst.type, read_components);
             inst = bld.emit(SHADER_OPCODE_URB_READ_SIMD8, tmp, icp_handle);
-            inst->regs_written = read_components;
+            inst->regs_written = read_components * type_sz(tmp_dst.type) / 4;
             for (unsigned i = 0; i < num_components; i++) {
                bld.MOV(offset(tmp_dst, bld, i),
                        offset(tmp, bld, i + first_component));
@@ -2158,7 +2159,7 @@ fs_visitor::emit_gs_input_load(const fs_reg &dst,
          if (first_component != 0) {
             inst = bld.emit(SHADER_OPCODE_URB_READ_SIMD8_PER_SLOT, tmp,
                             payload);
-            inst->regs_written = read_components;
+            inst->regs_written = read_components * type_sz(tmp_dst.type) / 4;
             for (unsigned i = 0; i < num_components; i++) {
                bld.MOV(offset(tmp_dst, bld, i),
                        offset(tmp, bld, i + first_component));