aco: set dlc/glc correctly for image loads
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 20 Sep 2019 11:08:19 +0000 (12:08 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Tue, 26 Nov 2019 14:39:27 +0000 (14:39 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
src/amd/compiler/aco_instruction_selection.cpp

index de46348c0918e2eb2d5d83a5310ec95a75d38cf3..249a9d7b77b7c6af573309f3029537a26ba25587 100644 (file)
@@ -4045,6 +4045,8 @@ void visit_image_load(isel_context *ctx, nir_intrinsic_instr *instr)
          tmp = {ctx->program->allocateId(), RegClass(RegType::vgpr, num_channels)};
       load->definitions[0] = Definition(tmp);
       load->idxen = true;
+      load->glc = var->data.access & (ACCESS_VOLATILE | ACCESS_COHERENT);
+      load->dlc = load->glc && ctx->options->chip_class >= GFX10;
       load->barrier = barrier_image;
       ctx->block->instructions.emplace_back(std::move(load));
 
@@ -4068,6 +4070,7 @@ void visit_image_load(isel_context *ctx, nir_intrinsic_instr *instr)
    load->operands[1] = Operand(resource);
    load->definitions[0] = Definition(tmp);
    load->glc = var->data.access & (ACCESS_VOLATILE | ACCESS_COHERENT) ? 1 : 0;
+   load->dlc = load->glc && ctx->options->chip_class >= GFX10;
    load->dim = ac_get_image_dim(ctx->options->chip_class, dim, is_array);
    load->dmask = dmask;
    load->unrm = true;