vkd3d: Store a struct d3d12_descriptor_heap pointer in each CBV/SRV/UAV descriptor.
The PE build of vkd3d uses Windows critical sections for synchronisation, and these slow down on the very high lock/unlock rate during multithreaded descriptor copying in Shadow of the Tomb Raider. This patch speeds up the demo by about 8%. By comparison, using SRW locks in the allocators and locking them for read only where applicable is about 4% faster.
Merge request reports
Activity
@@ -2833,8 +2832,7 @@ static void d3d12_command_list_prepare_descriptors(struct d3d12_command_list *li /* Descriptors may not be set, eg. WoW. */ && (base_descriptor = bindings->descriptor_tables[table_index])) { - heap_size = vkd3d_gpu_descriptor_allocator_range_size_from_descriptor( - &device->gpu_descriptor_allocator, base_descriptor); + heap_size = base_descriptor->heap->desc.NumDescriptors; if (heap_size < unbounded_offset) WARN("Descriptor heap size %u is less than the offset %u of an unbounded range in table %u, "
That doesn't do the same thing. Is that intentional, or should this use d3d12_desc_heap_range_size() like elsewhere?
-struct vkd3d_gpu_descriptor_allocator -{ - struct vkd3d_mutex mutex; - - struct vkd3d_gpu_descriptor_allocation *allocations; - size_t allocations_size; - size_t allocation_count; -};
We should also be able to remove struct vkd3d_gpu_descriptor_allocation now, right?
+static inline void d3d12_desc_copy_raw(struct d3d12_desc *dst, const struct d3d12_desc *src) +{ + memcpy(dst, src, offsetof(struct d3d12_desc, heap)); +}
That's a bit unfortunate; this ends up depending on the exact layout of struct d3d12_desc. Could we just wrap the descriptor "body" in a structure instead?
added 1 commit
- f6ee265f - vkd3d: Store a heap array index in each CBV/SRV/UAV descriptor.
added 1 commit
- cf298365 - vkd3d: Store a heap array index in each CBV/SRV/UAV descriptor.
added 22 commits
-
cf298365...d14f42be - 21 commits from branch
wine:master
- 3db50938 - vkd3d: Store a heap array index in each CBV/SRV/UAV descriptor.
-
cf298365...d14f42be - 21 commits from branch