Commit Graph

587 Commits

Author SHA1 Message Date
Zebediah Figura
eb2c3b0b90 tests: Test depth comparison sampling with cubemap array textures.
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-26 16:02:13 +02:00
Zebediah Figura
08d198ba6f tests: Make test_shader_interstage_interface() into a shader test.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@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>
2022-04-05 17:50:22 +02:00
Conor McCarthy
889e5af5dd tests: Test signalling a fence to a lower value after a GPU wait.
Ensures the new fence implementation using timeline semaphores handles
this correctly.

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-24 23:23:15 +01:00
Conor McCarthy
22d8665300 vkd3d: Use Vulkan timeline semaphores for D3D12 fences.
D3D12 supports signalling a fence to a lower value, while Vulkan timeline
semaphores do not. On the GPU side this is handled by simply submitting
the signal anyway, if a test for this passes on device creation, because
working around this is impractical. For CPU signals the Vulkan semaphore
is replaced with a new one at the lower value only if no waits and/or
signals are pending on the GPU. Otherwise, a fixme is emitted.

Partly based on a vkd3d-proton patch by Hans-Kristian Arntzen (not
including the handling of lower fence values).

The old implementation is used if KHR_timeline_semaphore is not
available or GPU signals do not work for a lower value.

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-24 19:47:24 +01: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
Giovanni Mascellani
500ce146c3 tests: Mark atomic operations as done on AMD.
They seem to work with mesa 21.3.7. Since some developers are
using older releases where the bug is not yet fixed, I am leaving
it marked as a bug.

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-03-17 20:52:30 +01:00
Giovanni Mascellani
90827313f5 tests: Mark NaN conversion as todo on NVIDIA.
D3D mandates that NaN becomes zero when converted to unsigned[1],
while it doesn't look like that SPIR-V's OpConvertFToU has a similar
provision[2]. In practice, this seems to work on AMD and fails on
NVIDIA, where 0x80000000 is produced instead.

 [1] https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpec.htm#22.17.4%20dtou
 [2] https://www.khronos.org/registry/SPIR-V/specs/unified1/SPIRV.html#Conversion

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-03-17 20:52:30 +01:00
Giovanni Mascellani
8efbd4de51 tests: Work around a rounding difference between NVIDIA and AMD.
NVIDIA and AMD round differently the assignment of 0.5f to a UAV
of type R16G16_UNORM. NVIDIA rounds to 0x7fff and AMD to 0x8000.
According to both Vulkan and D3D12 specifications, both values
are acceptable, but the discrepancy currently appears as a
failure on NVIDIA cards.

Work around the issue by using 0.25f instead of 0.5f, which is
rounded as 0x4000 on both implementations.

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-03-17 20:52:30 +01:00
Henri Verbeet
fd28eb8199 tests: Properly compare integers in compare_id().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:25:14 +01:00
Zebediah Figura
22e6581ffc tests: Add a D3D11 shader runner backend.
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-01-27 18:00:49 +01:00
Conor McCarthy
31a1026d3e vkd3d/tests: Revert "Enable on vkd3d the tests for ID3D12CommandQueue::Wait().".
This reverts commit 41230b6e76.

