From 3d6e44fd2a1a2790263fcd6d24a1cc606fed0de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 25 May 2022 12:22:45 -0400 Subject: [PATCH] r300,r600,svga: save the FS constant buffer for u_blitter to fix a regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 773a23eb6da - gallium/u_blitter: clear color buffers using color from a constant buffer Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6548 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6539 Tested-by: Gert Wollny Reviewed-by: Charmaine Lee Tested-by: Pavel Ondračka Part-of: --- src/gallium/drivers/r300/r300_blit.c | 9 +++++++++ src/gallium/drivers/r600/r600_blit.c | 2 ++ src/gallium/drivers/svga/svga_pipe_clear.c | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index e2648e3a71f..af1abfbf4e5 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -72,6 +72,15 @@ static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op o util_blitter_save_vertex_buffer_slot(r300->blitter, r300->vertex_buffer); util_blitter_save_vertex_elements(r300->blitter, r300->velems); + struct pipe_constant_buffer cb = { + /* r300 doesn't use the size for FS at all. The shader determines it. + * Set something for blitter. + */ + .buffer_size = 4, + .user_buffer = ((struct r300_constant_buffer*)r300->fs_constants.state)->ptr, + }; + util_blitter_save_fragment_constant_buffer_slot(r300->blitter, &cb); + if (op & R300_SAVE_FRAMEBUFFER) { util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state); } diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 5f386c9ff27..257f79963b9 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -77,6 +77,8 @@ static void r600_blitter_begin(struct pipe_context *ctx, enum r600_blitter_op op util_blitter_save_depth_stencil_alpha(rctx->blitter, rctx->dsa_state.cso); util_blitter_save_stencil_ref(rctx->blitter, &rctx->stencil_ref.pipe_state); util_blitter_save_sample_mask(rctx->blitter, rctx->sample_mask.sample_mask, rctx->ps_iter_samples); + util_blitter_save_fragment_constant_buffer_slot(rctx->blitter, + &rctx->constbuf_state[PIPE_SHADER_FRAGMENT].cb[0]); } if (op & R600_SAVE_FRAMEBUFFER) diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 1e58549f45a..810dfd682c2 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -58,6 +58,8 @@ begin_blit(struct svga_context *svga) (void*)svga->curr.depth); util_blitter_save_stencil_ref(svga->blitter, &svga->curr.stencil_ref); util_blitter_save_sample_mask(svga->blitter, svga->curr.sample_mask, 0); + util_blitter_save_fragment_constant_buffer_slot(svga->blitter, + &svga->curr.constbufs[PIPE_SHADER_FRAGMENT][0]); }