mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
aco: consider intrinsic access in visit_{load,store}_image
radv_nir_lower_memory_model will use this. 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/4905>
This commit is contained in:
parent
cd392a10d0
commit
7a61480613
1 changed files with 5 additions and 3 deletions
|
|
@ -5861,6 +5861,7 @@ void visit_image_load(isel_context *ctx, nir_intrinsic_instr *instr)
|
|||
Temp dst = get_ssa_temp(ctx, &instr->dest.ssa);
|
||||
|
||||
memory_sync_info sync = get_memory_sync_info(instr, storage_image, 0);
|
||||
unsigned access = var->data.access | nir_intrinsic_access(instr);
|
||||
|
||||
if (dim == GLSL_SAMPLER_DIM_BUF) {
|
||||
unsigned mask = nir_ssa_def_components_read(&instr->dest.ssa);
|
||||
|
|
@ -5896,7 +5897,7 @@ 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->glc = access & (ACCESS_VOLATILE | ACCESS_COHERENT);
|
||||
load->dlc = load->glc && ctx->options->chip_class >= GFX10;
|
||||
load->sync = sync;
|
||||
ctx->block->instructions.emplace_back(std::move(load));
|
||||
|
|
@ -5924,7 +5925,7 @@ void visit_image_load(isel_context *ctx, nir_intrinsic_instr *instr)
|
|||
load->operands[1] = Operand(s4); /* no sampler */
|
||||
load->operands[2] = Operand(coords);
|
||||
load->definitions[0] = Definition(tmp);
|
||||
load->glc = var->data.access & (ACCESS_VOLATILE | ACCESS_COHERENT) ? 1 : 0;
|
||||
load->glc = 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;
|
||||
|
|
@ -5946,7 +5947,8 @@ void visit_image_store(isel_context *ctx, nir_intrinsic_instr *instr)
|
|||
Temp data = as_vgpr(ctx, get_ssa_temp(ctx, instr->src[3].ssa));
|
||||
|
||||
memory_sync_info sync = get_memory_sync_info(instr, storage_image, 0);
|
||||
bool glc = ctx->options->chip_class == GFX6 || var->data.access & (ACCESS_VOLATILE | ACCESS_COHERENT | ACCESS_NON_READABLE) ? 1 : 0;
|
||||
unsigned access = var->data.access | nir_intrinsic_access(instr);
|
||||
bool glc = ctx->options->chip_class == GFX6 || access & (ACCESS_VOLATILE | ACCESS_COHERENT | ACCESS_NON_READABLE) ? 1 : 0;
|
||||
|
||||
if (dim == GLSL_SAMPLER_DIM_BUF) {
|
||||
Temp rsrc = get_sampler_desc(ctx, nir_instr_as_deref(instr->src[0].ssa->parent_instr), ACO_DESC_BUFFER, nullptr, true, true);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue