Commit Graph

145 Commits

Author SHA1 Message Date
Giovanni Mascellani
4f67675a51 tests: Support using the Agility SDK in the crosstests. 2024-07-09 16:57:03 +02:00
Stefan Dösinger
021eb28584 include: Get rid of the RB_FOR_EACH* macros.
They're largely unused, and RB_FOR_EACH_ENTRY_DESTRUCTOR is broken
because it uses WINE_RB_ENTRY_VALUE which doesn't exist in vkd3d.
2024-06-13 23:44:43 +02:00
Yuxuan Shui
8a459f5903 tests: Pass the correct buffer size to vsnprintf() in vkd3d_test_push_context(). 2024-06-12 19:04:22 +02:00
Stefan Dösinger
aad76f4ed2 vkd3d: Implement vkd3d_shader_cache_put. 2024-04-24 23:49:15 +02:00
Henri Verbeet
af33caf036 vkd3d-common: Introduce vkd3d_atomic_exchange_ptr(). 2024-04-24 23:49:12 +02:00
Henri Verbeet
b1c326ce56 vkd3d-common: Introduce vkd3d_atomic_exchange_u32(). 2024-04-24 23:49:11 +02:00
Henri Verbeet
5c8a90a6c9 vkd3d-common: Introduce vkd3d_atomic_compare_exchange_u32(). 2024-04-24 23:49:11 +02:00
Henri Verbeet
46fca3f9f4 vkd3d-common: Introduce VKD3D_BITMAP_SIZE. 2024-04-23 22:41:25 +02:00
Henri Verbeet
7b4a1fdfbc vkd3d: Move the vkd3d_cond implementation to vkd3d-common.
Much like the vkd3d_mutex implementation.
2024-04-22 23:15:20 +02:00
Stefan Dösinger
a7860ae752 vkd3d: Implement reopening existing caches. 2024-04-10 08:54:58 -05:00
Zebediah Figura
2fceebd050 vkd3d-utils: Parse the RD11 section. 2024-03-27 22:36:33 +01:00
Zebediah Figura
90cd57404b vkd3d-utils: Implement ID3D12ShaderReflection::GetConstantBufferByIndex(). 2024-03-27 22:36:31 +01:00
Henri Verbeet
166dc24b2f vkd3d: Move the vkd3d_mutex implementation to vkd3d-common. 2024-03-19 22:58:53 +01:00
Henri Verbeet
2431357fd6 vkd3d-common: Merge vkd3d_debug.h into vkd3d_common.h.
There doesn't seem much point in separating these. Pretty much all of
vkd3d (eventually) includes vkd3d_debug.h, and vkd3d_debug.h includes
vkd3d_common.h because it uses VKD3D_PRINTF_FUNC. The separation also
makes it inconvenient to use the debug macros in vkd3d_common.h.
2024-03-19 22:58:51 +01:00
Zebediah Figura
9177df883e vkd3d-shader/hlsl: Write the SFI0 section and "REQUIRES_ROVS" flag when ROVs are used. 2024-03-04 22:34:46 +01:00
Henri Verbeet
4735ff48d1 tests: Disable buffering of stdout.
Both to avoid it getting lost in case of crashes, and to properly interleave
test output and debug output in the log files.
2024-02-15 23:29:52 +01:00
Henri Verbeet
532e902a56 vkd3d-common: Get rid of InterlockedDecrement(). 2024-02-06 23:07:36 +01:00
Henri Verbeet
c64921e79b vkd3d-common: Get rid of InterlockedIncrement(). 2024-02-06 23:07:36 +01:00
Jacek Caban
2ae9f18a3a vkd3d: Use uint64_t for the size in vkd3d_gpu_va_allocator_allocate.
Avoids value truncation in 32-bit builds.
2024-02-01 22:25:20 +01:00
Henri Verbeet
8c6f5b847b vkd3d-utils: Implement D3DDisassemble().
Very loosely based on Wine's d3dcompiler_43.
2024-01-29 22:33:44 +01:00
Henri Verbeet
9228e13155 vkd3d-common: Introduce vkd3d_atomic_decrement_u32(). 2024-01-18 23:16:19 +01:00
Henri Verbeet
03fbf4a3dc vkd3d-common: Introduce vkd3d_atomic_increment_u32(). 2024-01-18 23:16:19 +01:00
Henri Verbeet
cd9610bbe0 include: Introduce a debug helper for HRESULTs. 2024-01-17 22:29:39 +01:00
Henri Verbeet
71decc927f vkd3d-common: Introduce vkd3d_atomic_increment_u64(). 2024-01-17 22:29:29 +01:00
Henri Verbeet
4db7b40ca8 vkd3d-common: Get rid of InterlockedAdd().
This was once used by libvkd3d's fence worker thread, but currently this is
unused.
2024-01-15 19:57:59 +01:00
Nikolay Sivov
9494b72224 vkd3d-shader: Add separate binary target type for effects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:48 +01:00
Jacek Caban
616bf93931 include: Use GCC-style attributes and builtins on Clang MSVC target. 2023-11-20 22:07:54 +01:00
Henri Verbeet
f75bdd6e21 vkd3d-utils: Implement D3DStripShader(). 2023-10-19 23:07:50 +02:00
Henri Verbeet
b63c853688 vkd3d-utils: Implement D3DGetBlobPart().
This was largely adapted from Wine's d3dcompiler_43, with some style
adjustments.
2023-10-18 20:58:22 +02:00
Henri Verbeet
da89da2bf3 vkd3d-shader: Hide support for DXIL sources.
Unfortunately this is not sufficiently ready to release.
2023-09-18 21:04:19 +02:00
Zebediah Figura
d077562f79 vkd3d-shader/d3dbc: Scan descriptors for constant register sets. 2023-07-17 22:56:39 +02:00
Conor McCarthy
571d807dd8 vkd3d-shader/dxil: Read the type table. 2023-07-11 22:43:48 +02:00
Alistair Leslie-Hughes
d5a0b3afc4 include: Avoid including unnecessary Windows headers.
We only require a few types and declarations.
2023-06-28 21:41:14 +02:00
Conor McCarthy
d3e6a3a78f include: Introduce a function to detect the DXBC source type. 2023-06-28 21:40:36 +02:00
Conor McCarthy
e63201a7a3 vkd3d: Delay writing Vulkan descriptors until submitted to a queue.
Eliminates vk_sets_mutex. Performance on average may be lower until
the descriptor mutexes are replaced and Vulkan writes are buffered
to reduce thunk calls.
2023-04-25 22:20:09 +02:00
Zebediah Figura
6783524613 vkd3d-common: Make some global string variables const. 2023-04-06 17:52:08 +02:00
Zebediah Figura
dfa4bfdd03 include: Make test context information nestable.
Based on Wine.
2023-04-04 21:59:58 +02:00
Zebediah Figura
1bf5050d3d tests: Factor out vkd3d_test_printf(). 2023-04-04 21:59:58 +02:00
Zebediah Figura
8bdee6681b vkd3d-shader/hlsl: Lower return statements. 2023-02-13 22:16:51 +01:00
Brendan Shanks
963ea98a52 vkd3d-common: Add a Windows implementation of vkd3d_set_thread_name(). 2022-10-25 21:25:38 +02:00
Zebediah Figura
303ce66cef include: Use __MINGW_PRINTF_FORMAT when compiling with MinGW.
The default for MinGW is always ms_printf rather than gnu_printf, but if we are
using ucrtbase or ANSI stdio, we want gnu_printf.
2022-10-17 17:57:56 +02:00
Giovanni Mascellani
d5fd309ef8 vkd3d: Add a macro to mark unreachable code.
This should silence warnings about some branches non returning any value
without requiring additional "return 0" statement or similar.

