diff options
author | Rob Clark <[email protected]> | 2020-04-16 10:18:29 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-30 20:03:17 +0000 |
commit | 89dbdb806faaf1a4b3da0ce0ab597f9ced40d549 (patch) | |
tree | dd30f9ce60419568d38d73de9430a8a200371d57 /src/gallium | |
parent | f583dc68e5586fd468475ae833ee3ce8fab5a95b (diff) |
freedreno/a6xx: avoid unnecessary clearing VS DP state
If there is no (potentially unflushed) VS driver-param state, we don't
need to emit a DISABLE on each frame. So avoid that to reduce CP
overhead.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4813>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_context.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_context.h b/src/gallium/drivers/freedreno/a6xx/fd6_context.h index 92afa3bf6aa..876017e2570 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_context.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_context.h @@ -78,6 +78,9 @@ struct fd6_context { */ struct ir3_shader_key last_key; + /* Is there current VS driver-param state set? */ + bool has_dp_state; + /* number of active samples-passed queries: */ int samples_passed_queries; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c index 9295175404d..32ac478dfda 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c @@ -915,6 +915,7 @@ void fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit) { struct fd_context *ctx = emit->ctx; + struct fd6_context *fd6_ctx = fd6_context(ctx); struct pipe_framebuffer_state *pfb = &ctx->batch->framebuffer; const struct fd6_program_state *prog = fd6_emit_get_prog(emit); const struct ir3_shader_variant *vs = emit->vs; @@ -1067,8 +1068,10 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit) ctx->batch->submit, IR3_DP_VS_COUNT * 4, FD_RINGBUFFER_STREAMING); ir3_emit_vs_driver_params(vs, dpconstobj, ctx, emit->info); fd6_emit_take_group(emit, dpconstobj, FD6_GROUP_VS_DRIVER_PARAMS, ENABLE_ALL); - } else { + fd6_ctx->has_dp_state = true; + } else if (fd6_ctx->has_dp_state) { fd6_emit_take_group(emit, NULL, FD6_GROUP_VS_DRIVER_PARAMS, ENABLE_ALL); + fd6_ctx->has_dp_state = false; } struct ir3_stream_output_info *info = &fd6_last_shader(prog)->shader->stream_output; |