From 6a45e0d9912c50e502abbbcf17e498edccae29ad Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 16 Mar 2023 08:31:16 -0400 Subject: [PATCH] zink: don't update fbfetch in db mode if inputAttachmentDescriptorSize==0 turnip gets away with this somehow, so silence harmless validation errors Part-of: --- src/gallium/drivers/zink/zink_context.c | 3 ++- src/gallium/drivers/zink/zink_descriptors.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index ad189c6..4203b48 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -5702,7 +5702,8 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) info.pNext = NULL; info.type = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; info.data.pInputAttachmentImage = &ctx->di.fbfetch; - VKSCR(GetDescriptorEXT)(screen->dev, &info, screen->info.db_props.inputAttachmentDescriptorSize, ctx->di.fbfetch_db); + if (screen->info.db_props.inputAttachmentDescriptorSize) + VKSCR(GetDescriptorEXT)(screen->dev, &info, screen->info.db_props.inputAttachmentDescriptorSize, ctx->di.fbfetch_db); memset(&ctx->di.fbfetch, 0, sizeof(ctx->di.fbfetch)); } if (!screen->info.rb2_feats.nullDescriptor) diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 8920159..d098121 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -1345,7 +1345,7 @@ zink_descriptors_update(struct zink_context *ctx, bool is_compute) } if (!is_compute && ctx->dd.has_fbfetch) { uint64_t stage_offset = offset + ctx->dd.db_offset[MESA_SHADER_FRAGMENT + 1]; - if (pg->dd.fbfetch) { + if (pg->dd.fbfetch && screen->info.db_props.inputAttachmentDescriptorSize) { /* real fbfetch descriptor */ VkDescriptorGetInfoEXT info; info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT; -- 2.7.4