aco: do not use the vec3 variant for stores on GFX6
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 16 Jan 2020 13:37:11 +0000 (14:37 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 20 Jan 2020 16:24:55 +0000 (16:24 +0000)
GFX6 only supports vec3 with load/store format.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3432>

src/amd/compiler/aco_instruction_selection.cpp

index 6d6d806a2d0db96e5f576088d3d1d7c85ff68693..250f7011b044d6ac55c04d2f686f45c3dff21165 100644 (file)
@@ -4501,7 +4501,8 @@ void visit_store_ssbo(isel_context *ctx, nir_intrinsic_instr *instr)
    while (writemask) {
       int start, count;
       u_bit_scan_consecutive_range(&writemask, &start, &count);
-      if (count == 3 && smem) {
+      if (count == 3 && (smem || ctx->options->chip_class == GFX6)) {
+         /* GFX6 doesn't support storing vec3, split it. */
          writemask |= 1u << (start + 2);
          count = 2;
       }
@@ -4551,7 +4552,7 @@ void visit_store_ssbo(isel_context *ctx, nir_intrinsic_instr *instr)
          case 12:
             vmem_op = aco_opcode::buffer_store_dwordx3;
             smem_op = aco_opcode::last_opcode;
-            assert(!smem);
+            assert(!smem && ctx->options->chip_class > GFX6);
             break;
          case 16:
             vmem_op = aco_opcode::buffer_store_dwordx4;