summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-12-26 22:06:42 -0500
committerMarge Bot <eric+marge@anholt.net>2021-01-18 01:17:19 +0000
commit6682c1603ce01956b5ec10da5df69451116b74f6 (patch)
treed1bcb3d866c4d7c70139bcdd198cf1df8065b39f
parent295106c3e74b9c568a3970d9072180d12054fa9d (diff)
radeonsi: don't compute average vertex count in si_draw_vbo
It's probably not needed and we also have draw merging on gfx10, so we should be able to use total_driver_count in theory. (I may be wrong, but I don't know if having avg_direct_count really improves anything) Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8548>
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index 41dc50f68b6..26598a1ddf4 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -1648,7 +1648,6 @@ static void si_draw_vbo(struct pipe_context *ctx,
bool dispatch_prim_discard_cs = false;
bool prim_discard_cs_instancing = false;
unsigned original_index_size = index_size;
- unsigned avg_direct_count = 0;
unsigned min_direct_count = 0;
unsigned total_direct_count = 0;
@@ -1678,12 +1677,11 @@ static void si_draw_vbo(struct pipe_context *ctx,
total_direct_count += count;
min_direct_count = MIN2(min_direct_count, count);
}
- avg_direct_count = (total_direct_count / num_draws) * instance_count;
}
/* Determine if we can use the primitive discard compute shader. */
if (ALLOW_PRIM_DISCARD_CS &&
- (avg_direct_count > sctx->prim_discard_vertex_count_threshold
+ (total_direct_count > sctx->prim_discard_vertex_count_threshold
? (sctx->compute_num_verts_rejected += total_direct_count, true)
: /* Add, then return true. */
(sctx->compute_num_verts_ineligible += total_direct_count,
@@ -1769,9 +1767,9 @@ static void si_draw_vbo(struct pipe_context *ctx,
struct si_shader_selector *hw_vs;
if (NGG && !dispatch_prim_discard_cs && rast_prim == PIPE_PRIM_TRIANGLES &&
(hw_vs = si_get_vs(sctx)->cso) &&
- (avg_direct_count > hw_vs->ngg_cull_vert_threshold ||
+ (total_direct_count > hw_vs->ngg_cull_vert_threshold ||
(!index_size &&
- avg_direct_count > hw_vs->ngg_cull_nonindexed_fast_launch_vert_threshold &&
+ total_direct_count > hw_vs->ngg_cull_nonindexed_fast_launch_vert_threshold &&
prim & ((1 << PIPE_PRIM_TRIANGLES) |
(1 << PIPE_PRIM_TRIANGLE_STRIP))))) {
uint8_t ngg_culling = 0;