Mesa (master): aco: allow constant offsets for global/scratch instructions on GFX10

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 26 16:05:16 UTC 2019


Module: Mesa
Branch: master
Commit: 37843e454e037701feb41cc36ca501c03e62f7db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=37843e454e037701feb41cc36ca501c03e62f7db

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Wed Nov 20 14:52:15 2019 +0000

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 <pendingchaos02 at gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof at gmail.com>

---

 src/amd/compiler/aco_assembler.cpp | 5 ++++-
 src/amd/compiler/aco_ir.h          | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

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<uint32_t>& 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 */




More information about the mesa-commit mailing list