diff options
-rw-r--r-- | src/intel/compiler/brw_fs_nir.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 832821015fb..ae85834ffe6 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -2302,7 +2302,19 @@ do_untyped_vector_read(const fs_builder &bld, const fs_reg offset_reg, unsigned num_components) { - if (type_sz(dest.type) == 4) { + if (type_sz(dest.type) <= 2) { + fs_reg read_offset = bld.vgrf(BRW_REGISTER_TYPE_UD); + bld.MOV(read_offset, offset_reg); + for (unsigned i = 0; i < num_components; i++) { + fs_reg read_reg = + emit_byte_scattered_read(bld, surf_index, read_offset, + 1 /* dims */, 1, + type_sz(dest.type) * 8 /* bit_size */, + BRW_PREDICATE_NONE); + bld.MOV(offset(dest, bld, i), subscript(read_reg, dest.type, 0)); + bld.ADD(read_offset, read_offset, brw_imm_ud(type_sz(dest.type))); + } + } else if (type_sz(dest.type) == 4) { fs_reg read_result = emit_untyped_read(bld, surf_index, offset_reg, 1 /* dims */, num_components, |