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:
03bc7503d471 ("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>
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);
#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,
};
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);