Commit Graph

70 Commits

Author SHA1 Message Date
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
fb55c2b227 vkd3d: Emit an ERR() when reaching unreachable code.
This way the ERR() configuration is reused for unreachable code.
2024-07-29 13:17:19 +02:00
Giovanni Mascellani
4ada72a397 vkd3d: Allow aborting on ERR(). 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
a484063cd2 vkd3d: Introduce debug severity MESSAGE.
That's intended for messages that it's pretty important that the
user receives, but that are not proper error messages.
2024-07-29 13:17:19 +02:00
Giovanni Mascellani
021a7f030a vkd3d: Allow disabling ERR() by defining VKD3D_NO_ERROR_MESSAGES. 2024-07-29 13:17:19 +02:00
Giovanni Mascellani
60ecf8c12b vkd3d: Disable FIXME_ONCE() when VKD3D_NO_DEBUG_MESSAGES is defined.
Similarly to FIXME().
2024-07-29 13:17:19 +02:00
Giovanni Mascellani
4c1cc6101f vkd3d: Disable WARN_ON() when VKD3D_NO_DEBUG_MESSAGES is defined.
Similarly to WARN().
2024-07-29 13:17:19 +02:00
Giovanni Mascellani
4f67675a51 tests: Support using the Agility SDK in the crosstests. 2024-07-09 16:57:03 +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
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
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
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
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
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
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
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
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
Alexandre Julliard
ab3aa96e1f vkd3d: Always use _BitScanReverse on Windows.
Use ULONG instead of unsigned long for non-Mingw msvcrt builds.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-01-28 17:48:30 +01:00
Zebediah Figura
7c534f4a77 tests: Return a failure code if unable to parse a shader_test file.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-11-09 19:56:28 +01:00
Zebediah Figura
464dae2c46 vkd3d-shader/hlsl: Write SM4 signatures.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-23 20:50:55 +02:00
Zebediah Figura
ed7cdb3940 vkd3d-shader: Introduce vkd3d_make_u{16, 32}() helpers.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-11 20:58:24 +02:00
Zebediah Figura
d27fee64ab build: Make the default symbol visibility "hidden".
We tag far fewer symbols this way.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 21:43:22 +02:00
Zebediah Figura
bcf272aa0b vkd3d: Introduce a vkd3d_bound_range() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-27 13:55:40 +02:00
Zebediah Figura
ffa7bd39f3 tests: Add some C HLSL preprocessor tests.
That is, tests in C, for features of the HLSL preprocessor which are difficult
to test using the shader_runner framework.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 22:28:11 +01:00