From 83d1241cf5be73027531c6c341e4d896b1441792 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 20 Feb 2024 09:05:23 -0500 Subject: [PATCH] zink: add checks/compat for low-spec descriptor buffer implementations for implementations that can only support 1 descriptor buffer: * prefer templates * allow db if explicitly requested, but disable bindless (for testing) fix #10640 Fixes: b8b51d96b01 ("zink: delete maxDescriptorBufferBindings checks") Part-of: --- src/gallium/drivers/zink/zink_screen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 5491533a5db..b66ac5c95be 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -837,6 +837,9 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param) return 1; case PIPE_CAP_BINDLESS_TEXTURE: + if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB && + (screen->info.db_props.maxDescriptorBufferBindings < 2 || screen->info.db_props.maxSamplerDescriptorBufferBindings < 2)) + return 0; return screen->info.have_EXT_descriptor_indexing; case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT: @@ -3537,6 +3540,14 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev mesa_logw("zink: bug detected: inputAttachmentDescriptorSize(%u) > %u", (unsigned)screen->info.db_props.inputAttachmentDescriptorSize, ZINK_FBFETCH_DESCRIPTOR_SIZE); can_db = false; } + if (screen->info.db_props.maxDescriptorBufferBindings < 2 || screen->info.db_props.maxSamplerDescriptorBufferBindings < 2) { + if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) { + /* allow for testing, but disable bindless */ + mesa_logw("Cannot use bindless and db descriptor mode with (maxDescriptorBufferBindings||maxSamplerDescriptorBufferBindings) < 2"); + } else { + can_db = false; + } + } } if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_AUTO) { /* descriptor buffer is not performant with virt yet */