radeonsi: fix refcnt imbalance related to util_blitter_save_fragment_constant_buffer_slot()

Indeed, util_blitter_clear() requires a call to
util_blitter_save_fragment_constant_buffer_slot(),
but most other blitter functions do not.

For instance, this issue is triggered with:
"piglit/bin/object-namespace-pollution glDrawPixels buffer -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 03bc7503d4 ("radeonsi: save the fs constant buffer to the util blitter context")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23856>
This commit is contained in:
Patrick Lerda
2023-06-22 13:11:07 +02:00
committed by Marge Bot
parent fb5ecbb4fe
commit 80ccc3f822
3 changed files with 8 additions and 5 deletions
+4 -1
View File
@@ -37,7 +37,10 @@ void si_blitter_begin(struct si_context *sctx, enum si_blitter_op op)
if (op & SI_SAVE_FRAGMENT_STATE) {
struct pipe_constant_buffer fs_cb = {};
si_get_pipe_constant_buffer(sctx, PIPE_SHADER_FRAGMENT, 0, &fs_cb);
util_blitter_save_fragment_constant_buffer_slot(sctx->blitter, &fs_cb);
if (op & SI_SAVE_FRAGMENT_CONSTANT)
util_blitter_save_fragment_constant_buffer_slot(sctx->blitter, &fs_cb);
pipe_resource_reference(&fs_cb.buffer, NULL);
util_blitter_save_blend(sctx->blitter, sctx->queued.named.blend);
util_blitter_save_depth_stencil_alpha(sctx->blitter, sctx->queued.named.dsa);
+2 -3
View File
@@ -10,9 +10,8 @@
#include "util/u_pack_color.h"
#include "util/u_surface.h"
enum
{
SI_CLEAR = SI_SAVE_FRAGMENT_STATE,
enum {
SI_CLEAR = SI_SAVE_FRAGMENT_STATE | SI_SAVE_FRAGMENT_CONSTANT,
SI_CLEAR_SURFACE = SI_SAVE_FRAMEBUFFER | SI_SAVE_FRAGMENT_STATE,
};
+2 -1
View File
@@ -1342,7 +1342,8 @@ enum si_blitter_op /* bitmask */
SI_SAVE_TEXTURES = 1,
SI_SAVE_FRAMEBUFFER = 2,
SI_SAVE_FRAGMENT_STATE = 4,
SI_DISABLE_RENDER_COND = 8,
SI_SAVE_FRAGMENT_CONSTANT = 8,
SI_DISABLE_RENDER_COND = 16,
};
void si_blitter_begin(struct si_context *sctx, enum si_blitter_op op);