summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-05-22 22:48:53 +1000
committerTimothy Arceri <timothy.arceri@collabora.com>2016-07-07 10:26:43 +1000
commit9d9b0b54cdc212c372ac67cc14d7ba1a16cc69ef (patch)
treebf614d49b68fb11fc05ef38deb251304de5b2da2 /src/mesa
parent2477e6cfada55563631c654fce9250e4fe276f0e (diff)
i965: add indirect packing support to gs load inputs
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 8b0849a7957..87ffd291451 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -2151,13 +2151,25 @@ fs_visitor::emit_gs_input_load(const fs_reg &dst,
} else {
/* Indirect indexing - use per-slot offsets as well. */
const fs_reg srcs[] = { icp_handle, indirect_offset };
+ unsigned read_components = num_components + first_component;
+ fs_reg tmp = bld.vgrf(dst.type, read_components);
fs_reg payload = bld.vgrf(BRW_REGISTER_TYPE_UD, 2);
bld.LOAD_PAYLOAD(payload, srcs, ARRAY_SIZE(srcs), 0);
-
- inst = bld.emit(SHADER_OPCODE_URB_READ_SIMD8_PER_SLOT, tmp_dst, payload);
+ if (first_component != 0) {
+ inst = bld.emit(SHADER_OPCODE_URB_READ_SIMD8_PER_SLOT, tmp,
+ payload);
+ inst->regs_written = read_components;
+ for (unsigned i = 0; i < num_components; i++) {
+ bld.MOV(offset(tmp_dst, bld, i),
+ offset(tmp, bld, i + first_component));
+ }
+ } else {
+ inst = bld.emit(SHADER_OPCODE_URB_READ_SIMD8_PER_SLOT, tmp_dst,
+ payload);
+ inst->regs_written = num_components * type_sz(tmp_dst.type) / 4;
+ }
inst->offset = base_offset;
inst->mlen = 2;
- inst->regs_written = num_components * type_sz(tmp_dst.type) / 4;
}
if (type_sz(dst.type) == 8) {