From cf9ee6d43203803dfad3780582da0872ac534e27 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 16 May 2022 21:06:36 +0200 Subject: [PATCH] radeonsi: wait for PS idle in si_set_framebuffer_state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- .../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@depthstencil-default_fb-blit spec@!opengl 1.1@depthstencil-default_fb-copypixels samples=2 spec@!opengl 1.1@depthstencil-default_fb-copypixels samples=4 spec@!opengl 1.1@depthstencil-default_fb-copypixels -spec@arb_depth_buffer_float@fbo-depth-gl_depth32f_stencil8-blit -spec@arb_depth_buffer_float@fbo-depth-gl_depth32f_stencil8-copypixels -spec@arb_depth_buffer_float@fbo-depth-gl_depth_component32f-blit -spec@arb_depth_buffer_float@fbo-depth-gl_depth_component32f-copypixels spec@arb_depth_buffer_float@fbo-depthstencil-gl_depth32f_stencil8-blit spec@arb_depth_buffer_float@fbo-depthstencil-gl_depth32f_stencil8-copypixels spec@arb_depth_buffer_float@fbo-stencil-gl_depth32f_stencil8-blit -spec@arb_depth_texture@fbo-depth-gl_depth_component16-blit -spec@arb_depth_texture@fbo-depth-gl_depth_component16-copypixels -spec@arb_depth_texture@fbo-depth-gl_depth_component24-blit -spec@arb_depth_texture@fbo-depth-gl_depth_component24-copypixels -spec@arb_depth_texture@fbo-depth-gl_depth_component32-blit -spec@arb_depth_texture@fbo-depth-gl_depth_component32-copypixels spec@arb_texture_stencil8@fbo-stencil-blit spec@ext_framebuffer_object@fbo-stencil-gl_stencil_index1-blit spec@ext_framebuffer_object@fbo-stencil-gl_stencil_index16-copypixels spec@ext_framebuffer_object@fbo-stencil-gl_stencil_index4-blit spec@ext_framebuffer_object@fbo-stencil-gl_stencil_index4-copypixels spec@ext_framebuffer_object@fbo-stencil-gl_stencil_index8-blit -spec@ext_packed_depth_stencil@fbo-depth-gl_depth24_stencil8-blit -spec@ext_packed_depth_stencil@fbo-depth-gl_depth24_stencil8-copypixels spec@ext_packed_depth_stencil@fbo-depthstencil-gl_depth24_stencil8-blit spec@ext_packed_depth_stencil@fbo-depthstencil-gl_depth24_stencil8-copypixels spec@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