Mesa (main): radeonsi: wait for PS idle in si_set_framebuffer_state
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu May 19 12:39:23 UTC 2022
Module: Mesa
Branch: main
Commit: cf9ee6d43203803dfad3780582da0872ac534e27
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf9ee6d43203803dfad3780582da0872ac534e27
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Mon May 16 21:06:36 2022 +0200
radeonsi: wait for PS idle in si_set_framebuffer_state
This is needed to avoid write-after-read hazards in
texture -> render transitions.
This fixes fbo-depth tests that were flaky on GPUs (at
least sienna_cichlid and vega20).
Reviewed-by: Mihai Preda <mhpreda at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16561>
---
src/gallium/drivers/radeonsi/ci/gfx9-vega20-flakes.csv | 12 ------------
src/gallium/drivers/radeonsi/si_state.c | 5 ++++-
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/ci/gfx9-vega20-flakes.csv b/src/gallium/drivers/radeonsi/ci/gfx9-vega20-flakes.csv
index bddcf453ee6..ce8429c79ad 100644
--- a/src/gallium/drivers/radeonsi/ci/gfx9-vega20-flakes.csv
+++ b/src/gallium/drivers/radeonsi/ci/gfx9-vega20-flakes.csv
@@ -6,27 +6,15 @@ spec@!opengl 1.1 at depthstencil-default_fb-blit
spec@!opengl 1.1 at depthstencil-default_fb-copypixels samples=2
spec@!opengl 1.1 at depthstencil-default_fb-copypixels samples=4
spec@!opengl 1.1 at depthstencil-default_fb-copypixels
-spec at arb_depth_buffer_float@fbo-depth-gl_depth32f_stencil8-blit
-spec at arb_depth_buffer_float@fbo-depth-gl_depth32f_stencil8-copypixels
-spec at arb_depth_buffer_float@fbo-depth-gl_depth_component32f-blit
-spec at arb_depth_buffer_float@fbo-depth-gl_depth_component32f-copypixels
spec at arb_depth_buffer_float@fbo-depthstencil-gl_depth32f_stencil8-blit
spec at arb_depth_buffer_float@fbo-depthstencil-gl_depth32f_stencil8-copypixels
spec at arb_depth_buffer_float@fbo-stencil-gl_depth32f_stencil8-blit
-spec at arb_depth_texture@fbo-depth-gl_depth_component16-blit
-spec at arb_depth_texture@fbo-depth-gl_depth_component16-copypixels
-spec at arb_depth_texture@fbo-depth-gl_depth_component24-blit
-spec at arb_depth_texture@fbo-depth-gl_depth_component24-copypixels
-spec at arb_depth_texture@fbo-depth-gl_depth_component32-blit
-spec at arb_depth_texture@fbo-depth-gl_depth_component32-copypixels
spec at arb_texture_stencil8@fbo-stencil-blit
spec at ext_framebuffer_object@fbo-stencil-gl_stencil_index1-blit
spec at ext_framebuffer_object@fbo-stencil-gl_stencil_index16-copypixels
spec at ext_framebuffer_object@fbo-stencil-gl_stencil_index4-blit
spec at ext_framebuffer_object@fbo-stencil-gl_stencil_index4-copypixels
spec at ext_framebuffer_object@fbo-stencil-gl_stencil_index8-blit
-spec at ext_packed_depth_stencil@fbo-depth-gl_depth24_stencil8-blit
-spec at ext_packed_depth_stencil@fbo-depth-gl_depth24_stencil8-copypixels
spec at ext_packed_depth_stencil@fbo-depthstencil-gl_depth24_stencil8-blit
spec at ext_packed_depth_stencil@fbo-depthstencil-gl_depth24_stencil8-copypixels
spec at ext_packed_depth_stencil@fbo-stencil-gl_depth24_stencil8-copypixels
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index a91145a836c..3cf7fc2f214 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2971,6 +2971,9 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
* - FB write -> shader read
* - shader write -> FB read
*
+ * Wait for draws because of possible transitions:
+ * - texture -> render (eg: glBlitFramebuffer(with src=dst) then glDraw*)
+ *
* DB caches are flushed on demand (using si_decompress_textures).
*
* When MSAA is enabled, CB and TC caches are flushed on demand
@@ -2986,7 +2989,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
sctx->framebuffer.all_DCC_pipe_aligned);
}
- sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH;
+ sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH | SI_CONTEXT_PS_PARTIAL_FLUSH;
/* u_blitter doesn't invoke depth decompression when it does multiple
* blits in a row, but the only case when it matters for DB is when
More information about the mesa-commit
mailing list