Commit Graph

737 Commits

Author SHA1 Message Date
Conor McCarthy
99947deeb7 tests/d3d12: Add a test for zero description count in test_resource_allocation_info(). 2024-02-15 23:29:32 +01:00
Conor McCarthy
4668271872 vkd3d: Return DXGI_ERROR_NOT_FOUND from GetProtectedResourceSession(). 2024-02-15 23:29:32 +01:00
Conor McCarthy
e38f3995fd tests/d3d12: Add tests for GetProtectedResourceSession(). 2024-02-15 23:29:30 +01:00
Conor McCarthy
eae4b7b4a2 vkd3d: Implement GetResourceAllocationInfo1(). 2024-02-01 22:25:13 +01:00
Conor McCarthy
67b4ae658a tests/d3d12: Add tests for GetResourceAllocationInfo1(). 2024-02-01 22:25:12 +01:00
Conor McCarthy
7e84421b9c vkd3d: Support multiple descriptions in GetResourceAllocationInfo(). 2024-02-01 22:25:11 +01:00
Conor McCarthy
8d0331df6c tests/d3d12: Test multiple descriptions in test_resource_allocation_info(). 2024-02-01 22:25:10 +01:00
Evan Tang
13ac795061 tests/shader-runner: Support testing for integer pixel data.
Modified by Conor McCarthy to use read_uint() and read_uint4().
2024-02-01 22:24:54 +01:00
Giovanni Mascellani
fd7d23f64b tests: Mark a strip cut test as buggy in MoltenVK.
Metal, and therefore MoltenVK, doesn't support disabling primitive
restart.
2024-01-25 22:25:05 +01:00
Giovanni Mascellani
c5469c85e8 tests: Mark a depth sampling test as buggy on MoltenVK.
MoltenVK seems to be unable to handle tight inequalities (i.e.,
0.5 <= 0.5) properly on 16 bit depth resources.
2024-01-25 22:25:03 +01:00
Giovanni Mascellani
b6c1e6dcdf tests: Mark the tessellation pipeline as buggy on MoltenVK. 2024-01-25 22:25:03 +01:00
Giovanni Mascellani
74a14dad28 tests: Mark geometry shaders as buggy on MoltenVK. 2024-01-25 22:25:03 +01:00
Giovanni Mascellani
586ebeafec tests: Mark ReadFromSubresource() and WriteToSubresource() as todo on MoltenVK. 2024-01-25 22:25:03 +01:00
Giovanni Mascellani
17f3f2914e tests: Mark a test related to instanced draws as buggy on MoltenVK.
I haven't been able to understand what's happening here exactly,
but it doesn't look like we're generating bad Vulkan calls.
2024-01-25 22:25:01 +01:00
Giovanni Mascellani
d304422a34 tests: Mark count buffers as buggy on MoltenVK.
They require Vulkan indirect draw count extension.
2024-01-24 22:38:28 +01:00
Giovanni Mascellani
5d4edba925 tests: Mark a timestamp query test as buggy on MoltenVK.
The generated Vulkan calls look right and do not trigger any
validation error, but the returned timestamp is 0. A valid
timestamp is returned if the CopyResource() call is commented,
or the second EndQuery() call is moved before CopyResource(),
or the first EndQuery() call is commented. I am not seeing any
sensible pattern here, so I guess there is just a bug in
MoltenVK.
2024-01-24 22:38:26 +01:00
Giovanni Mascellani
66cd2af188 tests: Mark clip distance as unsupported on MoltenVK.
At least for tessellation and geometry shaders.
2024-01-24 22:38:23 +01:00
Giovanni Mascellani
9a83e568b4 tests: Mark cull distance as buggy on MoltenVK.
The generated MSL code is not accepted by the Metal runtime, and
it looks wrong anyway.
2024-01-24 22:38:19 +01:00
Giovanni Mascellani
60e0246436 tests: Skip unbounded descriptor ranges tests when they're unsupported.
They are unsupported if the Vulkan descriptor indexing extension
is not available; on MoltenVK it is known to be buggy, so it is
disabled.
2024-01-24 22:38:18 +01:00
Giovanni Mascellani
711ce4e65d tests: Mark loading from stencil as buggy on MoltenVK.
Specifically, MoltenVK seems to be able to load from stencil, but
the specific replicating swizzle (repeating the stencil value on
all the channels) is not honored. The stencil value is read only
on the red channel.
2024-01-24 22:38:15 +01:00
Giovanni Mascellani
72e2eeaf14 tests: Add a test for SV_ViewportArrayIndex. 2024-01-22 22:19:16 +01:00
Giovanni Mascellani
bd84b96e9f tests: Use test utils to create the pipeline state in test_ps_layer(). 2024-01-22 22:19:16 +01:00
Giovanni Mascellani
245cce02bd tests: Test using SV_RenderTargetArrayIndex in the vertex shader. 2024-01-22 22:19:16 +01:00
Giovanni Mascellani
5ddf745d95 tests: Compile HLSL shaders at runtime in test_ps_layer(). 2024-01-22 22:19:15 +01:00
Conor McCarthy
ca7487a56d vkd3d-shader/spirv: Handle UINT32_MAX result from FIRSTBIT_HI and FIRSTBIT_SHI instructions. 2024-01-22 22:18:27 +01:00
Conor McCarthy
62e15dac8d tests/d3d12: Add a raw firstbit test to test_shader_instructions(). 2024-01-22 22:18:25 +01:00
Conor McCarthy
83851133c5 vkd3d-shader/ir: Set merged signature element interpolation mode only from used elements. 2024-01-18 23:15:27 +01:00
Conor McCarthy
759362b527 tests: Test an interpolated PS input where component x is unused.
FXC does not emit an interpolation mode for unused elements.
2024-01-18 23:15:26 +01:00
Conor McCarthy
4c30b23821 vkd3d-shader: Make the control point count the outer dimension of I/O arrays.
The relative-addressed case in shader_register_normalise_arrayed_addressing()
leaves the control point id in idx[0], while for constant register
indices it is placed in idx[1]. The latter case could be fixed instead,
but placing the control point count in the outer dimension is more
logical.
2024-01-17 22:28:59 +01:00
Conor McCarthy
b8561d6fd2 tests: Test punned array access in patch constant functions.
The FXC optimiser sometimes converts a local array of input values into
direct array addressing of the inputs, which can result in a
dcl_indexrange instruction spanning input elements with different masks.
2024-01-17 22:28:58 +01:00
Conor McCarthy
c5bc28b454 tests/d3d12: Test vector parameter for countbits() and firstbithigh() in test_shader_instructions(). 2024-01-15 19:56:36 +01:00
Giovanni Mascellani
90bcc6691d tests: Mark resource arrays as buggy on MoltenVK.
They require Vulkan descriptor indexing extension, which is
exposed by MoltenVK but known to be buggy, so we assume it is
disabled.
2024-01-08 21:44:58 +01:00
Giovanni Mascellani
a610ccaed9 tests: Mark predicated rendering as buggy on MoltenVK.
It requires Vulkan conditional rendering extension.
2024-01-08 21:44:56 +01:00
Giovanni Mascellani
54514ba7dd tests: Mark streaming output as buggy on MoltenVK.
It requires Vulkan transform feedback extension.
2024-01-08 21:44:55 +01:00
Giovanni Mascellani
1cc2ccaf98 tests: Mark some sampling tests as buggy on MoltenVK.
Apparently Metal doesn't support specifying a bias directly in the
sampler, and, with "nearest" mip filtering, it doesn't switch
precisely at LOD 0.5 (though still between 0.5 and 0.6).
2024-01-08 21:44:53 +01:00
Giovanni Mascellani
9c9b1fadbd tests: Use a uint target for rendering uint data.
This fixes a failure in MoltenVK.
2024-01-08 21:44:50 +01:00
Stefan Dösinger
b0d1fb0bd7 tests: Show that CreatePipelineState also doesn't reuse duplicate objects. 2023-12-07 21:57:45 +01:00
Stefan Dösinger
1eaf7fa37b tests: Show that compute pipeline state objects are not reused. 2023-12-07 21:57:45 +01:00
Stefan Dösinger
82a3209ee2 tests: Show that graphics pipeline state objects are not reused. 2023-12-07 21:57:45 +01:00
Stefan Dösinger
705cf10626 tests: Show that creating identical root signatures returns the same pointer. 2023-12-07 21:57:45 +01:00
Zebediah Figura
fcd6ec33bd tests: Avoid shadowing "l" in test_get_copyable_footprints().
Found with -Wshadow.
2023-12-07 21:57:18 +01:00
Alistair Leslie-Hughes
5c134d44d6 include: D3D12_RT_FORMAT_ARRAY remove typedef to make header compatible with windows.
windows d3d12.idl doesn't have this as a typedef.
2023-11-28 00:09:20 +01:00
Conor McCarthy
63b8972b0e tests: Test CreatePipelineState().
Based on vkd3d-proton patches by Hans-Kristian Arntzen and Philip
Rebohle.
2023-11-15 21:48:44 +01:00
Conor McCarthy
130e7bdf0f tests/shader-runner: Add tests for 64-bit casts. 2023-11-15 21:48:33 +01:00
Nikolay Sivov
41a72a4eae tests: Fix some spelling mistakes. 2023-11-13 23:19:14 +01:00
Zebediah Figura
0805ce121e tests: Add more semantics to test_nop_tessellation_shaders().
To act as a regression test for 852eefc01d.
2023-11-08 22:49:51 +01:00
Giovanni Mascellani
eaf35c394d tests: Skip test_atomic_instructions() on WARP.
Pipeline creation fails with E_INVALIDARG, atomics are likely not
supported on WARP.
2023-10-16 22:36:52 +02:00
Giovanni Mascellani
0d4a5f1860 tests: Skip test_unbounded_resource_arrays() on WARP.
Most reads on WARP are off by a few units. I haven't investigated
the reason.
2023-10-16 22:36:50 +02:00
Giovanni Mascellani
fe88dafdbd tests: Skip test_execute_indirect() on WARP.
The device is eventually lost, indirect commands are likely not
supported on WARP.
2023-10-16 22:36:49 +02:00
Giovanni Mascellani
ee3c4b6555 tests: Skip test_get_copyable_footprints() on WARP.
There are 12025 failures with WARP. I haven't investigated them.
2023-10-16 22:36:47 +02:00
Giovanni Mascellani
d72e30f1d1 tests: Skip test_null_vbv() on WARP.
On WARP 0xffffffff is read instead of zero.
2023-10-16 22:36:45 +02:00
Giovanni Mascellani
14c9be697f tests: Acknowledge some double operations being broken on WARP. 2023-10-16 22:36:45 +02:00
Giovanni Mascellani
3f87cf9d7f tests: Acknowledge WARP giving a GPU handle to a non-shader-visible descriptor heap.
WARP has no GPU, so it probably treats GPU handles just like CPU handles.
2023-10-16 22:36:43 +02:00
Giovanni Mascellani
862dcf27a6 tests: Acknowledge WARP accepting some unusual CreateCommittedResource() configuration.
A software implementation can conceivably satisfy some requests that
cannot work on real hardware.
2023-10-16 22:36:41 +02:00
Nikolay Sivov
9c6c7cb78f vkd3d: Add partial implementation for CreateCommittedResource1(). 2023-10-10 22:11:46 +02:00
Nikolay Sivov
6ba75fd92f vkd3d: Add partial implementation for CreateHeap1().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-10-09 21:58:07 +02:00
Conor McCarthy
39be40ce94 tests: Destroy the test context in test_readback_map_stability(). 2023-10-02 22:25:10 +02:00
Henri Verbeet
5503a025d9 tests: Add some missing vkd3d_test_pop_context() calls to test_shader_instructions(). 2023-09-28 23:13:04 +02:00
Giovanni Mascellani
4374d45655 tests: Work around a MoltenVK bug in test_tgsm(). 2023-09-26 22:07:43 +02:00
Giovanni Mascellani
ca05e57e67 tests: Mark a bug as resolved on Mesa. 2023-09-22 11:06:57 +02:00
Giovanni Mascellani
d640b213b2 tests: Do not crash if the render target doesn't support MSAA 8.
This currently happens on MoltenVK.
2023-09-22 11:06:50 +02:00
Giovanni Mascellani
6dfdbb5c26 tests: Do not crash if a pipeline statistics query heap cannot be created.
This currently happens on MoltenVK.
2023-09-22 11:06:44 +02:00
Giovanni Mascellani
d742770499 tests: Compile HLSL shaders at runtime in test_draw_depth_only(). 2023-09-22 11:06:41 +02:00
Giovanni Mascellani
4557ad36b0 tests: Compile HLSL shaders at runtime in test_draw_depth_no_ps(). 2023-09-22 11:06:41 +02:00
Giovanni Mascellani
b7c951ba78 tests: Compile HLSL shaders at runtime in test_scissor(). 2023-09-22 11:06:41 +02:00
Giovanni Mascellani
15c5ef5bb5 tests: Compile HLSL shaders at runtime in test_fractional_viewports(). 2023-09-22 11:06:40 +02:00
Giovanni Mascellani
61b403a032 tests: Compile HLSL shaders at runtime in test_unknown_dsv_format(). 2023-09-13 23:11:04 +02:00
Giovanni Mascellani
264ff9e2da tests: Compile HLSL shaders at runtime in test_unknown_rtv_format(). 2023-09-13 23:11:04 +02:00
Giovanni Mascellani
b1cae0dd1e tests: Compile HLSL shaders at runtime in test_multiple_render_targets(). 2023-09-13 23:11:04 +02:00
Giovanni Mascellani
f7354ff9e3 tests: Compile HLSL shaders at runtime in test_create_compute_pipeline_state(). 2023-09-13 23:11:04 +02:00
Evan Tang
f374934281 tests: Test CopyResource depth to color. 2023-08-24 21:43:59 +02:00
Conor McCarthy
1e178efa01 tests/d3d12: Add tests for GetResourceTiling().
Based on vkd3d-proton patches by Philip Rebohle and
Hans-Kristian Arntzen.
2023-07-31 21:07:56 +09:00
Conor McCarthy
31ff1fa9b6 tests: Test releasing the command signature immediately after use.
D3D12 docs are silent on a required lifetime and immediate release
works in Windows.
2023-07-24 22:40:54 +02:00
Conor McCarthy
9014183100 vkd3d: Return a null handle from GetGPUDescriptorHandleForHeapStart() for non-shader-visible heaps. 2023-07-20 22:33:17 +02:00
Conor McCarthy
981034e6e4 tests: Test GetGPUDescriptorHandleForHeapStart() on a non-shader-visible heap. 2023-07-20 22:33:07 +02:00
Conor McCarthy
6835e8176f vkd3d-shader/ir: Normalise signatures and input/output registers to the Shader Model 6 pattern.
In Shader Model 6 each signature element can span a range of register
indices, or 'rows', and system values do not share a register index with
non-system values. Inputs and outputs are referenced by element index
instead of register index. This patch merges multiple signature elements
into a single element under the following conditions:

