ac: fix nir_intrinsic_get_buffer_size for radeonsi
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 16 Jan 2018 07:02:37 +0000 (18:02 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 17 Jan 2018 23:25:20 +0000 (10:25 +1100)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_nir_to_llvm.c

index 25ce06138baa1a220fa5bc645e353be32393c0d2..1dc64f87cc9be064299dc9b675af524171376968 100644 (file)
@@ -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)