tc: add #define to disable strict resolve merging

this enables merging fb resolves which do not cover the full dst

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35477>
This commit is contained in:
Mike Blumenkrantz
2025-06-17 14:03:15 -04:00
parent 8933b3ed39
commit 2b6e7c4609
2 changed files with 14 additions and 0 deletions

View File

@@ -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)) {

View File

@@ -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;