From 192ef947a9ed277f1bcbdefbd6fe4e9c6d0d1052 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 8 Aug 2024 15:17:25 +0100 Subject: [PATCH] aco: fix printing of d16 MIMG dmask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_print_ir.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_print_ir.cpp b/src/amd/compiler/aco_print_ir.cpp index 8be9386a4d9..dde7ba349fd 100644 --- a/src/amd/compiler/aco_print_ir.cpp +++ b/src/amd/compiler/aco_print_ir.cpp @@ -532,8 +532,11 @@ print_instr_format_specific(enum amd_gfx_level gfx_level, const Instruction* ins } case Format::MIMG: { const MIMG_instruction& mimg = instr->mimg(); - unsigned identity_dmask = - !instr->definitions.empty() ? (1 << instr->definitions[0].size()) - 1 : 0xf; + unsigned identity_dmask = 0xf; + if (!instr->definitions.empty()) { + unsigned num_channels = instr->definitions[0].bytes() / (mimg.d16 ? 2 : 4); + identity_dmask = (1 << num_channels) - 1; + } if ((mimg.dmask & identity_dmask) != identity_dmask) fprintf(output, " dmask:%s%s%s%s", mimg.dmask & 0x1 ? "x" : "", mimg.dmask & 0x2 ? "y" : "", mimg.dmask & 0x4 ? "z" : "",