summaryrefslogtreecommitdiff
path: root/src/intel/compiler/brw_fs_generator.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2021-12-20 14:49:02 -0800
committerMarge Bot <emma+marge@anholt.net>2022-01-25 22:40:44 +0000
commitd2d72fccf1bdd996e5a429e5cc20205cd110995e (patch)
tree7028e00e8c7fe534b230b0fb19ae34d4451ec097 /src/intel/compiler/brw_fs_generator.cpp
parentd1038197f31041f0ff5712bf92be63d34fb883e2 (diff)
downloadmesa-d2d72fccf1bdd996e5a429e5cc20205cd110995e.tar.gz
intel/fs: Fix destination suboffset calculations for non-trivial strides in SHUFFLE codegen.
One of the two SHUFFLE implementations wasn't taking into account the destination stride at all, and the other (more commonly used) one was taking it into account incorrectly since brw_reg::hstride represents the stride logarithmically, so we need to use a left-shift operator instead of product. Found by inspection. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14273>
Diffstat (limited to 'src/intel/compiler/brw_fs_generator.cpp')
-rw-r--r--src/intel/compiler/brw_fs_generator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp
index 2158bbad17d..cfc96570cca 100644
--- a/src/intel/compiler/brw_fs_generator.cpp
+++ b/src/intel/compiler/brw_fs_generator.cpp
@@ -631,7 +631,7 @@ fs_generator::generate_shuffle(fs_inst *inst,
*/
const unsigned i = idx.file == BRW_IMMEDIATE_VALUE ? idx.ud : 0;
struct brw_reg group_src = stride(suboffset(src, i), 0, 1, 0);
- struct brw_reg group_dst = suboffset(dst, group);
+ struct brw_reg group_dst = suboffset(dst, group << (dst.hstride - 1));
if (type_sz(src.type) > 4 && !devinfo->has_64bit_float) {
brw_MOV(p, subscript(group_dst, BRW_REGISTER_TYPE_UD, 0),
subscript(group_src, BRW_REGISTER_TYPE_UD, 0));
@@ -743,7 +743,7 @@ fs_generator::generate_shuffle(fs_inst *inst,
brw_MOV(p, byte_offset(dst_d, 4),
retype(brw_VxH_indirect(0, 4), BRW_REGISTER_TYPE_D));
} else {
- brw_MOV(p, suboffset(dst, group * dst.hstride),
+ brw_MOV(p, suboffset(dst, group << (dst.hstride - 1)),
retype(brw_VxH_indirect(0, 0), src.type));
}
}