Mesa (main): ac/llvm: don't return a status from ac_cull_triangle because it's unused
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jul 8 18:55:48 UTC 2021
Module: Mesa
Branch: main
Commit: 74b33a8c377777536e7c199446e3135e67f248c9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=74b33a8c377777536e7c199446e3135e67f248c9
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Jul 6 22:30:32 2021 -0400
ac/llvm: don't return a status from ac_cull_triangle because it's unused
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11754>
---
src/amd/llvm/ac_llvm_cull.c | 40 +++++++++++++++++-----------------------
src/amd/llvm/ac_llvm_cull.h | 10 +++++-----
2 files changed, 22 insertions(+), 28 deletions(-)
diff --git a/src/amd/llvm/ac_llvm_cull.c b/src/amd/llvm/ac_llvm_cull.c
index c5ddef7bbb2..e853d921aae 100644
--- a/src/amd/llvm/ac_llvm_cull.c
+++ b/src/amd/llvm/ac_llvm_cull.c
@@ -115,20 +115,20 @@ static LLVMValueRef ac_cull_face(struct ac_llvm_context *ctx, LLVMValueRef pos[3
/* Perform view culling and small primitive elimination and return true
* if the primitive is accepted and initially_accepted == true. */
-static LLVMValueRef cull_bbox(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4],
- LLVMValueRef initially_accepted, struct ac_position_w_info *w,
- LLVMValueRef vp_scale[2], LLVMValueRef vp_translate[2],
- LLVMValueRef small_prim_precision, bool cull_view_xy,
- bool cull_view_near_z, bool cull_view_far_z, bool cull_small_prims,
- bool use_halfz_clip_space, ac_cull_accept_func accept_func,
- void *userdata)
+static void cull_bbox(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4],
+ LLVMValueRef initially_accepted, struct ac_position_w_info *w,
+ LLVMValueRef vp_scale[2], LLVMValueRef vp_translate[2],
+ LLVMValueRef small_prim_precision, bool cull_view_xy,
+ bool cull_view_near_z, bool cull_view_far_z, bool cull_small_prims,
+ bool use_halfz_clip_space, ac_cull_accept_func accept_func,
+ void *userdata)
{
LLVMBuilderRef builder = ctx->builder;
if (!cull_view_xy && !cull_view_near_z && !cull_view_far_z && !cull_small_prims) {
if (accept_func)
accept_func(ctx, initially_accepted, userdata);
- return initially_accepted;
+ return;
}
/* Skip the culling if the primitive has already been rejected or
@@ -136,7 +136,6 @@ static LLVMValueRef cull_bbox(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4
* W is negative.
*/
LLVMValueRef cond = LLVMBuildAnd(builder, initially_accepted, w->all_w_positive, "");
- LLVMValueRef accepted_var = ac_build_alloca_init(ctx, initially_accepted, "");
ac_build_ifcc(ctx, cond, 10000000 /* does this matter? */);
{
@@ -206,8 +205,6 @@ static LLVMValueRef cull_bbox(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4
if (accept_func)
accept_func(ctx, accepted, userdata);
-
- LLVMBuildStore(builder, accepted, accepted_var);
}
if (accept_func) {
/* If the caller provided a accept_func, call it in the else branch */
@@ -215,8 +212,6 @@ static LLVMValueRef cull_bbox(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4
accept_func(ctx, initially_accepted, userdata);
}
ac_build_endif(ctx, 10000000);
-
- return LLVMBuildLoad(builder, accepted_var, "");
}
/**
@@ -236,11 +231,11 @@ static LLVMValueRef cull_bbox(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4
* \param options See ac_cull_options.
* \param accept_func Callback invoked in the inner-most branch where the primitive is accepted.
*/
-LLVMValueRef ac_cull_triangle(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4],
- LLVMValueRef initially_accepted, LLVMValueRef vp_scale[2],
- LLVMValueRef vp_translate[2], LLVMValueRef small_prim_precision,
- struct ac_cull_options *options, ac_cull_accept_func accept_func,
- void *userdata)
+void ac_cull_triangle(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4],
+ LLVMValueRef initially_accepted, LLVMValueRef vp_scale[2],
+ LLVMValueRef vp_translate[2], LLVMValueRef small_prim_precision,
+ struct ac_cull_options *options, ac_cull_accept_func accept_func,
+ void *userdata)
{
struct ac_position_w_info w;
ac_analyze_position_w(ctx, pos, &w);
@@ -256,9 +251,8 @@ LLVMValueRef ac_cull_triangle(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4
"");
/* View culling and small primitive elimination. */
- accepted = cull_bbox(ctx, pos, accepted, &w, vp_scale, vp_translate, small_prim_precision,
- options->cull_view_xy, options->cull_view_near_z, options->cull_view_far_z,
- options->cull_small_prims, options->use_halfz_clip_space, accept_func,
- userdata);
- return accepted;
+ cull_bbox(ctx, pos, accepted, &w, vp_scale, vp_translate, small_prim_precision,
+ options->cull_view_xy, options->cull_view_near_z, options->cull_view_far_z,
+ options->cull_small_prims, options->use_halfz_clip_space, accept_func,
+ userdata);
}
diff --git a/src/amd/llvm/ac_llvm_cull.h b/src/amd/llvm/ac_llvm_cull.h
index 5e35111733f..676587d5b21 100644
--- a/src/amd/llvm/ac_llvm_cull.h
+++ b/src/amd/llvm/ac_llvm_cull.h
@@ -52,10 +52,10 @@ struct ac_cull_options {
typedef void (*ac_cull_accept_func)(struct ac_llvm_context *ctx, LLVMValueRef accepted,
void *userdata);
-LLVMValueRef ac_cull_triangle(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4],
- LLVMValueRef initially_accepted, LLVMValueRef vp_scale[2],
- LLVMValueRef vp_translate[2], LLVMValueRef small_prim_precision,
- struct ac_cull_options *options, ac_cull_accept_func accept_func,
- void *userdata);
+void ac_cull_triangle(struct ac_llvm_context *ctx, LLVMValueRef pos[3][4],
+ LLVMValueRef initially_accepted, LLVMValueRef vp_scale[2],
+ LLVMValueRef vp_translate[2], LLVMValueRef small_prim_precision,
+ struct ac_cull_options *options, ac_cull_accept_func accept_func,
+ void *userdata);
#endif
More information about the mesa-commit
mailing list