Mesa (main): llvmpipe: rip out cylindrical wrap support
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 25 20:02:02 UTC 2021
Module: Mesa
Branch: main
Commit: 6e05f6892453005997f804760e050f902c46bcd7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e05f6892453005997f804760e050f902c46bcd7
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Mon Aug 23 14:37:42 2021 +0200
llvmpipe: rip out cylindrical wrap support
Acked-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12505>
---
src/gallium/drivers/llvmpipe/lp_bld_interp.h | 3 +-
src/gallium/drivers/llvmpipe/lp_state_fs.c | 1 -
src/gallium/drivers/llvmpipe/lp_state_setup.c | 78 ---------------------------
3 files changed, 1 insertion(+), 81 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.h b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
index f1b07873f3f..f77d2192258 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
@@ -70,9 +70,8 @@ struct lp_shader_input {
uint interp:4; /* enum lp_interp */
uint usage_mask:4; /* bitmask of TGSI_WRITEMASK_x flags */
uint src_index:8; /* where to find values in incoming vertices */
- uint cyl_wrap:4; /* TGSI_CYLINDRICAL_WRAP_x flags */
uint location:2; /* TGSI_INTERPOLOATE_LOC_* */
- uint padding:10;
+ uint padding:14;
};
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 0de4c33cd3b..54369ef3cd8 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -3777,7 +3777,6 @@ llvmpipe_create_fs_state(struct pipe_context *pipe,
for (i = 0; i < shader->info.base.num_inputs; i++) {
shader->inputs[i].usage_mask = shader->info.base.input_usage_mask[i];
- shader->inputs[i].cyl_wrap = 0;
shader->inputs[i].location = shader->info.base.input_interpolate_loc[i];
switch (shader->info.base.input_interpolate[i]) {
diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c
index 53ec2c1c38b..9f385a084e7 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -471,82 +471,6 @@ apply_perspective_corr( struct gallivm_state *gallivm,
}
-/**
- * Apply cylindrical wrapping to vertex attributes if enabled.
- * Input coordinates must be in [0, 1] range, otherwise results are undefined.
- *
- * @param cyl_wrap TGSI_CYLINDRICAL_WRAP_x flags
- */
-static void
-emit_apply_cyl_wrap(struct gallivm_state *gallivm,
- struct lp_setup_args *args,
- uint cyl_wrap,
- LLVMValueRef attribv[3])
-
-{
- LLVMBuilderRef builder = gallivm->builder;
- struct lp_type type = args->bld.type;
- LLVMTypeRef float_vec_type = args->bld.vec_type;
- LLVMValueRef pos_half;
- LLVMValueRef neg_half;
- LLVMValueRef cyl_mask;
- LLVMValueRef offset;
- LLVMValueRef delta;
- LLVMValueRef one;
-
- if (!cyl_wrap)
- return;
-
- /* Constants */
- pos_half = lp_build_const_vec(gallivm, type, +0.5f);
- neg_half = lp_build_const_vec(gallivm, type, -0.5f);
- cyl_mask = lp_build_const_mask_aos(gallivm, type, cyl_wrap, 4);
-
- one = lp_build_const_vec(gallivm, type, 1.0f);
- one = LLVMBuildBitCast(builder, one, lp_build_int_vec_type(gallivm, type), "");
- one = LLVMBuildAnd(builder, one, cyl_mask, "");
-
- /* Edge v0 -> v1 */
- delta = LLVMBuildFSub(builder, attribv[1], attribv[0], "");
-
- offset = lp_build_compare(gallivm, type, PIPE_FUNC_GREATER, delta, pos_half);
- offset = LLVMBuildAnd(builder, offset, one, "");
- offset = LLVMBuildBitCast(builder, offset, float_vec_type, "");
- attribv[0] = LLVMBuildFAdd(builder, attribv[0], offset, "");
-
- offset = lp_build_compare(gallivm, type, PIPE_FUNC_LESS, delta, neg_half);
- offset = LLVMBuildAnd(builder, offset, one, "");
- offset = LLVMBuildBitCast(builder, offset, float_vec_type, "");
- attribv[1] = LLVMBuildFAdd(builder, attribv[1], offset, "");
-
- /* Edge v1 -> v2 */
- delta = LLVMBuildFSub(builder, attribv[2], attribv[1], "");
-
- offset = lp_build_compare(gallivm, type, PIPE_FUNC_GREATER, delta, pos_half);
- offset = LLVMBuildAnd(builder, offset, one, "");
- offset = LLVMBuildBitCast(builder, offset, float_vec_type, "");
- attribv[1] = LLVMBuildFAdd(builder, attribv[1], offset, "");
-
- offset = lp_build_compare(gallivm, type, PIPE_FUNC_LESS, delta, neg_half);
- offset = LLVMBuildAnd(builder, offset, one, "");
- offset = LLVMBuildBitCast(builder, offset, float_vec_type, "");
- attribv[2] = LLVMBuildFAdd(builder, attribv[2], offset, "");
-
- /* Edge v2 -> v0 */
- delta = LLVMBuildFSub(builder, attribv[0], attribv[2], "");
-
- offset = lp_build_compare(gallivm, type, PIPE_FUNC_GREATER, delta, pos_half);
- offset = LLVMBuildAnd(builder, offset, one, "");
- offset = LLVMBuildBitCast(builder, offset, float_vec_type, "");
- attribv[2] = LLVMBuildFAdd(builder, attribv[2], offset, "");
-
- offset = lp_build_compare(gallivm, type, PIPE_FUNC_LESS, delta, neg_half);
- offset = LLVMBuildAnd(builder, offset, one, "");
- offset = LLVMBuildBitCast(builder, offset, float_vec_type, "");
- attribv[0] = LLVMBuildFAdd(builder, attribv[0], offset, "");
-}
-
-
/**
* Compute the inputs-> dadx, dady, a0 values.
*/
@@ -575,13 +499,11 @@ emit_tri_coef( struct gallivm_state *gallivm,
case LP_INTERP_LINEAR:
load_attribute(gallivm, args, key, key->inputs[slot].src_index, attribs);
- emit_apply_cyl_wrap(gallivm, args, key->inputs[slot].cyl_wrap, attribs);
emit_linear_coef(gallivm, args, slot+1, attribs);
break;
case LP_INTERP_PERSPECTIVE:
load_attribute(gallivm, args, key, key->inputs[slot].src_index, attribs);
- emit_apply_cyl_wrap(gallivm, args, key->inputs[slot].cyl_wrap, attribs);
apply_perspective_corr(gallivm, args, slot+1, attribs);
emit_linear_coef(gallivm, args, slot+1, attribs);
break;
More information about the mesa-commit
mailing list