Mesa (master): radv: move to using common buffer load format.

Dave Airlie airlied at kemper.freedesktop.org
Mon Apr 3 19:38:01 UTC 2017


Module: Mesa
Branch: master
Commit: 5821f676eedc908bf679d130eaa3f7c79d86970d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5821f676eedc908bf679d130eaa3f7c79d86970d

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Apr  4 04:57:14 2017 +1000

radv: move to using common buffer load format.

Get rid of usage of SI.vs.load.input.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/common/ac_nir_to_llvm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 520e4cf1dc..da38331cea 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4564,7 +4564,6 @@ handle_vs_input_decl(struct nir_to_llvm_context *ctx,
 	LLVMValueRef t_list_ptr = ctx->vertex_buffers;
 	LLVMValueRef t_offset;
 	LLVMValueRef t_list;
-	LLVMValueRef args[3];
 	LLVMValueRef input;
 	LLVMValueRef buffer_index;
 	int index = variable->data.location - VERT_ATTRIB_GENERIC0;
@@ -4586,13 +4585,11 @@ handle_vs_input_decl(struct nir_to_llvm_context *ctx,
 		t_offset = LLVMConstInt(ctx->i32, index + i, false);
 
 		t_list = ac_build_indexed_load_const(&ctx->ac, t_list_ptr, t_offset);
-		args[0] = t_list;
-		args[1] = LLVMConstInt(ctx->i32, 0, false);
-		args[2] = buffer_index;
-		input = ac_build_intrinsic(&ctx->ac,
-			"llvm.SI.vs.load.input", ctx->v4f32, args, 3,
-			AC_FUNC_ATTR_READNONE | AC_FUNC_ATTR_NOUNWIND |
-			AC_FUNC_ATTR_LEGACY);
+
+		input = ac_build_buffer_load_format(&ctx->ac, t_list,
+						    buffer_index,
+						    LLVMConstInt(ctx->i32, 0, false),
+						    true);
 
 		for (unsigned chan = 0; chan < 4; chan++) {
 			LLVMValueRef llvm_chan = LLVMConstInt(ctx->i32, chan, false);




More information about the mesa-commit mailing list