The tests can hang and the Wait() implementation has issues.

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-01-20 10:57:14 +01:00
Conor McCarthy
8727b9a435 tests: Add tests for NULL event handles in SetEventOnCompletion().
Testing this before NULL event handling is patched results in a crash.
Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

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-01-19 22:47:13 +01:00
Conor McCarthy
ecb854c6c1 vkd3d: Add DXGI_FORMAT_UNKNOWN to the array of vkd3d_format objects.
This results in a valid format instead of NULL being returned for
buffers and any other case where DXGI_FORMAT_UNKNOWN is specified.
In some cases invalid use of a buffer or DXGI_FORMAT_UNKNOWN will
not result in E_INVALIDARG, and would need to be tested explicitly
if proven to be an issue.

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-01-19 17:33:42 +01:00
Conor McCarthy
b93edeccfd tests: Test a texture with format DXGI_FORMAT_UNKNOWN in test_create_committed_resource().
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-01-19 17:33:39 +01:00
Conor McCarthy
66bc2672a1 vkd3d: Implement ID3D12CommandQueue_GetClockCalibration().
Extends vkd3d_instance_create_info with struct vkd3d_host_time_domain_info
to allow host ticks per second to be changed from the default 10000000.

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-01-18 09:22:56 +01:00
Conor McCarthy
3d044c4453 tests: Add tests for ID3D12CommandQueue_GetClockCalibration().
Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

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-01-14 19:28:11 +01:00
Conor McCarthy
2047bfa664 tests: Avoid -Wstringop-overread warnings from GCC 11.1+.
It's technically correct in warning about overwriting the entire
vec4 from the address of .x, if a bit overzealous. It's probably a
good warning to keep enabled.

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-01-14 19:28:09 +01:00
Conor McCarthy
fa8956940c tests: Set the wrong descriptor heaps in test_descriptor_tables().
Has no effect in Windows at least on AMD. Not calling SetDescriptorHeaps()
at all has no effect in Windows on any hardware so this is likely to be
universal too.

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-01-14 19:27:00 +01:00
Conor McCarthy
2566b8dd8c vkd3d: Handle depth/stencil planes in GetCopyableFootprints().
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-01-13 17:21:08 +01:00
Conor McCarthy
c6e46f84df vkd3d/tests: Add tests for GetCopyableFootprints() depth/stencil planes.
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-01-13 17:21:03 +01:00
Conor McCarthy
41230b6e76 vkd3d/tests: Enable on vkd3d the tests for ID3D12CommandQueue::Wait().
The Wait() implementation was added some time ago and these tests succeed.

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-01-13 17:21:00 +01:00
Conor McCarthy
dbd7e18364 vkd3d-shader/spirv: Shift the private variable destination mask instead of the source mask.
Otherwise if the input is located above position 0 in the private array
it will be swizzled incorrectly, e.g. a.yz instead of a.xy in
test_domain_shader_inputs().

Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:27:31 +01:00
Conor McCarthy
5357ab78b9 vkd3d-shader/spirv: Fix the outer tessellation level indices for isoline tessellation.
For isoline tessellation, "density" is specified by OL0, and "detail" by OL1.

Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:27:27 +01:00
Conor McCarthy
462bbfaa74 tests: Add tests for a domain shader using a single patch constant input value.
This specifically tests the case where "count" would end up being one for
arrayed builtins in needs_private_io_variable().

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:27:25 +01:00
Conor McCarthy
db10a63a2e tests: Add tests for domain shader patch constant inputs.
Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 15:27:22 +01:00
Conor McCarthy
a1df197561 tests: Add a test for an unconditional break instruction at the end of a loop block.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-08 22:39:54 +01:00
Conor McCarthy
b8ab71e4dc tests: Add a test for exporting SV_StencilRef from a pixel shader.
Based on a vkd3d-proton patch by Philip Rebohle.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 18:36:58 +02:00
Conor McCarthy
fed21a1245 vkd3d: Implement output merger logic ops.
Using vk_logic_op_from_d3d12() from a vkd3d-proton patch by Philip
Rebohle.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 18:36:56 +02:00
Conor McCarthy
90d564f798 tests: Add tests for output merger logic ops.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 18:36:55 +02:00
Conor McCarthy
1edbd3d698 vkd3d: Pass descriptor offset info to vkd3d-shader for compute pipelines.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 22:38:15 +02:00
Philip Rebohle
ea1b01b1f8 vkd3d-shader/spirv: Implement texel offset support for sample_c instructions.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 22:38:15 +02:00
Conor McCarthy
ebc82a622c tests: Add tests for sample_c texel offsets.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 22:38:15 +02:00
Conor McCarthy
a86a681912 vkd3d: Reject 0 sample count textures in d3d12_resource_validate_desc().
Buffers with 0 sample counts were already rejected here.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 22:38:15 +02:00
Conor McCarthy
a36dfef004 tests: Add a test for 0 sample count resources to test_create_committed_resource().
Windows returns E_INVALIDARG at least on AMD and Intel.
Psychonauts 2 attempts to create resources with this argument.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 22:38:15 +02:00
Conor McCarthy
2bf4539c0d tests: Add tests for d3d12_command_list_IASetVertexBuffers() calls with NULL views.
Part of a vkd3d-proton patch by Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 22:38:15 +02:00
Conor McCarthy
832e740248 vkd3d: Reject overflowing descriptor ranges.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 22:38:06 +02:00
Conor McCarthy
8239064826 vkd3d: Reject empty descriptor ranges.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 22:38:06 +02:00
Conor McCarthy
36f6af1570 tests: Add more tests for invalid descriptor tables.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-13 22:38:06 +02:00
Conor McCarthy
41685c374a tests: Add a UINT_MAX layer count test to test_clear_depth_stencil_view().
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:38:13 +02:00
Conor McCarthy
dbb07a40f8 tests: Add UINT_MAX layer count tests to test_clear_render_target_view().
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:38:09 +02:00
Conor McCarthy
e3495613fb tests: Test a UINT_MAX layer count in test_clear_unordered_access_view_image().
Testing without the fixes in vkd3d_create_texture_uav() has nasty results in
radv and possibly others.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:38:06 +02:00
Conor McCarthy
0c3fb46a7a tests: Add a test for 5-bit masking of shader bit shift operands.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:37:51 +02:00
Conor McCarthy
8fbe785c11 tests: Use D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER for constant buffers in test_unbounded_resource_arrays().
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 21:25:27 +02:00
Conor McCarthy
58b52f6950 tests: Use a bounded range between unbounded ranges in test_unbounded_resource_arrays().
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 21:25:25 +02:00
Conor McCarthy
821bb0c5cf vkd3d-shader/spirv: Add non-uniform decorations.
Based in part on vkd3d-proton patches by Philip Rebohle and Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 21:25:22 +02:00
Giovanni Mascellani
64bd7f677c tests: Mark WriteToSubresource test as todo on NVIDIA.
Similarly to ReadFromSubresource, WriteToSubresource is currently
implemented only for images with linear tiling, which NVIDIA drivers
currently do not support.

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-10-06 22:27:04 +02:00
Conor McCarthy
104626cc1d vkd3d: Create and write descriptor sets for root signature unbounded ranges.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:28:44 +02:00
Conor McCarthy
d3090699c5 vkd3d: Reject descriptor tables containing register collisions.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:28:41 +02:00
Conor McCarthy
c5fdd2f404 vkd3d: Reject OFFSET_APPEND after unbounded ranges in d3d12_root_signature_info_count_descriptors().
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:28:38 +02:00
Henri Verbeet
441d8e24b2 tests: Add root signature tests for unbounded descriptor ranges.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:28:35 +02:00