zink: always flush clears when doing single-aspect blit to avoid data loss

if doing e.g., clear(DEPTH|STENCIL) -> blit(DEPTH), the stencil clear would
previously have been discarded

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37057>
This commit is contained in:
Mike Blumenkrantz 2025-08-28 07:55:36 -04:00 committed by Marge Bot
parent 817077276a
commit e83c7f2912

View file

@ -16,7 +16,10 @@
static void
apply_dst_clears(struct zink_context *ctx, const struct pipe_blit_info *info, bool discard_only)
{
if (info->scissor_enable) {
if (util_format_get_mask(info->dst.format) != info->mask) {
/* need to flush z/s clears before doing single-aspect blit to avoid data loss */
zink_fb_clears_apply_region(ctx, info->dst.resource, zink_rect_from_box(&info->dst.box), info->dst.box.z, info->dst.box.depth);
} else if (info->scissor_enable) {
struct u_rect rect = { info->scissor.minx, info->scissor.maxx,
info->scissor.miny, info->scissor.maxy };
zink_fb_clears_apply_or_discard(ctx, info->dst.resource, rect, info->dst.box.z, info->dst.box.depth, discard_only);