zink: add "nofallback" descriptor mode

this disables lazy fallback and forces caching always

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12783>
This commit is contained in:
Mike Blumenkrantz 2021-09-08 12:37:08 -04:00 committed by Marge Bot
parent 5475a6fe18
commit 7c1b7ded7a
3 changed files with 4 additions and 2 deletions

View file

@ -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",

View file

@ -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();
}

View file

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