summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-06-01 01:09:57 -0400
committerMarek Olšák <marek.olsak@amd.com>2021-06-20 01:22:01 -0400
commit12d2df15f178591d45193b6cc3e093281e2ea0aa (patch)
tree3ba1f522c3aa34d1fbfc814fea5e494da34dd8fb /src/gallium
parent18055726948f24670a31bb421cc9fa07140c1a5e (diff)
ac/llvm: add a callback to ac_cull_triangle to generate code in inner-most block
This will reduce jumps in culling code. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11486>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/gfx10_shader_ngg.c2
-rw-r--r--src/gallium/drivers/radeonsi/si_compute_prim_discard.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c
index d72c72e748a..0bcd8b4b3d9 100644
--- a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c
+++ b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c
@@ -985,7 +985,7 @@ void gfx10_emit_ngg_culling_epilogue(struct ac_shader_abi *abi, unsigned max_out
/* Tell ES threads whether their vertex survived. */
ac_build_ifcc(&ctx->ac,
ac_cull_triangle(&ctx->ac, pos, ctx->ac.i1true, vp_scale, vp_translate,
- small_prim_precision, &options),
+ small_prim_precision, &options, NULL, NULL),
16003);
{
LLVMBuildStore(builder, ctx->ac.i32_1, gs_accepted);
diff --git a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
index c830a857f66..a75086606f4 100644
--- a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
+++ b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
@@ -673,7 +673,8 @@ void si_build_prim_discard_compute_shader(struct si_shader_context *ctx)
LLVMValueRef accepted =
ac_cull_triangle(&ctx->ac, pos, prim_restart_accepted, vp_scale, vp_translate,
- ac_get_arg(&ctx->ac, param_smallprim_precision), &options);
+ ac_get_arg(&ctx->ac, param_smallprim_precision), &options,
+ NULL, NULL);
ac_build_optimization_barrier(&ctx->ac, &accepted, false);
LLVMValueRef accepted_threadmask = ac_get_i1_sgpr_mask(&ctx->ac, accepted);