Commit Graph

1294 Commits

Author SHA1 Message Date
Henri Verbeet
5c00766eff Release 1.14. 2024-11-21 12:35:55 +01:00
Giovanni Mascellani
72394d9ae3 vkd3d: Use WARN rather than ERR in vkd3d_instance_init().
ERR is used to indicate internal inconsistencies in vkd3d. Here that's
not the case, we simply have to forward the error condition to the
caller.

This fixes failures on the CI with llvmpipe, because the build we use is
compiled without support for VK_KHR_surface and related extensions.
2024-11-14 14:09:04 +01:00
Conor McCarthy
76fd1388d8 vkd3d: Check the IASetVertexBuffers() view count against the device limits.
For example, current MoltenVK only supports 31 vertex buffers.
2024-11-06 21:43:32 +01:00
Elizabeth Figura
a595b96f62 vkd3d: Initialize vk_extensions in vk_init_device_caps().
Without LTO, gcc doesn't know that hresult_from_vk_result() will always return a
failure HRESULT for a failure VkResult, and so thinks that we might exit from
vkd3d_check_device_extensions() with a success HRESULT but without initializing
vk_extensions.
2024-10-28 18:01:06 +01:00
Giovanni Mascellani
a1f712d100 vkd3d: Incorporate mutable descriptors in the push descriptor disabling logic.
The computation is also written in the code now instead of in
the comments.
2024-10-23 16:12:50 +02:00
Giovanni Mascellani
bc2b137df9 vkd3d: Only put the mutable descriptor set once in the pipeline layout.
Currently the mutable descriptor set is repeated many times in the
pipeline layout in order to cover the indices for all the
descriptor types that would be present if mutable descriptors were
not used. This is useless and wasteful, but was necessary before
the descriptor sets backing the SRV-UAV-CBV heap were moved at the
end of the allocation table because descriptor set indices are
currently a compile-time constant in many places.