- The register index in a load or store is specified dynamically by
  including a relative address parameter with a base register index. The
  dcl_index_range instruction is used to identify these.
- A register declaration is split across multiple elements which declare
  different components of the register.
- A patch constant function writes tessellation factors. These are an
  array in SPIR-V, but in SM 5.x each factor is declared as a separate
  register, and these are dynamically indexed by the fork/join instance
  id. Elimination of multiple fork/join phases converts the indices to
  constants, but merging the signature elements into a single arrayed
  element matches the SPIR-V output.

All references to input/output register indices are converted to element
indices. If a relative address is present, the element index is moved up
a slot so it cannot be confused with a constant offset. Existing code
only handles register index relative addressing for tessellation factors.
This patch adds generic support for it.
2023-05-24 22:00:29 +02:00
Nikolay Sivov
f470c00453 tests: Add support for UAV buffers to d3d12 runner.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-22 22:03:36 +02:00
Nikolay Sivov
74c0ad0a7a tests: Rename readback helper to be more generic.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-05-22 22:03:28 +02:00
Conor McCarthy
7917a68241 tests/d3d12: Test register relative addressing in vertex and pixel shaders. 2023-05-03 21:12:09 +02:00
Conor McCarthy
db7359f36a tests: Test index buffer location zero in test_draw_indexed_instanced().
Only verify it doesn't crash.
2023-04-19 20:46:53 +02:00
Conor McCarthy
5244fa572f tests: Test null addresses in test_update_root_descriptors(). 2023-04-19 20:46:00 +02:00
Conor McCarthy
6db9ed14dc vkd3d: Support 1D UAV. 2023-04-18 22:00:17 +02:00
Conor McCarthy
7d0aaea4f8 tests: Test 1D UAV clear. 2023-04-18 22:00:01 +02:00
Zebediah Figura
94ff9ba5e7 tests: Add a test for readback map stability.
Resident Evil 2 accesses a resource immediately after unmapping it.
2023-04-10 21:00:26 +02:00
Zebediah Figura
dfa4bfdd03 include: Make test context information nestable.
Based on Wine.
2023-04-04 21:59:58 +02:00
Zebediah Figura
8186b75228 tests: Use a pixel shader that consumes SV_Position in test_query_pipeline_statistics().
Some drivers (AMD Radeon RX 6700 XT, with radeonsi from Mesa 22.2.0-rc3) emit
less than one invocation per pixel, presumably because they detect that the
shader control flow is uniform for all pixels. Having the control flow depend on
SV_Position avoids this test failure.

