Mesa (main): radeonsi: remove the Z culling option from the primitive discard CS
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jun 21 19:17:04 UTC 2021
Module: Mesa
Branch: main
Commit: fc95ba6c86f97876651b80150b424b179ba87d34
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc95ba6c86f97876651b80150b424b179ba87d34
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sun May 30 20:29:29 2021 -0400
radeonsi: remove the Z culling option from the primitive discard CS
Not useful.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11102>
---
src/gallium/drivers/radeonsi/si_compute_prim_discard.c | 10 ----------
src/gallium/drivers/radeonsi/si_shader.c | 2 --
src/gallium/drivers/radeonsi/si_shader.h | 2 --
3 files changed, 14 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
index a75086606f4..84ebad0661f 100644
--- a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
+++ b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
@@ -157,8 +157,6 @@
#define THREADGROUPS_PER_CU 1 /* TGs to launch on 1 CU before going onto the next, max 8 */
#define MAX_WAVES_PER_SH 0 /* no limit */
#define INDEX_STORES_USE_SLC 1 /* don't cache indices if L2 is full */
-/* Don't cull Z. We already do (W < 0) culling for primitives behind the viewer. */
-#define CULL_Z 0
/* 0 = unordered memory counter, 1 = unordered GDS counter, 2 = ordered GDS counter */
#define VERTEX_COUNTER_GDS_MODE 2
#define GDS_SIZE_UNORDERED (4 * 1024) /* only for the unordered GDS counter */
@@ -664,12 +662,9 @@ void si_build_prim_discard_compute_shader(struct si_shader_context *ctx)
options.cull_front = key->opt.cs_cull_front;
options.cull_back = key->opt.cs_cull_back;
options.cull_view_xy = true;
- options.cull_view_near_z = CULL_Z && key->opt.cs_cull_z;
- options.cull_view_far_z = CULL_Z && key->opt.cs_cull_z;
options.cull_small_prims = true;
options.cull_zero_area = true;
options.cull_w = true;
- options.use_halfz_clip_space = key->opt.cs_halfz_clip_space;
LLVMValueRef accepted =
ac_cull_triangle(&ctx->ac, pos, prim_restart_accepted, vp_scale, vp_translate,
@@ -878,11 +873,6 @@ static bool si_shader_select_prim_discard_cs(struct si_context *sctx,
key.opt.cs_cull_back = sctx->viewport0_y_inverted ? rs->cull_front : rs->cull_back;
}
- if (!rs->depth_clamp_any && CULL_Z) {
- key.opt.cs_cull_z = 1;
- key.opt.cs_halfz_clip_space = rs->clip_halfz;
- }
-
sctx->cs_prim_discard_state.cso = sctx->shader.vs.cso;
sctx->cs_prim_discard_state.current = NULL;
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index ab50dbd728e..d4482b72d3c 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1192,8 +1192,6 @@ static void si_dump_shader_key(const struct si_shader *shader, FILE *f)
fprintf(f, " opt.cs_need_correct_orientation = %u\n", key->opt.cs_need_correct_orientation);
fprintf(f, " opt.cs_cull_front = %u\n", key->opt.cs_cull_front);
fprintf(f, " opt.cs_cull_back = %u\n", key->opt.cs_cull_back);
- fprintf(f, " opt.cs_cull_z = %u\n", key->opt.cs_cull_z);
- fprintf(f, " opt.cs_halfz_clip_space = %u\n", key->opt.cs_halfz_clip_space);
break;
case MESA_SHADER_TESS_CTRL:
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 222a46ccde4..f6681f4ebea 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -694,8 +694,6 @@ struct si_shader_key {
unsigned cs_need_correct_orientation : 1;
unsigned cs_cull_front : 1;
unsigned cs_cull_back : 1;
- unsigned cs_cull_z : 1;
- unsigned cs_halfz_clip_space : 1;
/* VS and TCS have the same number of patch vertices. */
unsigned same_patch_vertices:1;
More information about the mesa-commit
mailing list