From: Rhys Perry Date: Wed, 20 Nov 2019 14:52:15 +0000 (+0000) Subject: aco: allow constant offsets for global/scratch instructions on GFX10 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37843e454e037701feb41cc36ca501c03e62f7db;p=mesa.git aco: allow constant offsets for global/scratch instructions on GFX10 I don't think the bug applies for global/scratch instructions and load_barycentric_at_sample selection expects this feature to work. Fixes various dEQP-VK.pipeline.multisample_interpolation.* tests on GFX10. Signed-off-by: Rhys Perry Reviewed-By: Timur Kristóf --- diff --git a/src/amd/compiler/aco_assembler.cpp b/src/amd/compiler/aco_assembler.cpp index 9b76ba740dd..4b70b2c0ac7 100644 --- a/src/amd/compiler/aco_assembler.cpp +++ b/src/amd/compiler/aco_assembler.cpp @@ -399,11 +399,14 @@ void emit_instruction(asm_context& ctx, std::vector& out, Instruction* if (ctx.chip_class <= GFX9) { assert(flat->offset <= 0x1fff); encoding |= flat->offset & 0x1fff; - } else { + } else if (instr->format == Format::FLAT) { /* GFX10 has a 12-bit immediate OFFSET field, * but it has a hw bug: it ignores the offset, called FlatSegmentOffsetBug */ assert(flat->offset == 0); + } else { + assert(flat->offset <= 0xfff); + encoding |= flat->offset & 0xfff; } if (instr->format == Format::SCRATCH) encoding |= 1 << 14; diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index a0b5698bb67..98d59ea2d63 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -844,7 +844,7 @@ struct MIMG_instruction : public Instruction { * */ struct FLAT_instruction : public Instruction { - uint16_t offset; /* Vega only */ + uint16_t offset; /* Vega/Navi only */ bool slc; /* system level coherent */ bool glc; /* globally coherent */ bool dlc; /* NAVI: device level coherent */