dzn: Use separate dirty bits for descriptor sets/dynamic buffers
authorJesse Natalie <jenatali@microsoft.com>
Fri, 3 Mar 2023 16:48:39 +0000 (08:48 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Mar 2023 21:48:44 +0000 (21:48 +0000)
We'll be able to take advantage of this granularity in bindless mode

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>

src/microsoft/vulkan/dzn_cmd_buffer.c
src/microsoft/vulkan/dzn_private.h

index 28cf783..930b9c3 100644 (file)
@@ -4700,7 +4700,7 @@ dzn_CmdBindDescriptorSets(VkCommandBuffer commandBuffer,
 
       if (desc_state->sets[idx].set != set) {
          desc_state->sets[idx].set = set;
-         dirty |= DZN_CMD_BINDPOINT_DIRTY_HEAPS;
+         dirty |= DZN_CMD_BINDPOINT_DIRTY_DESC_SET0 << idx;
       }
 
       uint32_t dynamic_buffer_count = playout->sets[idx].dynamic_buffer_count;
@@ -4712,7 +4712,7 @@ dzn_CmdBindDescriptorSets(VkCommandBuffer commandBuffer,
 
          dynamicOffsetCount -= dynamic_buffer_count;
          pDynamicOffsets += dynamic_buffer_count;
-         dirty |= DZN_CMD_BINDPOINT_DIRTY_HEAPS;
+         dirty |= DZN_CMD_BINDPOINT_DIRTY_DYNAMIC_BUFFERS;
       }
    }
 
index 7d300c3..a36d085 100644 (file)
@@ -339,8 +339,19 @@ struct dzn_device_memory {
 
 enum dzn_cmd_bindpoint_dirty {
    DZN_CMD_BINDPOINT_DIRTY_PIPELINE = 1 << 0,
-   DZN_CMD_BINDPOINT_DIRTY_HEAPS = 1 << 1,
+   DZN_CMD_BINDPOINT_DIRTY_DYNAMIC_BUFFERS = 1 << 1,
    DZN_CMD_BINDPOINT_DIRTY_SYSVALS = 1 << 2,
+   DZN_CMD_BINDPOINT_DIRTY_DESC_SET0 = 1 << 3,
+   DZN_CMD_BINDPOINT_DIRTY_DESC_SET1 = 1 << 4,
+   DZN_CMD_BINDPOINT_DIRTY_DESC_SET2 = 1 << 5,
+   DZN_CMD_BINDPOINT_DIRTY_DESC_SET3 = 1 << 6,
+   DZN_CMD_BINDPOINT_DIRTY_HEAPS =
+      DZN_CMD_BINDPOINT_DIRTY_DYNAMIC_BUFFERS |
+      DZN_CMD_BINDPOINT_DIRTY_SYSVALS |
+      DZN_CMD_BINDPOINT_DIRTY_DESC_SET0 |
+      DZN_CMD_BINDPOINT_DIRTY_DESC_SET1 |
+      DZN_CMD_BINDPOINT_DIRTY_DESC_SET2 |
+      DZN_CMD_BINDPOINT_DIRTY_DESC_SET3,
 };
 
 enum dzn_cmd_dirty {