Cf. 34bd0dd0704c613abef8a9aa3ba2a2507ed02843 in wine.
2023-04-03 18:00:37 +02:00
Giovanni Mascellani
9a27df3a8c tests: Read integer uniforms with strtol() and strtoul().
Because %i sscanf() converters are deprecated, and in practice
clamp to [-2^31, 2^31) on 32 bit.
2023-04-03 18:00:14 +02:00
Conor McCarthy
c87a292f98 tests: Release and then use a heap which contains resources.
The expected use case where a heap is freed before its contained
resources is not reasonably testable, so the ability to place a new
resource is tested instead.
2023-04-03 17:59:43 +02:00
Zebediah Figura
9ea84ae8c9 tests/shader_runner: Use the global test_options structure.
Inspired by a patch by Giovanni Mascellani.
2023-03-10 21:13:05 +01:00
Giovanni Mascellani
c8a05a8b10 tests: Collect D3D12 test options in a dedicated structure. 2023-03-10 21:12:46 +01:00
Zebediah Figura
809a43f06b tests: Add a test for compute thread IDs. 2023-01-25 22:10:30 +01:00
Conor McCarthy
fc652d2b27 tests: Test a typed UAV buffer in test_atomic_instructions().
Until vkd3d-shader is patched, an atomic op on a typed buffer where
StorageImageReadWithoutFormat is available will cause SPIR-V validation
failure, and assertion in Mesa debug builds, because the image will be
declared with Unknown format.
2022-11-21 18:28:42 +01:00
Zebediah Figura
75494a4ae6 tests: Add a basic shader test for compute shaders. 2022-10-19 21:59:29 +02:00
Zebediah Figura
53d6966a5d tests: Mark test_hull_shader_relative_addressing() as broken on radv.
Broken for me with "AMD Radeon RX 560 Series (RADV POLARIS11)" (1002:67ef) but works with llvmpipe; Mesa 22.2.0-rc3.
2022-09-19 21:51:30 +02:00
Zebediah Figura
7393e6ed13 tests: Transition back to D3D12_RESOURCE_STATE_RENDER_TARGET in test_bufinfo_instruction(). 2022-09-19 20:13:57 +02:00
Conor McCarthy
4afe69d04a vkd3d: Send typed UAV unknown format read support info to vkd3d-shader.
Fixes reflections in Control appearing with only their red component.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52146
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
2022-08-09 22:14:28 +02:00
Conor McCarthy
d7554accbc tests: Test float4 UAV buffer load/store.
This currently fails if the shader loads from the UAV, because it causes
vkd3d-shader to specify the R32f format instead of Unknown.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
2022-08-09 22:14:08 +02:00
Giovanni Mascellani
6ff6cb4ed2 tests/shader_runner: Allow probing a single component.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
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-05-31 21:53:26 +02:00
Zebediah Figura
b5e773058c tests: Separate generic and d3d12-specific readback fields.
Move the "resource" field to a new "d3d12_resource_readback" structure
encapsulating struct resource_readback.

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-05-31 21:52:49 +02:00
Conor McCarthy
8cae046803 vkd3d: Map timeline semaphore values to fence virtual values and buffer out-of-order waits.
Strictly increasing timeline values must be mapped to fence virtual values
to avoid invalid use of Vulkan timeline semaphores. In particular, non-
increasing values and value jumps of >= 4G are permitted in d3d12.

Different virtual D3D12 command queues may map to the same Vulkan queue.
If a wait of value N is submitted on one command queue, and then a signal
for >= N is submitted on another, but they are sent to the same Vk queue,
the wait will never complete. The solution is to buffer out-of-order waits
and any subsequent queue commands until an unblocking signal value is
submitted to a different D3D12 queue, or signaled on the CPU.

Buffering out-of-order waits also fixes the old fence implementation so it
is fully functional, though a bit less efficient than timeline semaphores.

Based in part on vkd3d-proton patches by Hans-Kristian Arntzen. Unlike the
vkd3d-proton implementation, this patch does not use worker threads for
submissions to the Vulkan queue.

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-05-13 18:20:10 +02:00