From e403c1c23eac5042e04f282aa3ad8cf8621194d4 Mon Sep 17 00:00:00 2001 From: Pavel Asyutchenko Date: Thu, 7 Oct 2021 21:49:21 +0300 Subject: [PATCH] llvmpipe: remove dead args from load_unswizzled_block They were only used in fs_fb_fetch. Signed-off-by: Pavel Asyutchenko Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 38 ++++------------------ 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index f7f89ca2ed9..e775047221a 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -122,10 +122,7 @@ load_unswizzled_block(struct gallivm_state *gallivm, LLVMValueRef* dst, struct lp_type dst_type, unsigned dst_count, - unsigned dst_alignment, - LLVMValueRef x_offset, - LLVMValueRef y_offset, - bool fb_fetch_twiddle); + unsigned dst_alignment); /** * Checks if a format description is an arithmetic format * @@ -1527,10 +1524,7 @@ load_unswizzled_block(struct gallivm_state *gallivm, LLVMValueRef* dst, struct lp_type dst_type, unsigned dst_count, - unsigned dst_alignment, - LLVMValueRef x_offset, - LLVMValueRef y_offset, - bool fb_fetch_twiddle) + unsigned dst_alignment) { LLVMBuilderRef builder = gallivm->builder; unsigned row_size = dst_count / block_height; @@ -1543,28 +1537,8 @@ load_unswizzled_block(struct gallivm_state *gallivm, unsigned x = i % row_size; unsigned y = i / row_size; - if (block_height == 2 && dst_count == 8 && fb_fetch_twiddle) { - /* remap the raw slots into the fragment shader execution mode. */ - /* this math took me way too long to work out, I'm sure it's overkill. */ - x = (i & 1) + ((i >> 2) << 1); - y = (i & 2) >> 1; - } - - LLVMValueRef x_val; - if (x_offset) { - x_val = lp_build_const_int32(gallivm, x); - if (x_offset) - x_val = LLVMBuildAdd(builder, x_val, x_offset, ""); - x_val = LLVMBuildMul(builder, x_val, lp_build_const_int32(gallivm, (dst_type.width / 8) * dst_type.length), ""); - } else - x_val = lp_build_const_int32(gallivm, x * (dst_type.width / 8) * dst_type.length); - - LLVMValueRef bx = x_val; - - LLVMValueRef y_val = lp_build_const_int32(gallivm, y); - if (y_offset) - y_val = LLVMBuildAdd(builder, y_val, y_offset, ""); - LLVMValueRef by = LLVMBuildMul(builder, y_val, stride, ""); + LLVMValueRef bx = lp_build_const_int32(gallivm, x * (dst_type.width / 8) * dst_type.length); + LLVMValueRef by = LLVMBuildMul(builder, lp_build_const_int32(gallivm, y), stride, ""); LLVMValueRef gep[2]; LLVMValueRef dst_ptr; @@ -2854,7 +2828,7 @@ generate_unswizzled_blend(struct gallivm_state *gallivm, if (is_1d) { load_unswizzled_block(gallivm, color_ptr, stride, block_width, 1, - dst, ls_type, dst_count / 4, dst_alignment, NULL, NULL, false); + dst, ls_type, dst_count / 4, dst_alignment); for (i = dst_count / 4; i < dst_count; i++) { dst[i] = lp_build_undef(gallivm, ls_type); } @@ -2862,7 +2836,7 @@ generate_unswizzled_blend(struct gallivm_state *gallivm, } else { load_unswizzled_block(gallivm, color_ptr, stride, block_width, block_height, - dst, ls_type, dst_count, dst_alignment, NULL, NULL, false); + dst, ls_type, dst_count, dst_alignment); }