mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
iris: Consider resolves after changing a resource's aux state
The intention of IRIS_DIRTY_{RENDER,COMPUTE}_RESOLVES_AND_FLUSHES
is to avoid considering resolves/flushes on back to back draw calls
where nothing of significance has changed with the resources. When
anything changes that could require a resolve, we must flag those.
Those situations are:
1. Texture/image/framebuffer bindings change
(as the set of images we need to look at is now different)
2. Depth writes are enabled/disabled (the resolve code uses this)
3. The aux state for a currently bound resource changes.
We were missing this last case. In particular, one example where
we missed this was:
1. Bind a texture.
2. Clear that texture (likely blits/copies/teximage would work too)
3. Draw and sample from that texture
Clear-then-Bind would work, as binding would flag resolves as dirty.
But Bind-then-Clear doesn't work, as clear can change the aux state
of the bound texture, but wasn't flagging that anything had changed.
Technically, we could consider whether the resource whose aux state
is changing is bound for compute (and only flag COMPUTE_RESOLVES),
or bound for a 3D stage (and only flag RENDER_RESOLVES), and flag
nothing at all if it isn't bound. But we don't track that well,
and it probably isn't worth bothering. So, flag unconditionally
for now.
This does not appear to impact Piglit's drawoverhead scores.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3994
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4019
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8603>
This commit is contained in:
parent
64f55b82c7
commit
e2500c02cc
1 changed files with 3 additions and 1 deletions
|
|
@ -803,7 +803,9 @@ iris_resource_set_aux_state(struct iris_context *ice,
|
|||
if (res->aux.state[level][start_layer + a] != aux_state) {
|
||||
res->aux.state[level][start_layer + a] = aux_state;
|
||||
/* XXX: Need to track which bindings to make dirty */
|
||||
ice->state.dirty |= IRIS_DIRTY_RENDER_BUFFER;
|
||||
ice->state.dirty |= IRIS_DIRTY_RENDER_BUFFER |
|
||||
IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES |
|
||||
IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES;
|
||||
ice->state.stage_dirty |= IRIS_ALL_STAGE_DIRTY_BINDINGS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue