diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index d45ec8e4b6e..6da7487a20b 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -1434,7 +1434,7 @@ zink_descriptors_update(struct zink_context *ctx, bool is_compute) zds = zink_descriptor_set_get(ctx, h, is_compute, &cache_hit); if (cache_hit) { pdd_cached(pg)->cache_misses[h] = 0; - } else { + } else if (likely(zink_screen(ctx->base.screen)->descriptor_mode != ZINK_DESCRIPTOR_MODE_NOFALLBACK)) { if (++pdd_cached(pg)->cache_misses[h] == MAX_CACHE_MISSES) { const char *set_names[] = { "UBO", diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 02ac9cbc113..163977ef086 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -75,6 +75,7 @@ static const struct debug_named_value zink_descriptor_options[] = { { "auto", ZINK_DESCRIPTOR_MODE_AUTO, "Automatically detect best mode" }, { "lazy", ZINK_DESCRIPTOR_MODE_LAZY, "Don't cache, do least amount of updates" }, + { "nofallback", ZINK_DESCRIPTOR_MODE_NOFALLBACK, "Cache, never use lazy fallback" }, { "notemplates", ZINK_DESCRIPTOR_MODE_NOTEMPLATES, "Cache, but disable templated updates" }, DEBUG_NAMED_VALUE_END }; @@ -1769,7 +1770,7 @@ zink_internal_create_screen(const struct pipe_screen_config *config) zink_debug = debug_get_option_zink_debug(); screen->descriptor_mode = debug_get_option_zink_descriptor_mode(); - if (util_bitcount(screen->descriptor_mode) > 1) { + if (screen->descriptor_mode > ZINK_DESCRIPTOR_MODE_NOTEMPLATES) { printf("Specify exactly one descriptor mode.\n"); abort(); } diff --git a/src/gallium/drivers/zink/zink_screen.h b/src/gallium/drivers/zink/zink_screen.h index f2514ad0b46..07b3dc83576 100644 --- a/src/gallium/drivers/zink/zink_screen.h +++ b/src/gallium/drivers/zink/zink_screen.h @@ -64,6 +64,7 @@ enum zink_descriptor_type; enum zink_descriptor_mode { ZINK_DESCRIPTOR_MODE_AUTO, ZINK_DESCRIPTOR_MODE_LAZY, + ZINK_DESCRIPTOR_MODE_NOFALLBACK, ZINK_DESCRIPTOR_MODE_NOTEMPLATES, };