Joshua Ashton
6b9f7b7339
include: Fix typo in d3d12 header
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-25 15:58:45 +01:00
Joshua Ashton
fcb4764228
include: Update D3D12 headers
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-25 15:58:45 +01:00
Hans-Kristian Arntzen
1ce5ea8073
vkd3d: Fix segfault when freeing pipeline library.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-25 10:26:36 +01:00
Hans-Kristian Arntzen
8a102d6a1c
dxil-spirv: Update submodule.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-24 18:58:06 +01:00
Philip Rebohle
2c9bacd760
vkd3d: Perform binary occlusion query fixup on scratch buffer.
...
Potentially avoids some unnecessary host memory access. Use BDA for
the compute shader so that we can ignore alignment restrictions on
some GPU architectures.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-24 16:45:55 +01:00
Philip Rebohle
78076a9a84
vkd3d: Introduce d3d12_resource_get_va.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-24 16:45:55 +01:00
Philip Rebohle
afb85c79cd
vkd3d: Add code to create, destroy and recycle scratch buffers.
...
Command lists may need to allocate temporary device memory for
certain operations. In order to avoid frequent alloc/free calls,
we'll recycle these scratch buffers until a certain threshold.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-24 16:45:55 +01:00
Hans-Kristian Arntzen
c0b34fdb7b
tests: Add unaligned VBO read test.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-24 15:07:29 +01:00
Hans-Kristian Arntzen
19193bf932
vkd3d: Sanitize VBO strides and VBO offsets.
...
Realign VBO strides and offsets if we have to, for sake of
robustness. Violating these rules is against D3D12 spec, but it does not
cause crashes on native drivers. On RDNA we can hit hangs with unaligned
vertex attributes. It appears that native drivers apply some kind of
fixup here to avoid the crash, even if the result is not what we expect.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-24 15:07:29 +01:00
Hans-Kristian Arntzen
10b503c893
vkd3d: Fallback to NULL VA when binding non-existent VBO.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-24 15:07:29 +01:00
Philip Rebohle
9d57489225
vkd3d-shader: Correctly handle infinity in f32tof16.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-23 15:46:55 +01:00
Philip Rebohle
ced72326be
tests: Test f32tof16 behaviour with infinity and high numbers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-23 15:46:55 +01:00
Philip Rebohle
8cbecfb9f6
vkd3d: Fix offset for predicate buffer.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-20 11:23:06 +01:00
Philip Rebohle
35f6aa22c7
tests: Remove todo for binary occlusion query test.
...
This test passes correctly now.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-19 22:08:42 +01:00
Philip Rebohle
fb6f078ba9
vkd3d: Fix up binary occlusion query results.
...
In D3D12, these return 1 rather than an actual sample count.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-19 22:08:42 +01:00
Philip Rebohle
89aea3304c
vkd3d: Always add STORAGE_BUFFER_BIT to readback buffers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-19 22:08:42 +01:00
Philip Rebohle
fdd0dbafe4
vkd3d: Add meta compute shader to resolve binary occlusion queries.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-19 22:08:42 +01:00
Philip Rebohle
6886bb7f11
vkd3d: Handle empty viewports.
...
Assassin's Creed Valhalla relies on this.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-19 14:31:39 +01:00
Philip Rebohle
ecc504922e
vkd3d: Consider mip level for 3D UAV slice check.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-19 14:20:28 +01:00
Hans-Kristian Arntzen
ffc1fa646c
vkd3d: Mask out attachments which cannot safely be written to.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-19 14:13:59 +01:00
Hans-Kristian Arntzen
0dc0d75967
vkd3d: Use VK_IMAGE_LAYOUT_UNDEFINED for unused attachments.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-19 14:13:59 +01:00
Georg Lehmann
11bdc76aa0
vkd3d: Use static init for device map.
...
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2020-11-18 18:29:48 +00:00
Georg Lehmann
24100cac07
vkd3d: Add Win32 PTHREAD_MUTEX_INITIALIZER.
...
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2020-11-18 18:29:48 +00:00
Hans-Kristian Arntzen
d0328e8760
vkd3d: Fix uninitialized variable in initial WSI transition.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 16:40:17 +01:00
Hans-Kristian Arntzen
9617a0f598
vkd3d: Disable RAW_VA root CBVs on NVIDIA.
...
BDA cannot map to their hardware, and we observe a large performance
loss in games which use root CBVs. For this reason, fall back to push
descriptors here.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 15:49:31 +01:00
Hans-Kristian Arntzen
52ee2edc3d
vkd3d: Separate root VA use for CBV and SRV/UAV.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 15:49:31 +01:00
Philip Rebohle
5a288b7d0f
tests: Adjust todos in some query tests.
...
Query init changes broke unissued timestamp queries, but
test_resolve_query_data_in_reordered_command_list passes.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 15:45:28 +01:00
Philip Rebohle
215989f6d5
vkd3d: Rework query pool initialization.
...
Ensures that queries are always available and initialized
in the correct order on the GPU timeline.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 15:45:28 +01:00
Philip Rebohle
bb9d0f2741
vkd3d: Rework initial transitions to allow for different types.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 15:45:28 +01:00
Philip Rebohle
10e82fa7a0
tests: Add missing UAV barriers in test_cs_uav_store.
...
Fixes some random test failures.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 15:05:29 +01:00
Hans-Kristian Arntzen
27f91b99b0
vkd3d-shader: Add debug log callback to DXIL.
...
Allows us to capture dxil compiler messages in log.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 14:37:58 +01:00
Joshua Ashton
a950191008
vkd3d: Implement singleton devices.
...
Matches D3D12 behaviour.
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 12:39:14 +01:00
Philip Rebohle
1563b80852
include: Fix various issues with atomic CAS.
...
- fail/success memory orders exist for a reason, we can't
e.g. do release on fail since it's a read-only operation
- silence some warnings about pointer->integer casts
- fix linker errors on mingw by marking functions as static
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 12:39:14 +01:00
Hans-Kristian Arntzen
f54ac3b9c5
vkd3d: Add app detection for buggy game: ds.exe.
...
Game renders the map with wrong descriptor type, which means we must
implement everything as texel buffers to make this work.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 12:27:19 +01:00
Hans-Kristian Arntzen
6f8ae20015
vkd3d: Add VKD3D_CONFIG option to disable bindless SSBO.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 12:27:19 +01:00
Hans-Kristian Arntzen
d947c17fc2
meta: Add missing VKD3D_DEBUG level to README.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 12:27:19 +01:00
Philip Rebohle
bab9b0af92
vkd3d: Support offset buffers for raw/structured texel buffers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Co-authored-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 12:27:19 +01:00
Hans-Kristian Arntzen
3e15a3f06a
vkd3d: Remove manual tracking of host barriers.
...
Just emit host barrier on submit unconditionally.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-17 16:34:03 +01:00
Hans-Kristian Arntzen
0f25b827e0
vkd3d: Use pipeline barrier command buffers for queue serialization.
...
We have observed a lot of large GPU bubbles when using back-to-back
timeline semaphores to synchronize GPU submissions. Use prebaked
pipeline barrier command buffers instead.
To resolve queue sparse serialization, use two binary semaphore pairs to
resolve this. There is no need to use timeline semaphores in this case.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-17 16:34:03 +01:00
Philip Rebohle
8fe83f5e9c
vkd3d-shader: Correctly handle bit shifts greater than 31 bits.
...
This is undefined behaviour in SPIR-V, but well-defined in
DXBC, so we should explicitly 'and' the shift amount with 31.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-17 15:26:36 +01:00
Hans-Kristian Arntzen
0749f46d8e
vkd3d: Re-enable wave ops.
...
dxil-spirv update fixed the issue for me.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-17 10:49:40 +01:00
Hans-Kristian Arntzen
de4293f990
vkd3d: Use SHADER_READ for CBV visibility when using ROOT_VA CBV.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-16 17:01:58 +01:00
Hans-Kristian Arntzen
30c417bdbf
dxil-spirv: Update submodule.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-16 16:55:55 +01:00
Joshua Ashton
4d95cafe10
vkd3d: Implement compare exchange atomics
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-16 09:33:26 +01:00
Joshua Ashton
1e810e8f9e
vkd3d: Use consistent comment style in atomic header
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-16 09:33:26 +01:00
Joshua Ashton
093f0eb053
vkd3d: Implement 64-bit and pointer atomics
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-16 09:33:26 +01:00
Joshua Ashton
71328b9be7
vkd3d: Handle reserved resources in host barrier code
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-16 09:25:50 +01:00
Joshua Ashton
08135f7746
vkd3d: Fix validation spam for null descriptor buffers
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-16 09:25:17 +01:00
Hans-Kristian Arntzen
412ec7ac2f
vkd3d: Enable root descriptor BDA support.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-13 17:10:48 +01:00
Hans-Kristian Arntzen
a1d851e717
vkd3d-shader: Do not require Int64 to use root descriptors.
...
Can just use uvec2. Also improves performance on ACO since ACO cannot
promote uint64_t to SGPR yet, u32x2 however, works fine and can be
bitcast to pointer as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-13 17:10:48 +01:00