llvmpipe: rip out cylindrical wrap support
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 23 Aug 2021 12:37:42 +0000 (14:37 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 25 Aug 2021 19:37:16 +0000 (19:37 +0000)
Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12505>

src/gallium/drivers/llvmpipe/lp_bld_interp.h
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_setup.c

index f1b07873f3f13a133d4a0478ddd9b287d0d729ca..f77d2192258a630759369b969aacdc2756c1b66e 100644 (file)
@@ -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;
 };
 
 
index 0de4c33cd3b6039c8a3f546118171656d093a72e..54369ef3cd86aa8cc862843bed0bf322f85158c6 100644 (file)
@@ -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]) {
index 53ec2c1c38b53e98ac8025d6643d3ae1a79ada30..9f385a084e78b37bd6d546b1ee7151fc16591b7c 100644 (file)
@@ -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;