Mesa (master): ac/radv: remove total_vertices variable

Dave Airlie airlied at kemper.freedesktop.org
Wed Feb 21 00:02:15 UTC 2018


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Feb 19 06:53:21 2018 +0000

ac/radv: remove total_vertices variable

This just removes an unneeded variable.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/common/ac_nir_to_llvm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 1cea5486e4..88b1abd2ae 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2771,14 +2771,12 @@ static LLVMValueRef get_tcs_tes_buffer_address(struct radv_shader_context *ctx,
                                                LLVMValueRef vertex_index,
                                                LLVMValueRef param_index)
 {
-	LLVMValueRef base_addr, vertices_per_patch, num_patches, total_vertices;
+	LLVMValueRef base_addr, vertices_per_patch, num_patches;
 	LLVMValueRef param_stride, constant16;
 	LLVMValueRef rel_patch_id = get_rel_patch_id(ctx);
 
 	vertices_per_patch = unpack_param(&ctx->ac, ctx->tcs_offchip_layout, 9, 6);
 	num_patches = unpack_param(&ctx->ac, ctx->tcs_offchip_layout, 0, 9);
-	total_vertices = LLVMBuildMul(ctx->ac.builder, vertices_per_patch,
-	                              num_patches, "");
 
 	constant16 = LLVMConstInt(ctx->ac.i32, 16, false);
 	if (vertex_index) {
@@ -2788,7 +2786,8 @@ static LLVMValueRef get_tcs_tes_buffer_address(struct radv_shader_context *ctx,
 		base_addr = LLVMBuildAdd(ctx->ac.builder, base_addr,
 		                         vertex_index, "");
 
-		param_stride = total_vertices;
+		param_stride = LLVMBuildMul(ctx->ac.builder, vertices_per_patch,
+					    num_patches, "");
 	} else {
 		base_addr = rel_patch_id;
 		param_stride = num_patches;




More information about the mesa-commit mailing list