Now this is not needed any more and we can just avoid putting
many copies of the mutable descriptor set in the pipeline layout,
making it easier to meet Vulkan implementation limits.
2024-10-23 16:12:06 +02:00
Giovanni Mascellani
96b324c156 vkd3d: Move descriptor sets backing the SRV-UAV-CBV heap at the end.
So that when mutable descriptors are in use we can avoid putting
the other descriptor sets backing the SRV-UAV-CBV descriptor heap
in the pipeline layout altogether.
2024-10-23 16:07:54 +02:00
Giovanni Mascellani
8d030718ae vkd3d: Introduce an enumerant for the mutable descriptor set.
So we avoid hardcoding that it is number zero. There are two
goals here: first making the code easier to understand and
second allow reshuffling the descriptor set allocation in a
later commit.
2024-10-23 16:07:36 +02:00
Conor McCarthy
4889c71857 vkd3d: Zero the pipeline state UAV counter view array when the state is invalidated. (Valgrind)
Otherwise a comparison with uninitialised data occurs in
d3d12_command_list_update_descriptor_table() if virtual heaps are used.
2024-10-22 20:42:06 +02:00
Giovanni Mascellani
ae772d40cf vkd3d: Disable push descriptors when that's helpful to stay within 8 descriptor sets. 2024-10-21 18:22:15 +02:00
Giovanni Mascellani
3bf114f3c3 vkd3d/device: Trace which descriptor heap implementation is being used.
The descriptor heap implementation is a rather central behavior element
in vkd3d, so it's useful to have all the relevant information logged
in a single place.
2024-10-21 18:22:15 +02:00
Giovanni Mascellani
a3b8aaf679 vkd3d: Allow overriding the device capabilities. 2024-10-21 18:06:06 +02:00
Henri Verbeet
8943999bd2 vkd3d: Slightly simplify the SRV/UAV logic in vk_write_descriptor_set_from_d3d12_desc(). 2024-10-17 17:28:52 +02:00
Conor McCarthy
bfaab9700d vkd3d: Lay out virtual descriptor heap buffer and image bindings consecutively instead of interleaving them.
Slightly simplifies descriptor write addressing, and makes layouts
essentially the same as array layouts, differing only in the binding
details, and therefore easier to understand. This also simplifies the
addition of storage buffer bindings, which can all be added onto the end.
2024-10-17 17:28:46 +02:00
Giovanni Mascellani
0b8a53d75d vkd3d: Create Vulkan bindings in d3d12_root_signature_append_vk_binding(). 2024-10-17 17:23:04 +02:00
Conor McCarthy
74da9ed6fe vkd3d: Create a separate Vulkan descriptor binding array for each descriptor set.
Allows descriptor set layouts to be created after all bindings are
mapped. This is less complex and fragile than the current scheme, and in
a future patch it will support separating descriptor types into different
sets. Descriptors on virtual heaps are currently allocated from pools
which contain an equal number of each descriptor type used by vkd3d, and
this can waste a significant amount of device memory.
2024-10-17 17:23:04 +02:00
Giovanni Mascellani
b5c56a50b5 vkd3d: Use vk_binding_array_add_binding() in d3d12_root_signature_init_root_descriptors(). 2024-10-17 17:23:04 +02:00
Giovanni Mascellani
3aec841a9f vkd3d: Use vk_binding_array_add_binding() in d3d12_root_signature_init_static_samplers(). 2024-10-17 17:23:04 +02:00
Giovanni Mascellani
416ce575f6 vkd3d: Introduce a helper function to add bindings to struct vk_binding_array. 2024-10-17 17:23:04 +02:00
Conor McCarthy
eca344ff56 vkd3d: Introduce a separate structure for storing Vulkan descriptor binding arrays. 2024-10-17 17:23:04 +02:00
Conor McCarthy
3f98ca53ca vkd3d: Access the current range via the declared pointer in d3d12_root_signature_init_root_descriptor_tables(). 2024-10-17 17:23:04 +02:00
Conor McCarthy
91475c684f vkd3d: Clear the output pointer on failure in vkd3d_create_versioned_root_signature_deserializer(). 2024-09-24 13:34:40 +02:00
Conor McCarthy
945e8a9024 vkd3d: Sort bounded descriptor ranges after unbounded ones of equal offset.
Enables the bounded range to be mapped to the unbounded one, instead of
being mapped to a separate binding which will be populated from the same
d3d12 descriptors as the unbounded one.
2024-09-23 15:45:26 +02:00
Andrey Gusev
2ac7f650a1 vkd3d: Recognise VK_QUEUE_VIDEO_ENCODE_BIT_KHR in debug_vk_queue_flags(). 2024-09-20 17:21:44 +02:00
Anna (navi) Figueiredo Gomes
127ae6cf12 vkd3d: Implement d3d12_command_list_OMSetDepthBounds().
Based on the design document, "The runtime will not clamp or validate
the input, but implementations may clamp to the range [0,1] if necessary.",
so we test for the EXT_depth_range_unrestricted extension, and only clamp if
it's not available (thus, necessary to do so).

