radv/aco,aco: allow SMEM SSBO loads on GFX6/7
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 25 May 2020 13:49:53 +0000 (14:49 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 24 Jun 2020 10:52:28 +0000 (10:52 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5207>

src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_instruction_selection_setup.cpp
src/amd/vulkan/radv_cmd_buffer.c

index 6a35c3188c4346120512547deb7ea864a7c736e4..f879a81c6ce91c7e3c431674553df45d26f52503 100644 (file)
@@ -5145,7 +5145,7 @@ void load_buffer(isel_context *ctx, unsigned num_components, unsigned component_
 {
    Builder bld(ctx->program, ctx->block);
 
-   bool use_smem = dst.type() != RegType::vgpr && (ctx->options->chip_class >= GFX8 || readonly) && allow_smem;
+   bool use_smem = dst.type() != RegType::vgpr && (!glc || ctx->options->chip_class >= GFX8) && allow_smem;
    if (use_smem)
       offset = bld.as_uniform(offset);
 
index dbba3d155b44da621902a415f1228a4beb89b148..d60cd69445db1a239cbeeda8a2457cfe1c8fd79c 100644 (file)
@@ -348,7 +348,7 @@ void fill_desc_set_info(isel_context *ctx, nir_function_impl *impl)
          bool glc = access & (ACCESS_VOLATILE | ACCESS_COHERENT | ACCESS_NON_READABLE);
          switch (intrin->intrinsic) {
          case nir_intrinsic_load_ssbo: {
-            if (nir_dest_is_divergent(intrin->dest) || ctx->program->chip_class < GFX8)
+            if (nir_dest_is_divergent(intrin->dest) && (!glc || ctx->program->chip_class >= GFX8))
                flags |= glc ? has_glc_vmem_load : has_nonglc_vmem_load;
             res = intrin->src[0].ssa;
             break;
index 670de040d38c45473bc38286c1fca1b5b8f7bf4e..afc90b74f7d375191cab06f6a96ce4133110498b 100644 (file)
@@ -2953,8 +2953,7 @@ radv_dst_access_flush(struct radv_cmd_buffer *cmd_buffer,
                        flush_bits |= RADV_CMD_FLAG_INV_VCACHE;
                        /* Unlike LLVM, ACO uses SMEM for SSBOs and we have to
                         * invalidate the scalar cache. */
-                       if (cmd_buffer->device->physical_device->use_aco &&
-                           cmd_buffer->device->physical_device->rad_info.chip_class >= GFX8)
+                       if (cmd_buffer->device->physical_device->use_aco)
                                flush_bits |= RADV_CMD_FLAG_INV_SCACHE;
 
                        if (!image_is_coherent)