dzn: Remove descriptor heap type from descriptor heap wrapper
authorJesse Natalie <jenatali@microsoft.com>
Wed, 1 Mar 2023 21:59:33 +0000 (13:59 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Mar 2023 21:48:43 +0000 (21:48 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>

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

index fd62453..a244c91 100644 (file)
@@ -3085,7 +3085,7 @@ dzn_cmd_buffer_update_heaps(struct dzn_cmd_buffer *cmdbuf, uint32_t bindpoint)
             mtx_lock(&set->pool->defragment_lock);
             dzn_descriptor_heap_copy(device, dst_heap, dst_heap_offset + set_heap_offset,
                                      &set->pool->heaps[type], set->heap_offsets[type],
-                                     set_desc_count);
+                                     set_desc_count, type);
             mtx_unlock(&set->pool->defragment_lock);
          }
 
index f26802a..e2f3bd2 100644 (file)
@@ -833,7 +833,6 @@ dzn_descriptor_heap_init(struct dzn_descriptor_heap *heap,
                          bool shader_visible)
 {
    heap->desc_count = desc_count;
-   heap->type = type;
    heap->desc_sz = ID3D12Device1_GetDescriptorHandleIncrementSize(device->dev, type);
 
    D3D12_DESCRIPTOR_HEAP_DESC desc = {
@@ -1008,7 +1007,8 @@ dzn_descriptor_heap_copy(struct dzn_device *device,
                          uint32_t dst_offset,
                          const struct dzn_descriptor_heap *src_heap,
                          uint32_t src_offset,
-                         uint32_t desc_count)
+                         uint32_t desc_count,
+                         D3D12_DESCRIPTOR_HEAP_TYPE type)
 {
    D3D12_CPU_DESCRIPTOR_HANDLE dst_handle =
       dzn_descriptor_heap_get_cpu_handle(dst_heap, dst_offset);
@@ -1018,7 +1018,7 @@ dzn_descriptor_heap_copy(struct dzn_device *device,
    ID3D12Device1_CopyDescriptorsSimple(device->dev, desc_count,
                                        dst_handle,
                                        src_handle,
-                                       dst_heap->type);
+                                       type);
 }
 
 struct dzn_descriptor_set_ptr {
@@ -1487,7 +1487,8 @@ dzn_descriptor_pool_defragment_heap(struct dzn_device *device,
                                &new_heap, heap_offset,
                                &pool->heaps[type],
                                pool->sets[s].heap_offsets[type],
-                               pool->sets[s].heap_sizes[type]);
+                               pool->sets[s].heap_sizes[type],
+                               type);
       pool->sets[s].heap_offsets[type] = heap_offset;
       heap_offset += pool->sets[s].heap_sizes[type];
    }
@@ -1908,7 +1909,7 @@ dzn_descriptor_set_copy(struct dzn_device *device,
                                      dst_set->heap_offsets[type] + dst_heap_offset,
                                      &src_set->pool->heaps[type],
                                      src_set->heap_offsets[type] + src_heap_offset,
-                                     count);
+                                     count, type);
 
             if (dzn_descriptor_type_depends_on_shader_usage(src_type)) {
                src_heap_offset =
@@ -1922,7 +1923,7 @@ dzn_descriptor_set_copy(struct dzn_device *device,
                                         dst_set->heap_offsets[type] + dst_heap_offset,
                                         &src_set->pool->heaps[type],
                                         src_set->heap_offsets[type] + src_heap_offset,
-                                        count);
+                                        count, type);
             }
             mtx_unlock(&dst_set->pool->defragment_lock);
             mtx_unlock(&src_set->pool->defragment_lock);
index d8d495f..3cf0a4b 100644 (file)
@@ -382,7 +382,6 @@ struct dzn_buffer_desc {
 
 struct dzn_descriptor_heap {
    ID3D12DescriptorHeap *heap;
-   D3D12_DESCRIPTOR_HEAP_TYPE type;
    SIZE_T cpu_base;
    uint64_t gpu_base;
    uint32_t desc_count;
@@ -414,7 +413,7 @@ void
 dzn_descriptor_heap_copy(struct dzn_device *device,
                          struct dzn_descriptor_heap *dst_heap, uint32_t dst_heap_offset,
                          const struct dzn_descriptor_heap *src_heap, uint32_t src_heap_offset,
-                         uint32_t desc_count);
+                         uint32_t desc_count, D3D12_DESCRIPTOR_HEAP_TYPE type);
 
 struct dzn_descriptor_heap_pool_entry {
    struct list_head link;