From 2b6e7c4609bea125201df7ba2a2a43d6ebabdd85 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 17 Jun 2025 14:03:15 -0400 Subject: [PATCH] tc: add #define to disable strict resolve merging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this enables merging fb resolves which do not cover the full dst Acked-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 4 ++++ src/gallium/auxiliary/util/u_threaded_context.h | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 782c65bc17e..58ff1ab090e 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1482,8 +1482,10 @@ tc_set_framebuffer_state(struct pipe_context *_pipe, } tc->nr_cbufs = nr_cbufs; tc->fb_layers = util_framebuffer_get_num_layers(fb); +#if TC_RESOLVE_STRICT tc->fb_width = fb->width; tc->fb_height = fb->height; +#endif if (tc->options.parse_renderpass_info) { /* store existing zsbuf data for possible persistence */ uint8_t zsbuf = tc->renderpass_info_recording->has_draw ? @@ -4553,8 +4555,10 @@ tc_blit(struct pipe_context *_pipe, const struct pipe_blit_info *info) info->src.box.width != info->dst.box.width || info->src.box.height != info->dst.box.height || info->src.box.depth != info->dst.box.depth || +#if TC_RESOLVE_STRICT info->src.box.width != tc->fb_width || info->src.box.height != tc->fb_height || +#endif tc->renderpass_info_recording->ended || (info->dst.resource->array_size && info->dst.resource->array_size != tc->fb_layers) || (!tc->renderpass_info_recording->has_draw && !tc->renderpass_info_recording->cbuf_clear && !tc->renderpass_info_recording->zsbuf_clear)) { diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index a5fe19b93f9..932967a85f7 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -217,6 +217,13 @@ struct tc_unflushed_batch_token; /* 0 = disabled, 1 = assertions, 2 = printfs, 3 = logging */ #define TC_DEBUG 0 +/* disabling this (nonzero to enable) is technically out of spec, but: + * - it's conformant + * - doesn't cause any known issues + * - massively improves performance + */ +#define TC_RESOLVE_STRICT 0 + /* This is an internal flag not sent to the driver. */ #define TC_TRANSFER_MAP_UPLOAD_CPU_STORAGE (1u << 28) /* These are map flags sent to drivers. */ @@ -643,8 +650,11 @@ struct threaded_context { unsigned max_samplers; unsigned nr_cbufs; unsigned fb_layers; + +#if TC_RESOLVE_STRICT uint16_t fb_width; uint16_t fb_height; +#endif unsigned last, next, next_buf_list;