NaNs are converted to zero as per "NaNs must be treated as 0, but the runtime
will convert NaNs to 0 on behalf of the implementation.", and a default bounds
are set to 0.0 and 1.0.
2024-09-11 14:53:33 +02:00
Giovanni Mascellani
d71966c77e vkd3d: Do not keep track of descriptor heaps when using virtual heaps.
Descriptors only need flushing when using Vulkan heaps, so let's avoid
uselessly scanning an array and taking and releasing a mutex if we're not.
2024-09-10 21:47:38 +02:00
Giovanni Mascellani
05a5bd620d vkd3d: Directly call the function to update descriptors.
For better code clarity.
2024-09-10 21:46:46 +02:00
Anna (navi) Figueiredo Gomes
5ebbba6fff vkd3d/state: Replace ERR with WARN in vkd3d_validate_descriptor_set_count(). 2024-09-10 21:42:47 +02:00
Henri Verbeet
0e72aba0bc Release 1.13. 2024-08-29 12:08:46 +02:00
Conor McCarthy
80e607e3e7 vkd3d: Free descriptor range information on error paths in d3d12_root_signature_info_from_desc(). (Valgrind)
Fixes memory leaks in test_create_root_signature().
2024-08-26 11:20:54 +02:00
Nikolay Sivov
d1b8a7e745 vkd3d: Fix a few typos in the comments.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-08-19 14:17:41 +02:00
Anna (navi) Figueiredo Gomes
16e9872718 vkd3d: Use D3D12_SHADER_VISIBILITY_ALL for 32-bit root constants when using vk_heaps.
The existing code sets "stageFlags" to VK_SHADER_STAGE_ALL when
"use_vk_heaps" is true, but doesn't adjust the visibility. This
potentially violates the "Any two elements of pPushConstantRanges must
not include the same stage in stageFlags" constraint, and causes the
validation layers to complain accordingly.
2024-08-15 17:53:46 +02:00
Henri Verbeet
9cf479d4bb vkd3d: Do not include assert.h. 2024-08-13 21:20:28 +02:00
Giovanni Mascellani
784e69a366 vkd3d: Check the entire root signature for register conflicts.
Not just each descriptor table individually.
2024-08-06 16:53:06 +02:00
Stefan Dösinger
d4c2a7f22b vkd3d: Pass a proper struct shader_cache_key * to rb_put() in vkd3d_shader_cache_add_entry(). 2024-08-05 15:59:53 +02:00
Conor McCarthy
969cae8b67 vkd3d: Add support for the ID3D12CommandList6 interface. 2024-08-05 15:56:09 +02:00
Giovanni Mascellani
240d31c793 vkd3d: Replace assert() with VKD3D_ASSERT() in vkd3d_private.h. 2024-07-29 19:12:13 +02:00
Giovanni Mascellani
529647142c vkd3d: Replace assert() with VKD3D_ASSERT() in utils.c. 2024-07-29 19:12:13 +02:00
Giovanni Mascellani
bd75396b38 vkd3d: Replace assert() with VKD3D_ASSERT() in state.c. 2024-07-29 19:12:13 +02:00
Giovanni Mascellani
02b898bec0 vkd3d: Replace assert() with VKD3D_ASSERT() in resource.c. 2024-07-29 19:12:13 +02:00
Giovanni Mascellani
150bf69da9 vkd3d: Replace assert() with VKD3D_ASSERT() in command.c. 2024-07-29 19:12:13 +02:00
Giovanni Mascellani
51b65688e1 ci: Abort on assertions on the CI. 2024-07-29 13:17:19 +02:00
Giovanni Mascellani
d7fc2693c4 vkd3d: Introduce a softer form of assertion.
Triggering an ERR() instead of aborting the program.
2024-07-29 13:17:19 +02:00
Giovanni Mascellani
ba0fec4c51 vkd3d: Propagate errors out of d3d12_root_signature_append_vk_binding(). 2024-07-22 16:01:37 +02:00
Giovanni Mascellani
4b7fe26b33 vkd3d: Remove the temporary pointers in vkd3d_physical_device_info_init().
They were rather pointless now.
2024-07-22 16:00:28 +02:00
Giovanni Mascellani
75c64e55cd vkd3d: Rebuild the vkd3d_physical_device_info chain before creating the device.
vkd3d might decide to disable some extensions after the chain is created,
so the chain must be recreated with only the structures corresponding to
enabled extensions.
2024-07-22 16:00:28 +02:00
Giovanni Mascellani
a876e0b192 vkd3d: Allocate temporary arrays on the stack in d3d12_command_list_update_push_descriptors(). 2024-07-17 15:52:37 +02:00
Conor McCarthy
ae0faf4500 vkd3d: Limit the workgroup X count for buffer UAV clears to the supported max. 2024-07-17 15:51:39 +02:00
Conor McCarthy
15f8657d74 vkd3d: Create a descriptor pool for static samplers when Vulkan-backed heaps are used.
Static samplers may be allocated from these pools.
2024-07-17 15:50:24 +02:00
Giovanni Mascellani
9ebf779ef0 vkd3d: Propagate a failure in d3d12_descriptor_heap_init(). 2024-07-11 00:34:58 +02:00