diff options
author | Nicolai Hähnle <[email protected]> | 2016-03-12 21:32:34 -0500 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-03-21 15:34:25 -0500 |
commit | 5a61b428f477e7eef9f18f2fd43f661f193ece39 (patch) | |
tree | c4d5bb3d4fc55c0ef96de00a60b03087ebfe65b9 /src | |
parent | d6fa650454db5e3308a5c3618e4586a2c8f537cb (diff) |
radeonsi: implement coherent memory access (v2)
v2: set glc=1 for volatile also on buffers
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index ca90178f075..db0cc5bbf62 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2832,14 +2832,18 @@ static void image_append_args( unsigned target, bool atomic) { + const struct tgsi_full_instruction *inst = emit_data->inst; LLVMValueRef i1false = LLVMConstInt(ctx->i1, 0, 0); LLVMValueRef i1true = LLVMConstInt(ctx->i1, 1, 0); emit_data->args[emit_data->arg_count++] = i1false; /* r128 */ emit_data->args[emit_data->arg_count++] = tgsi_is_array_image(target) ? i1true : i1false; /* da */ - if (!atomic) - emit_data->args[emit_data->arg_count++] = i1false; /* glc */ + if (!atomic) { + emit_data->args[emit_data->arg_count++] = + inst->Memory.Qualifier & (TGSI_MEMORY_COHERENT | TGSI_MEMORY_VOLATILE) ? + i1true : i1false; /* glc */ + } emit_data->args[emit_data->arg_count++] = i1false; /* slc */ } @@ -2858,8 +2862,10 @@ static void buffer_append_args( { struct gallivm_state *gallivm = &ctx->radeon_bld.gallivm; struct lp_build_tgsi_context *bld_base = &ctx->radeon_bld.soa.bld_base; + const struct tgsi_full_instruction *inst = emit_data->inst; LLVMTypeRef v2i128 = LLVMVectorType(ctx->i128, 2); LLVMValueRef i1false = LLVMConstInt(ctx->i1, 0, 0); + LLVMValueRef i1true = LLVMConstInt(ctx->i1, 1, 0); rsrc = LLVMBuildBitCast(gallivm->builder, rsrc, v2i128, ""); rsrc = LLVMBuildExtractElement(gallivm->builder, rsrc, bld_base->uint_bld.one, ""); @@ -2868,8 +2874,11 @@ static void buffer_append_args( emit_data->args[emit_data->arg_count++] = rsrc; emit_data->args[emit_data->arg_count++] = index; /* vindex */ emit_data->args[emit_data->arg_count++] = bld_base->uint_bld.zero; /* voffset */ - if (!atomic) - emit_data->args[emit_data->arg_count++] = i1false; /* glc */ + if (!atomic) { + emit_data->args[emit_data->arg_count++] = + inst->Memory.Qualifier & (TGSI_MEMORY_COHERENT | TGSI_MEMORY_VOLATILE) ? + i1true : i1false; /* glc */ + } emit_data->args[emit_data->arg_count++] = i1false; /* slc */ } |