mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 13:50:11 +01:00
etnaviv: don't emit steering state when uniforms are unchanged
The steering bits tell the GPU which caches to invalidate on the subsequent uniform state writes. There is no point in writing those steering bits when there are no uniforms to emit. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38998>
This commit is contained in:
parent
d7d690b47f
commit
57dc4cf4fb
1 changed files with 8 additions and 10 deletions
|
|
@ -800,20 +800,18 @@ etna_emit_state(struct etna_context *ctx)
|
|||
etna_stall(stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_PE);
|
||||
}
|
||||
} else {
|
||||
/* ideally this cache would only be flushed if there are VS uniform changes */
|
||||
if (dirty & (uniform_dirty_bits | ctx->shader.vs->uniforms_dirty_bits)) {
|
||||
if (need_steering)
|
||||
etna_set_state(stream, VIVS_SH_CONTROL, 0x0);
|
||||
|
||||
if (dirty & (uniform_dirty_bits | ctx->shader.vs->uniforms_dirty_bits))
|
||||
etna_uniforms_write(ctx, ctx->shader.vs, ctx->constant_buffer[MESA_SHADER_VERTEX].cb);
|
||||
}
|
||||
|
||||
/* ideally this cache would only be flushed if there are PS uniform changes */
|
||||
if (dirty & (uniform_dirty_bits | ctx->shader.fs->uniforms_dirty_bits)) {
|
||||
if (need_steering)
|
||||
etna_set_state(stream, VIVS_SH_CONTROL, VIVS_SH_CONTROL_PS_UNIFORM);
|
||||
|
||||
if (dirty & (uniform_dirty_bits | ctx->shader.fs->uniforms_dirty_bits))
|
||||
etna_uniforms_write(ctx, ctx->shader.fs, ctx->constant_buffer[MESA_SHADER_FRAGMENT].cb);
|
||||
}
|
||||
}
|
||||
/**** End of state update ****/
|
||||
#undef EMIT_STATE
|
||||
#undef EMIT_STATE_FIXP
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue