From 610daa3166e5e34b2f8e2b66d5cf829a5fcf2a01 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 24 Aug 2022 11:46:45 -0700 Subject: [PATCH] intel/fs/xe2+: Fix payload layout of sampler messages for Xe2 reg size Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_lower_logical_sends.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/intel/compiler/brw_lower_logical_sends.cpp b/src/intel/compiler/brw_lower_logical_sends.cpp index 5788a7bfd65..3cd36fa233f 100644 --- a/src/intel/compiler/brw_lower_logical_sends.cpp +++ b/src/intel/compiler/brw_lower_logical_sends.cpp @@ -823,7 +823,7 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op, brw_reg_type_from_bit_size(payload_type_bit_size, BRW_REGISTER_TYPE_D); unsigned reg_width = bld.dispatch_width() / 8; unsigned header_size = 0, length = 0; - fs_reg sources[MAX_SAMPLER_MESSAGE_SIZE]; + fs_reg sources[1 + MAX_SAMPLER_MESSAGE_SIZE]; for (unsigned i = 0; i < ARRAY_SIZE(sources); i++) sources[i] = bld.vgrf(payload_type); @@ -846,8 +846,8 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op, * the header. */ fs_reg header = retype(sources[0], BRW_REGISTER_TYPE_UD); - header_size = 1; - length++; + for (header_size = 0; header_size < reg_unit(devinfo); header_size++) + sources[length++] = byte_offset(header, REG_SIZE * header_size); /* If we're requesting fewer than four channels worth of response, * and we have an explicit header, we need to set up the sampler @@ -864,7 +864,7 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op, inst->offset |= 1 << 23; /* g0.2 bit23 : Pixel Null Mask Enable */ /* Build the actual header */ - const fs_builder ubld = bld.exec_all().group(8, 0); + const fs_builder ubld = bld.exec_all().group(8 * reg_unit(devinfo), 0); const fs_builder ubld1 = ubld.group(1, 0); ubld.MOV(header, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UD)); if (inst->offset) { @@ -1133,7 +1133,7 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op, */ fs_inst *load_payload_inst = emit_load_payload_with_padding(bld, src_payload, sources, length, - header_size, REG_SIZE); + header_size, REG_SIZE * reg_unit(devinfo)); unsigned mlen = load_payload_inst->size_written / REG_SIZE; unsigned simd_mode = 0; if (payload_type_bit_size == 16) {