Also, in theory this might enable to compiler to optimize the program
a little bit more, though that's unlikely to have any measurable effect.
2022-09-27 20:14:27 +02:00
Zebediah Figura
a2996c2d59 include: Add list_move_after() and list_move_before().
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2022-08-10 21:33:33 +02:00
Zebediah Figura
174172887b vkd3d-shader: Allow writing log output via a custom callback.
When using PE vkd3d through Wine, debug output may be swallowed by writing to
Win32 stderr. Avoid this by providing a way to hook up vkd3d log output to Wine
output.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-07 19:38:49 +02:00
Zebediah Figura
d087b9ea5b include: Implement vkd3d_dl*() wrappers for Win32 platforms.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-20 16:41:39 +02:00
Zebediah Figura
a58e713314 include: Move vkd3d_dl*() helpers to vkd3d_common.h.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-20 16:41:37 +02:00
Conor McCarthy
2b71ea406f vkd3d: Back descriptor heaps with Vulkan descriptor sets if descriptor indexing is available.
The existing implementation using virtual descriptor heaps, where Vk
descriptor sets are created for the bindings in the root descriptor tables,
is inefficient when multiple command lists are used with large descriptor
heaps. It also cannot support updating a descriptor set after it is bound.

This patch creates Vk sets for each D3D12 heap. Because D3D12 heaps
can contain CBV, SRV and UAV descriptors in the same heap, multiple Vk sets
are needed for each heap, however the total number of populated descriptors
is never more than (heap size + UAV counter count).

A new 'virtual_heaps' config option is introduced to make the old
implementation available when needed. It's not always possible to determine
if this is necessary when the device is created.

Up to nine Vk descriptor sets may be used. It's theoretically possible to
reduce this to eight by placing immutable samplers in the push descriptor
set layout, but contradictions in earlier versions of the Vulkan spec made
driver support inconsistent. The documentation was corrected in version
1.2.203.

This patch also adds support for UAV counter descriptor arrays. It's not
practical to add this in a separate patch due to complications with
combining the old UAV counter implementation with the new descriptor heap
implementation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47713
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47154
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-18 12:38:53 +01:00
Henri Verbeet
4728cf1286 include: Introduce a common macro for defining tags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:31:33 +01:00
Henri Verbeet
790ab754d5 vkd3d-shader/hlsl: Properly compare integers in compare_param_hlsl_types().
As pointed out by Giovanni Mascellani, modular subtraction doesn't produce a
total order; in particular, it's not transitive. The nature of the types being
compared here makes it unlikely this will be an issue in practice, but it's
both fragile and setting a poor example.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 22:23:24 +01:00
Alexandre Julliard
beafa0914e vkd3d: Replace atomic_add_fetch() by InterlockedAdd().
By analogy with InterlockedIncrement. It avoids the need for a
configure check on Windows platforms.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-01-28 17:48:32 +01:00