llvmpipe: use enum blend types instead of unsigned
authorBrian Paul <brianp@vmware.com>
Thu, 9 Jun 2022 17:18:02 +0000 (11:18 -0600)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Jun 2022 23:46:23 +0000 (23:46 +0000)
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17064>

src/gallium/drivers/llvmpipe/lp_bld_blend.c
src/gallium/drivers/llvmpipe/lp_bld_blend.h
src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c

index e68e6d4..aba4be5 100644 (file)
@@ -43,7 +43,7 @@
  * Is (a OP b) == (b OP a)?
  */
 boolean
-lp_build_blend_func_commutative(unsigned func)
+lp_build_blend_func_commutative(enum pipe_blend_func func)
 {
    switch (func) {
    case PIPE_BLEND_ADD:
@@ -64,7 +64,8 @@ lp_build_blend_func_commutative(unsigned func)
  * Whether the blending functions are the reverse of each other.
  */
 boolean
-lp_build_blend_func_reverse(unsigned rgb_func, unsigned alpha_func)
+lp_build_blend_func_reverse(enum pipe_blend_func rgb_func,
+                            enum pipe_blend_func alpha_func)
 {
    if (rgb_func == alpha_func)
       return FALSE;
@@ -145,7 +146,7 @@ lp_build_mul_norm_expand(struct lp_build_context *bld,
  */
 LLVMValueRef
 lp_build_blend_func(struct lp_build_context *bld,
-                    unsigned func,
+                    enum pipe_blend_func func,
                     LLVMValueRef term1,
                     LLVMValueRef term2)
 {
@@ -189,9 +190,9 @@ lp_build_blend_func(struct lp_build_context *bld,
  */
 LLVMValueRef
 lp_build_blend(struct lp_build_context *bld,
-               unsigned func,
-               unsigned factor_src,
-               unsigned factor_dst,
+               enum pipe_blend_func func,
+               enum pipe_blendfactor factor_src,
+               enum pipe_blendfactor factor_dst,
                LLVMValueRef src,
                LLVMValueRef dst,
                LLVMValueRef src_factor,
index adfab85..824a24b 100644 (file)
@@ -43,9 +43,9 @@ struct lp_build_mask_context;
 
 LLVMValueRef
 lp_build_blend(struct lp_build_context *bld,
-               unsigned func,
-               unsigned factor_src,
-               unsigned factor_dst,
+               enum pipe_blend_func func,
+               enum pipe_blendfactor factor_src,
+               enum pipe_blendfactor factor_dst,
                LLVMValueRef src,
                LLVMValueRef dst,
                LLVMValueRef src_factor,
@@ -80,25 +80,24 @@ lp_build_blend_aos(struct gallivm_state *gallivm,
  */
 LLVMValueRef
 lp_build_logicop(LLVMBuilderRef builder,
-                 unsigned logicop_func,
+                 enum pipe_logicop logicop_func,
                  LLVMValueRef src,
                  LLVMValueRef dst);
 
 
 LLVMValueRef
 lp_build_blend_func(struct lp_build_context *bld,
-                    unsigned func,
+                    enum pipe_blend_func func,
                     LLVMValueRef term1,
                     LLVMValueRef term2);
 
 
 boolean
-lp_build_blend_func_reverse(unsigned rgb_func,
-                            unsigned alpha_func);
-
+lp_build_blend_func_reverse(enum pipe_blend_func rgb_func,
+                            enum pipe_blend_func alpha_func);
 
 boolean
-lp_build_blend_func_commutative(unsigned func);
+lp_build_blend_func_commutative(enum pipe_blend_func func);
 
 void
 lp_build_alpha_to_coverage(struct gallivm_state *gallivm,
index 1eac0a5..2e3d2a8 100644 (file)
@@ -42,7 +42,7 @@
 
 LLVMValueRef
 lp_build_logicop(LLVMBuilderRef builder,
-                 unsigned logicop_func,
+                 enum pipe_logicop logicop_func,
                  LLVMValueRef src,
                  LLVMValueRef dst)
 {