ac/nir: set amdgpu.uniform and invariant.load for SSBOs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 24 Jan 2018 22:26:21 +0000 (23:26 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Jan 2018 11:14:28 +0000 (12:14 +0100)
For descriptors.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 7425f0af20c1a0dd4ceaaf6c3a06956f3fe74d56..35f3c587228bac33705c59baedc8fb68b7a3a0ca 100644 (file)
@@ -4561,8 +4561,14 @@ static LLVMValueRef radv_load_ssbo(struct ac_shader_abi *abi,
                                   LLVMValueRef buffer_ptr, bool write)
 {
        struct nir_to_llvm_context *ctx = nir_to_llvm_context_from_abi(abi);
+       LLVMValueRef result;
+
+       LLVMSetMetadata(buffer_ptr, ctx->ac.uniform_md_kind, ctx->ac.empty_md);
 
-       return LLVMBuildLoad(ctx->builder, buffer_ptr, "");
+       result = LLVMBuildLoad(ctx->builder, buffer_ptr, "");
+       LLVMSetMetadata(result, ctx->ac.invariant_load_md_kind, ctx->ac.empty_md);
+
+       return result;
 }
 
 static LLVMValueRef radv_load_ubo(struct ac_shader_abi *abi, LLVMValueRef buffer_ptr)