From 6493f6ef7958505a37ac28972ba9d5f9c3c665dc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 19 Jul 2022 10:08:07 -0400 Subject: [PATCH] zink: add an explicit ZINK_DESCRIPTOR_MODE_CACHED no functional changes, but now AUTO is no longer a mode that gets used Reviewed-by: Dave Airlie Part-of: --- docs/drivers/zink.rst | 2 ++ src/gallium/drivers/zink/zink_screen.c | 4 ++++ src/gallium/drivers/zink/zink_screen.h | 1 + 3 files changed, 7 insertions(+) diff --git a/docs/drivers/zink.rst b/docs/drivers/zink.rst index 8cb2277ee23..f1763e9e511 100644 --- a/docs/drivers/zink.rst +++ b/docs/drivers/zink.rst @@ -253,6 +253,8 @@ changing the descriptor manager may improve performance: Automatically detect best mode. This is the default. ``lazy`` Disable caching and attempt to use the least amount of CPU. +``cached`` + Use caching to reuse descriptor sets. ``notemplates`` The same as `auto`, but disables the use of `VK_KHR_descriptor_templates`. diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 96942d9cc15..398453bc320 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -91,6 +91,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" }, + { "cached", ZINK_DESCRIPTOR_MODE_CACHED, "Cache, reuse sets" }, { "notemplates", ZINK_DESCRIPTOR_MODE_NOTEMPLATES, "Cache, but disable templated updates" }, DEBUG_NAMED_VALUE_END }; @@ -2211,6 +2212,9 @@ zink_internal_create_screen(const struct pipe_screen_config *config) screen->desc_set_id[ZINK_DESCRIPTOR_TYPE_IMAGE] = 4; screen->desc_set_id[ZINK_DESCRIPTOR_BINDLESS] = 5; } + if (descriptor_mode == ZINK_DESCRIPTOR_MODE_AUTO) { + descriptor_mode = ZINK_DESCRIPTOR_MODE_CACHED; + } if (screen->info.have_EXT_calibrated_timestamps && !check_have_device_time(screen)) goto fail; diff --git a/src/gallium/drivers/zink/zink_screen.h b/src/gallium/drivers/zink/zink_screen.h index bc176be4dfa..1fcc7f6a618 100644 --- a/src/gallium/drivers/zink/zink_screen.h +++ b/src/gallium/drivers/zink/zink_screen.h @@ -77,6 +77,7 @@ enum zink_descriptor_type; enum zink_descriptor_mode { ZINK_DESCRIPTOR_MODE_AUTO, ZINK_DESCRIPTOR_MODE_LAZY, + ZINK_DESCRIPTOR_MODE_CACHED, ZINK_DESCRIPTOR_MODE_NOTEMPLATES, ZINK_DESCRIPTOR_MODE_COMPACT, };