zink: add an explicit ZINK_DESCRIPTOR_MODE_CACHED
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 19 Jul 2022 14:08:07 +0000 (10:08 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 20 Jul 2022 04:24:19 +0000 (04:24 +0000)
no functional changes, but now AUTO is no longer a mode that gets used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17636>

docs/drivers/zink.rst
src/gallium/drivers/zink/zink_screen.c
src/gallium/drivers/zink/zink_screen.h

index 8cb2277..f1763e9 100644 (file)
@@ -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`.
 
index 96942d9..398453b 100644 (file)
@@ -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;
index bc176be..1fcc7f6 100644 (file)
@@ -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,
 };