zink: default to lazy/templated descriptors

cached mode was great 2 years ago when template support was less widespread,
but now that templates are everywhere, caching is less performant in
every scenario

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17636>
This commit is contained in:
Mike Blumenkrantz 2022-07-19 10:12:33 -04:00 committed by Marge Bot
parent 6493f6ef79
commit 2e7ecc02bc
2 changed files with 6 additions and 6 deletions

View file

@ -770,8 +770,6 @@ zink_descriptors_init_lazy(struct zink_context *ctx)
entry->descriptorType = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT;
entry->offset = offsetof(struct zink_context, di.fbfetch);
entry->stride = sizeof(VkDescriptorImageInfo);
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_LAZY)
printf("ZINK: USING LAZY DESCRIPTORS\n");
}
struct zink_descriptor_layout_key *layout_key;
if (!zink_descriptor_util_push_layouts_get(ctx, ctx->dd->push_dsl, ctx->dd->push_layout_keys))

View file

@ -1530,8 +1530,7 @@ zink_get_format(struct zink_screen *screen, enum pipe_format format)
void
zink_screen_init_descriptor_funcs(struct zink_screen *screen, bool fallback)
{
if (screen->info.have_KHR_descriptor_update_template &&
!fallback &&
if (!fallback &&
zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_LAZY) {
#define LAZY(FUNC) screen->FUNC = zink_##FUNC##_lazy
LAZY(descriptor_program_init);
@ -2212,8 +2211,11 @@ 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 (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_AUTO) {
if (screen->info.have_KHR_descriptor_update_template)
zink_descriptor_mode = ZINK_DESCRIPTOR_MODE_LAZY;
else
zink_descriptor_mode = ZINK_DESCRIPTOR_MODE_CACHED;
}
if (screen->info.have_EXT_calibrated_timestamps && !check_have_device_time(screen))