Module: Mesa Branch: staging/21.0 Commit: be80839ac5210c8dcd5ab2ff71044d8752bf1ce1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=be80839ac5210c8dcd5ab2ff71044d8752bf1ce1
Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Jan 20 14:10:49 2021 -0800 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.ch...@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8603> (cherry picked from commit e2500c02cc7bd429e035c5208e533e569c525b03) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_resolve.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ee3e2a8a6ef..245ee614382 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -355,7 +355,7 @@ "description": "iris: Consider resolves after changing a resource's aux state", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index 010163ad7f8..c1512122b86 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -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; } } _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit