diff options
author | Samuel Pitoiset <[email protected]> | 2018-01-24 23:26:20 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-01-26 12:14:28 +0100 |
commit | 49b0a140a731069e0e4959c65bfd1b597a4fb141 (patch) | |
tree | 856874af3ed19ddd588af8fc20358c57c20dfd96 | |
parent | b453f38a47d12fb5600472367f0bde2d6a403098 (diff) |
ac/nir: set amdgpu.uniform and invariant.load for UBOs
UBOs are constants buffers.
Cc: "18.0" <[email protected]>
Fixes: 41c36c45 ("amd/common: use ac_build_buffer_load() for emitting UBO loads")
Signed-off-by: Samuel Pitoiset <[email protected]>
Tested-by: Alex Smith <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 6833439cc12..7425f0af20c 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4568,8 +4568,14 @@ static LLVMValueRef radv_load_ssbo(struct ac_shader_abi *abi, static LLVMValueRef radv_load_ubo(struct ac_shader_abi *abi, LLVMValueRef buffer_ptr) { struct nir_to_llvm_context *ctx = nir_to_llvm_context_from_abi(abi); + LLVMValueRef result; - return LLVMBuildLoad(ctx->builder, buffer_ptr, ""); + LLVMSetMetadata(buffer_ptr, ctx->ac.uniform_md_kind, ctx->ac.empty_md); + + result = LLVMBuildLoad(ctx->builder, buffer_ptr, ""); + LLVMSetMetadata(result, ctx->ac.invariant_load_md_kind, ctx->ac.empty_md); + + return result; } static LLVMValueRef radv_get_sampler_desc(struct ac_shader_abi *abi, |