summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_llvm_build.c11
-rw-r--r--src/amd/common/ac_llvm_build.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 42965b6a544..f0ab9cb1367 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -619,7 +619,8 @@ ac_build_buffer_load(struct ac_llvm_context *ctx,
LLVMValueRef soffset,
unsigned inst_offset,
unsigned glc,
- unsigned slc)
+ unsigned slc,
+ bool readonly_memory)
{
unsigned func = CLAMP(num_channels, 1, 3) - 1;
@@ -651,7 +652,13 @@ ac_build_buffer_load(struct ac_llvm_context *ctx,
type_names[func]);
return ac_emit_llvm_intrinsic(ctx, name, types[func], args,
- ARRAY_SIZE(args), AC_FUNC_ATTR_READONLY);
+ ARRAY_SIZE(args),
+ /* READNONE means writes can't
+ * affect it, while READONLY means
+ * that writes can affect it. */
+ readonly_memory ?
+ AC_FUNC_ATTR_READNONE :
+ AC_FUNC_ATTR_READONLY);
} else {
LLVMValueRef args[] = {
LLVMBuildBitCast(ctx->builder, rsrc, ctx->v16i8, ""),
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index e6bb90fd7ab..e6e4e434e2e 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -155,7 +155,8 @@ ac_build_buffer_load(struct ac_llvm_context *ctx,
LLVMValueRef soffset,
unsigned inst_offset,
unsigned glc,
- unsigned slc);
+ unsigned slc,
+ bool readonly_memory);
LLVMValueRef
ac_get_thread_id(struct ac_llvm_context *ctx);