From dc12c78235bb5334dd9c2d3c91ffc4c7990e1c2b Mon Sep 17 00:00:00 2001 From: M Henning Date: Mon, 11 Nov 2024 19:21:29 -0500 Subject: [PATCH] nvk: Fix invalidation of NVK_CBUF_TYPE_DYNAMIC_UBO Because dyn_start and dyn_end are indices into nvk_root_descriptor_table->dynamic_buffers, we would need to offset cbuf->dynamic_idx by nvk_root_descriptor_table->set_dynamic_buffer_start[cbuf->desc_set] in order to do those comparisons correctly. We could do that, but it's simpler and no less precise to sinply re-use the same comparison that we do in the other cases here. This fixes a rendering artifact in Baldur's Gate 3 (Vulkan), which regressed with the commit listed below. Fixes: 091a945b57 ("nvk: Be much more conservative about rebinding cbufs") Reviewed-by: Faith Ekstrand Part-of: --- src/nouveau/vulkan/nvk_cmd_buffer.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/nouveau/vulkan/nvk_cmd_buffer.c b/src/nouveau/vulkan/nvk_cmd_buffer.c index b6e4232fdae..1dc1ca5b3c0 100644 --- a/src/nouveau/vulkan/nvk_cmd_buffer.c +++ b/src/nouveau/vulkan/nvk_cmd_buffer.c @@ -643,12 +643,8 @@ nvk_cmd_dirty_cbufs_for_descriptors(struct nvk_cmd_buffer *cmd, case NVK_CBUF_TYPE_DESC_SET: case NVK_CBUF_TYPE_UBO_DESC: - if (cbuf->desc_set >= sets_start && cbuf->desc_set < sets_end) - group->dirty |= BITFIELD_BIT(i); - break; - case NVK_CBUF_TYPE_DYNAMIC_UBO: - if (cbuf->dynamic_idx >= dyn_start && cbuf->dynamic_idx < dyn_end) + if (cbuf->desc_set >= sets_start && cbuf->desc_set < sets_end) group->dirty |= BITFIELD_BIT(i); break;