Mesa (main): llvmpipe: use enum blend types instead of unsigned

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 17 00:08:57 UTC 2022


Module: Mesa
Branch: main
Commit: 9c19ed1b88c9f4f2c441072e83334ca2beb39378
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c19ed1b88c9f4f2c441072e83334ca2beb39378

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jun  9 11:18:02 2022 -0600

llvmpipe: use enum blend types instead of unsigned

Signed-off-by: Brian Paul <brianp at vmware.com>
Acked-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17064>

---

 src/gallium/drivers/llvmpipe/lp_bld_blend.c         | 13 +++++++------
 src/gallium/drivers/llvmpipe/lp_bld_blend.h         | 17 ++++++++---------
 src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c |  2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend.c b/src/gallium/drivers/llvmpipe/lp_bld_blend.c
index e68e6d4a13c..aba4be5bc50 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend.c
@@ -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,
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend.h b/src/gallium/drivers/llvmpipe/lp_bld_blend.h
index adfab85dc09..824a24b12b3 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend.h
@@ -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,
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c
index 1eac0a5c891..2e3d2a8a016 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c
@@ -42,7 +42,7 @@
 
 LLVMValueRef
 lp_build_logicop(LLVMBuilderRef builder,
-                 unsigned logicop_func,
+                 enum pipe_logicop logicop_func,
                  LLVMValueRef src,
                  LLVMValueRef dst)
 {



More information about the mesa-commit mailing list