r600: fix clear_depth_stencil refcnt imbalance
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

After ca09c173f6, util_blitter_clear_render_target() requires
a call to util_blitter_save_fragment_constant_buffer_slot().
The r600 implementation was using the same sequence with
util_blitter_clear_depth_stencil() which does not need this
call. This was the cause of the refcnt imbalance.

For instance, this issue is triggered with:
"piglit/bin/ext_clear_texture-stencil -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: ca09c173f6 ("gallium/u_blitter: remove UTIL_BLITTER_ATTRIB_COLOR, use a constant buffer")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34292>
This commit is contained in:
Patrick Lerda 2025-03-28 13:32:23 +01:00 committed by Marge Bot
parent 4c2b2c82b0
commit 8c8b178899

View file

@ -31,7 +31,9 @@ enum r600_blitter_op /* bitmask */
R600_DECOMPRESS = R600_SAVE_FRAGMENT_STATE | R600_SAVE_FRAMEBUFFER | R600_DISABLE_RENDER_COND,
R600_COLOR_RESOLVE = R600_SAVE_FRAGMENT_STATE | R600_SAVE_FRAMEBUFFER
R600_COLOR_RESOLVE = R600_SAVE_FRAGMENT_STATE | R600_SAVE_FRAMEBUFFER,
R600_DEPTH_STENCIL = R600_SAVE_FRAGMENT_STATE | R600_SAVE_FRAMEBUFFER
};
static void r600_blitter_begin(struct pipe_context *ctx, enum r600_blitter_op op)
@ -552,7 +554,7 @@ static void r600_clear_depth_stencil(struct pipe_context *ctx,
{
struct r600_context *rctx = (struct r600_context *)ctx;
r600_blitter_begin(ctx, R600_CLEAR_SURFACE |
r600_blitter_begin(ctx, R600_DEPTH_STENCIL |
(render_condition_enabled ? 0 : R600_DISABLE_RENDER_COND));
util_blitter_clear_depth_stencil(rctx->blitter, dst, clear_flags, depth, stencil,
dstx, dsty, width, height);