From: Timothy Arceri Date: Tue, 16 Jan 2018 07:02:37 +0000 (+1100) Subject: ac: fix nir_intrinsic_get_buffer_size for radeonsi X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=409e15f26fd245dfa6645214c433cfe4e7b9a988;p=mesa.git ac: fix nir_intrinsic_get_buffer_size for radeonsi Reviewed-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 25ce06138ba..1dc64f87cc9 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -2404,9 +2404,9 @@ static LLVMValueRef visit_load_push_constant(struct nir_to_llvm_context *ctx, static LLVMValueRef visit_get_buffer_size(struct ac_nir_context *ctx, const nir_intrinsic_instr *instr) { - LLVMValueRef ptr = get_src(ctx, instr->src[0]); + LLVMValueRef index = get_src(ctx, instr->src[0]); - return get_buffer_size(ctx, LLVMBuildLoad(ctx->ac.builder, ptr, ""), false); + return get_buffer_size(ctx, ctx->abi->load_ssbo(ctx->abi, index, false), false); } static void visit_store_ssbo(struct ac_nir_context *ctx, nir_intrinsic_instr *instr)