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@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16561>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2022-05-16 21:06:36 +02:00 committed by Marge Bot
parent 2443054932
commit cf9ee6d432
2 changed files with 4 additions and 13 deletions

View file

@ -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

1 spec !opengl 1.1 depthstencil-default_fb-blit samples=2
6 spec !opengl 1.1 depthstencil-default_fb-copypixels samples=2
7 spec !opengl 1.1 depthstencil-default_fb-copypixels samples=4
8 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
9 spec arb_depth_buffer_float fbo-depthstencil-gl_depth32f_stencil8-blit
10 spec arb_depth_buffer_float fbo-depthstencil-gl_depth32f_stencil8-copypixels
11 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
12 spec arb_texture_stencil8 fbo-stencil-blit
13 spec ext_framebuffer_object fbo-stencil-gl_stencil_index1-blit
14 spec ext_framebuffer_object fbo-stencil-gl_stencil_index16-copypixels
15 spec ext_framebuffer_object fbo-stencil-gl_stencil_index4-blit
16 spec ext_framebuffer_object fbo-stencil-gl_stencil_index4-copypixels
17 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
18 spec ext_packed_depth_stencil fbo-depthstencil-gl_depth24_stencil8-blit
19 spec ext_packed_depth_stencil fbo-depthstencil-gl_depth24_stencil8-copypixels
20 spec ext_packed_depth_stencil fbo-stencil-gl_depth24_stencil8-copypixels

View file

@ -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