Georg Lehmann
b858f8a478
vkd3d: Don't error out if vkGetPhysicalDeviceFragmentShadingRatesKHR isn't found.
...
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-04-24 18:23:46 +01:00
Hans-Kristian Arntzen
99a180f7a1
vkd3d-utils: Fix .def version.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-22 15:30:58 +01:00
Hans-Kristian Arntzen
be1b941e06
vkd3d: Workaround buggy NV driver in sparse update.
...
test_update_tile_mappings fails if we don't do this.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-21 16:29:05 +02:00
Joshua Ashton
3d0913dc19
d3d12: Initialize optional extensions
...
This was missed and somehow magically worked fine when running the test suite for me.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-21 00:48:43 +02:00
Joshua Ashton
3118696706
vkd3d-utils: Bump SONAME version to 3.0.0
...
We made breaking ABI changes.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
911a202bd1
vkd3d: Bump SONAME version to 3.0.0
...
We made breaking ABI changes.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
a3ad7cae90
vkd3d-shader: Remove type/next from interface structures
...
This was never really used for anything useful.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
0c8349cb8e
vkd3d-shader: Remove vkd3d_shader_domain_shader_compile_arguments
...
This is never used by anything, and all the info is in the shader anyway.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
220e1146ee
vkd3d-shader: Make vkd3d_shader_transform_feedback_info a member
...
Moves it into vkd3d_shader_interface_info, this doesn't need to be
a pNext.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
3e4a8b1504
vkd3d: Remove type/next from vkd3d device/instance structures
...
There's really no reason to overcomplicate adding optional extensions this way.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
bd988f2b74
vkd3d: Remove vkd3d_optional_device_extensions_info
...
Roll this into vkd3d_device_create_info, no need for this to be a pNext thing.
Additionally, fix some memory leaks on device creation failure.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton
59148c1932
vkd3d: Remove vkd3d_optional_instance_extensions_info
...
Roll this into vkd3d_instance_create_info, no need for this to be a pNext thing.
Additionally, fix some memory leaks on instance creation failure.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Philip Rebohle
f06f94bfb4
vkd3d: Enable multi_queue by default.
...
And replace option with a single_queue flag to do the opposite.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-19 16:40:49 +02:00
Joshua Ashton
07e801192f
vkd3d-shader: Resolve arguments to variable before passing to epilogue
...
Otherwise we pass in a pointer which is bad, or a local value which is also illegal for some reason.
It has to be a "memory object declaration".
Found via. spirv-val
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-19 13:19:44 +02:00
Joshua Ashton
4470ec63cc
vkd3d-shader: Don't emit builtin clip/cull arrays for hull shaders
...
There are no output built-ins here, just per-vertex stuff passed directly to DS to deal with there.
Closes : #227
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-19 13:19:44 +02:00
Joshua Ashton
94a9719557
vkd3d-shader: Rename vkd3d_dxbc_compiler_emit_shader_signature_outputs to vkd3d_dxbc_compiler_emit_clip_cull_outputs
...
This only ever emits these.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-19 13:19:44 +02:00
Joshua Ashton
000407d74c
vkd3d-shader: Enable Clip/Cull distance capabilities
...
Found via. spirv-val
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-19 13:19:44 +02:00
Hans-Kristian Arntzen
c7eb6fdf61
vkd3d: Add some tracing to help narrow down compiler crashes.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-15 16:24:05 +02:00
Hans-Kristian Arntzen
6292078433
vkd3d-shader: Return INVALID_ARGUMENT instead of SHADER.
...
For invalid bindings, we expect E_INVALIDARG in D3D12.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-15 16:24:05 +02:00
Hans-Kristian Arntzen
744497274c
vkd3d-shader: Verify that we compile expected shader stage.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-15 16:24:05 +02:00
Hans-Kristian Arntzen
8f17fdd1fa
vkd3d: Don't leak pipeline cache if we fail compile.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-15 16:24:05 +02:00
Hans-Kristian Arntzen
e7b6cf4089
vkd3d-shader: Report error if binding is not found in root signature.
...
Error out early.
Fixes some crashes when we keep going after having seen completely
broken bindings.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-15 16:24:05 +02:00
Philip Rebohle
62cbf3d78a
vkd3d: Remove unused unsafe_impl_from_ID3D12CommandAllocator.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-14 16:24:55 +02:00
Philip Rebohle
4f9ca6c3df
vkd3d: Create bundles and bundle allocators as necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-14 16:24:55 +02:00
Philip Rebohle
1bbbabcb94
vkd3d: Implement ExecuteBundle.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-14 16:24:55 +02:00
Philip Rebohle
728ce6c370
vkd3d: Validate command list type in ExecuteCommandLists.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-14 16:24:55 +02:00
Philip Rebohle
1990270bbb
vkd3d: Implement CreateCommandList on top of CreateCommandList1.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-14 16:24:55 +02:00
Philip Rebohle
2ca62ecd12
vkd3d: Add bundle allocator and command list implementation.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-14 16:24:55 +02:00
Joshua Ashton
2860b0a548
vkd3d: Enable force_tgsm_barriers for F1 2020
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Closes : #611
2021-04-12 16:29:57 +02:00
Joshua Ashton
043fd304f8
vkd3d-shader: Add force_tgsm_barriers config flag
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 16:29:57 +02:00
Joshua Ashton
7cfe17d2f5
vkd3d-shader: Passthrough vkd3d_config_flags
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 16:29:57 +02:00
Joshua Ashton
41df41305e
include: Move vkd3d_config_flags to public header
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 16:29:57 +02:00
Joshua Ashton
5978f5958e
vkd3d: Expose TIER_2 Variable Rate Shading
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 13:22:01 +02:00
Joshua Ashton
9fb624a429
vkd3d: Implement RSSetShadingRateImage
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 13:22:01 +02:00
Joshua Ashton
5d17f71441
vkd3d: Handle usage and implicit views for VRS capable resources
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 13:22:01 +02:00
Joshua Ashton
135c7332e4
vkd3d: Implement D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 13:22:01 +02:00
Joshua Ashton
601357c7c5
vkd3d: Implement a static pipeline variant system
...
Needed so we can switch between having a VRS and non-VRS attachment on the fly.
Extensible enough for this to work for other things down the line also.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 13:22:01 +02:00
Philip Rebohle
4e777b9182
vkd3d: Use depth attachment when depth bounds test is enabled.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-12 11:23:51 +02:00
Hans-Kristian Arntzen
7dc2a5cad7
vkd3d: Enable VK_KHR_sampler_mirror_clamp_to_edge.
...
CP77 requires it now.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-04-07 21:57:50 +02:00
Philip Rebohle
2f1b23ece6
vkd3d: Enable conservative rasterization tier 3.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-25 18:00:59 +01:00
Philip Rebohle
6476fabb0b
vkd3d-shader: Implement support for SV_InnerCoverage.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-25 18:00:59 +01:00
Philip Rebohle
698279ec90
vkd3d: Enable conservative rasterization state as requested.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-25 18:00:59 +01:00
Philip Rebohle
8a61128152
vkd3d: Enable VK_EXT_conservative_rasterization if available.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-25 18:00:59 +01:00
Philip Rebohle
fdf4df18a4
vkd3d: Add Feature Level 12_2 detection.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-25 18:00:59 +01:00
Hans-Kristian Arntzen
2f60a3bf66
vkd3d: Fix broken debug_vk_memory_{property,heap}_flags.
...
C is fun, yo. Returned data from dead stack variable, also triggered
overflow in some cases.
Uncalled in release mode, but can crash debug builds.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-25 17:58:18 +01:00
Joshua Ashton
fe28436c34
vkd3d: Refactor vkd3d_render_pass_key to use flags
...
We're going to need more state in this key for VRS TIER_2 and we need to keep this aligned.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-24 15:20:10 +01:00
Joshua Ashton
65b13f6cd6
vkd3d: Use VK_KHR_create_renderpass2
...
We need this before implementing TIER_2 variable rate shading.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-24 15:20:10 +01:00
Hans-Kristian Arntzen
5197edb03b
vkd3d: Enable 16-bit storage features.
...
Don't need extension, since VK_KHR_16bit_storage is core in Vulkan 1.1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-23 18:35:35 +01:00
Hans-Kristian Arntzen
4afd4d355b
vkd3d: Handle more DXR cases.
...
Found in Ghostrunner, still not working ...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-23 18:35:35 +01:00
Hans-Kristian Arntzen
e0374d735d
vkd3d-shader: Add shader replacement support for DXR as well.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-23 18:35:35 +01:00
Hans-Kristian Arntzen
5abc4b9af2
vkd3d: Add all relevant RT stages to push constant layout.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-23 18:35:35 +01:00
Hans-Kristian Arntzen
9d3603c336
vkd3d: Fix root descriptor RTAS.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-23 18:35:35 +01:00
Hans-Kristian Arntzen
9fa668867e
vkd3d: Hold private reference to collection objects.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-23 18:35:35 +01:00
Hans-Kristian Arntzen
bd16d1a88d
vkd3d: Support RTPSO object collections.
...
This is quite complicated, but we can use VK_KHR_pipeline_library
to implement this functionality.
2021-03-23 18:35:35 +01:00
Joshua Ashton
bc1b18dc02
vkd3d: Add some missing flags in debug_vk helpers
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-22 14:29:45 +01:00
Joshua Ashton
d97683a8a4
d3d12: Rename d3d12_get_physical_device to d3d12_find_physical_device
...
A more accurate description of what's going on here.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-22 14:29:45 +01:00
Joshua Ashton
9f778bc871
d3d12: Use vkGetPhysicalDeviceProperties2
...
This is core in Vulkan 1.1.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-22 14:29:45 +01:00
Joshua Ashton
2fa97aa0fb
vkd3d: Move API versions to public header
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-22 14:29:45 +01:00
Joshua Ashton
258173a0a7
vkd3d: Fix return value when WRITE_WATCH is forbidden
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-18 16:10:05 +01:00
Joshua Ashton
aa12817ccf
vkd3d: Implement D3D12_HEAP_TYPE_WRITE_WATCH
...
Needed for D3D12 APITrace
Closes : #373
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-18 14:41:46 +01:00
Hans-Kristian Arntzen
52a9c85bf2
vkd3d: Implement ClearState.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-18 10:50:21 +01:00
Joshua Ashton
4e31f5d54d
vkd3d: Align d3d12_rtv_desc to D3D12_DESC_ALIGNMENT
...
Otherwise we can do an alligned_malloc with a non-aligned size as the descriptor size is 48 for a d3d12_rtv_desc otherwise.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-16 21:45:28 +01:00
Joshua Ashton
5b5293ec93
vkd3d: Fix out of range in UpdateTileMappings
...
Previously this incremented and indexed before the loop checked this.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-16 21:45:13 +01:00
Philip Rebohle
dadace33b1
vkd3d: Fix potential hang in d3d12_command_queue_Release.
...
This can happen if the fence thread starts with a delay and
the queue gets destroyed shortly after being created.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-16 21:42:39 +01:00
Hans-Kristian Arntzen
34a09967d5
vkd3d: Prefer compute queues for TRANSFER.
...
TRANSFER + CONCURRENT is generally death for compression.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-16 21:41:37 +01:00
Hans-Kristian Arntzen
95fe4b61a6
vkd3d: Do not drop pending signals when signaling fence on CPU.
...
There isn't much of a reason why we should have to do this. The original
implementation was more of a hack if anything.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-16 21:41:37 +01:00
Hans-Kristian Arntzen
e7672c3233
vkd3d: Refactor where max pending timeline value is computed.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-16 21:41:37 +01:00
Hans-Kristian Arntzen
dbdbf94083
vkd3d: Ensure that virtual timeline values are updated in-order.
...
Increment physical value one by one, find the exact timeline value we're
supposed to signal and perform the update.
Select lowest physical timeline value correctly.
Array can be reordered now, so lowest value isn't necessarily first.
Fixes some super weird hangs in Control DXR.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-16 21:41:37 +01:00
Philip Rebohle
eab288bb4e
vkd3d: Simplify fence worker implementation.
...
Avoids potential busy-waiting on the driver with WAIT_ANY_BIT.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-16 12:43:24 +01:00
Philip Rebohle
93a80d5eaa
vkd3d: Create one fence worker per command queue.
...
Rather than one per device. This solves issues with D3D12 fences
being signalled too late because the fence worker is waiting on
a different set of semaphores while the fence is being enqueued.
Greatly increases performance in Horizon Zero Dawn and Death
Stranding with multi-queue mode enabled.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-16 12:43:24 +01:00
Philip Rebohle
34bca90a9c
vkd3d: Implement internal reference counting for d3d12_fence.
...
This will be necessary once we introduce fence workers per
command queue, since we cannot reliably store pointers to
queues.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-16 12:43:24 +01:00
Hans-Kristian Arntzen
102ea2211b
vkd3d: Ignore IASetVertexBuffers for NULL pViews.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-15 14:55:53 +00:00
Hans-Kristian Arntzen
5b2cc545e8
vkd3d: Convert RTAS geometry flags.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-15 14:55:03 +00:00
Hans-Kristian Arntzen
c425343f41
vkd3d: Remove FIXME spam for pResourceAfter = NULL cases.
2021-03-15 14:10:27 +01:00
Philip Rebohle
0e4ef88d18
vkd3d: Don't broadcast semaphore waits when zeroing memory.
...
Instead, let queues wait on demand.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
7185e9776d
vkd3d: Introduce vkd3d_queue_add_wait.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
724257c0d8
vkd3d: Add multi_queue config flag.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
859aa3fd5a
vkd3d: Use VK_SHARING_MODE_CONCURRENT if multi-queue is enabled.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
1e3c91579e
vkd3d: Create one vkd3d queue per Vulkan device queue.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
3cd93781ff
vkd3d: Create multiple queues per queue family if possible.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
6967b1e92b
vkd3d: Wait for queue idle before destroying vkd3d queue.
...
Fixes a potential issue where we may destroy objects that
are still in use by the GPU.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
b0309f6f90
vkd3d: Introduce d3d12_device_allocate_vkd3d_queue.
...
Replaces d3d12_device_get_vkd3d_queue when mapping D3D12
command queues to Vulkan device queues.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
7359686609
vkd3d: Introduce d3d12_device_get_vkd3d_queue_family.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Philip Rebohle
4c0a0b0467
vkd3d: Introduce vkd3d_queue_family_info.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-15 12:52:00 +01:00
Hans-Kristian Arntzen
b44bfa7066
vkd3d: Remove obsolete comment.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-13 06:26:27 +00:00
Hans-Kristian Arntzen
43370c6426
vkd3d: Only enable DXR if requested.
...
The implemnentation is not complete enough to safely enable it, since
some games will try to create RTPSOs by default, leading to crashes.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
58615cd5dc
vkd3d: Allow devices with recursion of 1 to be accepted.
...
We can fail RTPSOs later if they for whatever reason use recursion.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
d9be9b57f2
vkd3d: Actually use RGBA16 formats for RT VBO.
...
It's really supposed to load 4 components and ignore. RGB16 is not
mandatory, so just use the "expected" formats after all.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
2b6658da67
vkd3d: Enable RT tier 1.0 if possible.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
c5c45b851f
vkd3d-shader: Add missing stage conversion for RT.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
4f2776ff93
vkd3d-shader: Dump RT export SPIR-V.
...
Need one unique blob per export.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
3358fca922
vkd3d: Implement local root signature association.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Hans-Kristian Arntzen
028b87ab61
vkd3d: Fix some trivial bugs with local root signatures.
...
Did not properly allocate bindings.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-12 12:20:10 +01:00
Philip Rebohle
85f15916c4
vkd3d: Optimize unmapping adjacent resource regions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-11 13:57:45 +01:00
Philip Rebohle
2ef8106136
vkd3d: Optimize sparse binding for buffers and full subresources.
...
Compacts ranges and only issues one bind for buffer ranges and
full subresource updates, rather than one bind per tile.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-10 13:18:44 +01:00
Philip Rebohle
ead9f2d620
vkd3d: Store subresource index in d3d12_sparse_image_region.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-10 13:18:44 +01:00
Hans-Kristian Arntzen
ff78b2df1c
vkd3d: Dump DXIL when parsing entry points as well.
...
Parse can fail, and it's is useful to debug that.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 13:08:25 +01:00
Hans-Kristian Arntzen
cd876284e0
vkd3d: Fix some const warnings on MSVC.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 10:48:01 +00:00
Hans-Kristian Arntzen
0bf3a1d441
vkd3d-shader: Recognize recent descriptor range flag.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen
13d132f1c4
vkd3d: Add support for hoisting CBV descriptors to push descriptors.
...
Bindless CBV is *pretty* bad on NVIDIA, so add a code path which can
promote descriptor table CBVs into push descriptors.
We can safely do this with Root Signature 1.1 STATIC or
the somewhat obscure STATIC_KEEPING_BUFFER_BOUNDS_CHECKS.
With VOLATILE, which basically all titles are using,
we can still force this behavior through a config flag,
but this is an incorrect speed hack. It works in most
titles however, since bindless CBV is exceptionally rare.
We only hoist descriptors when the root signature range has 1 descriptor
anyway, so we should avoid any reasonable bindless scenario.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen
d758a6e296
vkd3d: Convert Root Signatures to 1.1.
...
We will be able make use of the use STATIC vs VOLATILE flags.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen
c409d0f30a
vkd3d: Optimize R32UI texel buffer creation.
...
There is no need to scan through the Vulkan format list,
especially since texel buffer creation happens in the hot path
in cases where we know we need to create R32UI texel buffer views.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen
3e876c2857
vkd3d: Log VKD3D_CONFIG with INFO.
...
Useful to make sure we actually passed it correctly ...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen
c351dfc8d3
vkd3d: Remove dead code from d3d12_command_list.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-05 15:49:28 +01:00
Hans-Kristian Arntzen
b34af6a7fa
vkd3d: Convert RT vertex format correctly.
...
Context sensitive formats, oh boy!
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Hans-Kristian Arntzen
686a3efc08
vkd3d: Verify VBO RTAS support when checking RT tier.
...
Format conventions for RT are ... special.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Hans-Kristian Arntzen
b5d433baaa
vkd3d: Implement RTAS clone and compact copy operations.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Philip Rebohle
39513d6503
vkd3d: Silence log spam around Min LOD Clamp.
...
This seriously hurts performance in AC:Valhalla.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-04 13:37:05 +01:00
Philip Rebohle
5e94183975
vkd3d-shader: Do not insert branch to loop header if outside of block.
...
Fixes invalid SPIR-V in case there is an unconditional break right
before the loop ends.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-04 13:36:31 +01:00
Philip Rebohle
ba8e306452
vkd3d-shader: Ignore break instructions if there is no active block.
...
This can happen if a continue statement is immediately followed
by a break instruction in a switch case.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-04 13:36:31 +01:00
Joshua Ashton
47606f4339
build: Rename vkd3d_msvc and vkd3d_clang
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-03 19:22:44 +01:00
Hans-Kristian Arntzen
031ad9e139
vkd3d: Track dynamic pipeline stack size
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
9588ec082e
vkd3d: Fix warnings when AS is used without support.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
fcd00f0559
vkd3d: Implement DispatchRays.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
b162e5ec72
vkd3d: Refactor descriptor updates.
...
We might have to emit to different bind point than our binding entry
suggests due to DXR, so pass down information explicitly to leaf
functions.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
eeaca4a500
vkd3d: Pass down raygen pipeline layout to command list.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
0b161f5693
vkd3d: Implement SetPipelineState1.
...
Refactor push constant invalidation to SetPipelineState,
it is technically more correct to only invalidate when actually pushing
constants, but we need to do full state invalidation when transitioning
between RT pipelines and non-RT pipelines due to bind point aliasing
shenanigans in D3D12, so it makes more sense to invalidate state based
on active bind point there.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
77089065cd
vkd3d: Compute default pipeline stack size.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
9ffa3bf351
vkd3d: Support CreateSRV with RTAS.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen
9ff7b82235
vkd3d: Rename VKD3D_DESCRIPTOR_FLAG_UAV_COUNTER to RAW_VA_BUFFER.
...
We're going to place acceleration structures here.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Joshua Ashton
3224688295
vkd3d: Enable VK_EXT_debug_utils conditionally
...
Enabling VK_EXT_debug_utils comes at some overhead in Wine due to the object tracking required. There is also likely a non-zero overhead in some native implementations also.
By enabling this conditionally, we can also avoid additional overhead from apps that set debug labels on both the Vulkan and front-end side.
The default condition is to enable it when building with Renderdoc integration or in debug builds.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton
91fc472601
vkd3d: Add mechanism for conditional extensions
...
Add a way to enable an extension via config flags.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton
4c6f5375a6
vkd3d: Refactor config_flags to be global rather than instance state
...
Makes it so we can access it in code where we have no concept of a device/instance.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton
64a6bae1a0
vkd3d: Remove vkd3d_application_info structure
...
This thing has no right to exist.
We don't get this information in D3D12 and it's getting in the way of me refactoring config flags.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton
4da76cb51b
vkd3d: Simplify properties/features tracing
...
Simplifies this to make it easier to add new properties/features
so we don't have a bunch of pointers to things that are just a child
of the device info structure.
Fixes warnings when compiling without traces too.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Hans-Kristian Arntzen
89fbe334df
vkd3d: Redirect push constants to their bind point stages.
...
Gives a massive boost on NVIDIA for some reason.
RADV defers push constant update, so ALL_STAGES doesn't have
that much of a perf hit.
~20% uplift in RE2, ~5% uplift in CP77 from some quick and dirty testing.
Seems to be heavily content dependent either way.
Also a bug fix, since we would clobber graphics push constants from
compute and vice versa if both graphics and compute used the same root
signature.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-26 17:06:18 +01:00
Hans-Kristian Arntzen
3839f5e17c
vkd3d: Ignore known useless validation warnings.
...
These only clutter up validation in testing.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-26 15:04:11 +01:00
Joshua Ashton
8c9527cdf7
vkd3d: Refactor SetName implementation
...
As per MSDN, SetName is just a wrapper around SetPrivateData and a specific GUID.
Some apps and tools will use this to retrieve their name back.
So instead, just forward the name to Vulkan in the SetPrivateData call.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-25 21:51:43 +01:00
Joshua Ashton
a76daad03f
vkd3d-common: Add vkd3d_strdup_n
...
There is no strndup on Windows.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-25 21:51:43 +01:00
Philip Rebohle
26f5745ea1
vkd3d: Don't use SHADER_STAGE_ALL for push constants.
...
Instead, infer the required stages from the D3D12 shader visibility
field from all root parameters that we map to push constants.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-25 20:28:07 +01:00
Philip Rebohle
c37e705761
vkd3d: Use push constant stage mask from root signature.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-25 20:28:07 +01:00
Hans-Kristian Arntzen
4fe5b9388d
vkd3d: Do not disable robustness, ever.
...
There are pragmatic reasons for not following spec 100% here.
The only known case where UpdateAfterBind robustness is not exposed
seems to be somewhat bogus, and we cannot run D3D12 correctly without
robustness either way.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 17:53:48 +01:00
Hans-Kristian Arntzen
be9c376fde
vkd3d: Implement postbuild info queries.
...
Can only support a subset in Vulkan without extra heroics. The DXR API
lets you query things that you technically should know apriori in the
application. We might need to allocate some side-channel buffers on
demand, but let's defer that until actually needed ... :\
DXR is also very awkward in that we have a query which is resolved in
UNORDERED_ACCESS state instead of COPY_DEST state, so we'll have to
ping-pong through some barriers redundantly.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
4365f9962f
vkd3d: Allocate query pools based on type index instead of D3D12 type.
...
Postbuild info is a query in Vulkan, but not so in D3D12.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
a5aac500bc
vkd3d: Basic implementation of GraphicsCommandList::BuildRTAS().
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
3353ed14de
vkd3d: Implement RTAS object creation.
...
When building acceleration structures, we need to have an
VkAccelerationStructureKHR object, but the D3D12 API just uses a plain
VA = ID3D12Resource::GetGPUVA() + offset.
For this to work, we need to resolve the VA back to VkBuffer + offset.
The only VkBuffer we can lookup is the original backing memory
allocation in the VA map, and that allocation itself must own a view
map, since we cannot tie the VA to any specific ID3D12Resource.
Since creating an RTAS is not the common path, we allocate the view map
on-demand with CAS.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
0fc80d9067
vkd3d: Emit RT barriers as required.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
221a658884
vkd3d: Mark resources as being RTAS depending on initial resource state.
...
RTAS must stay in this resource state forever. The only way to
synchronize them is UAV barriers.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
86f7fdfe7a
vkd3d: Add RTAS buffer usage flags.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
83861cceed
vkd3d: Allow RTAS initial resource state.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
2afe25c0c8
vkd3d: Implement GetRaytracingAccelerationStructurePrebuildInfo.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
d773e67fff
vkd3d: Add helper query to check if RT should be used.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-25 16:14:16 +01:00
Hans-Kristian Arntzen
a90ed938b4
vkd3d-shader: Pass down SBT descriptor size to dxil-spirv.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-23 12:28:19 +01:00
Hans-Kristian Arntzen
15e36a0430
vkd3d: Use virtual VAs for descriptor heap GPU VAs.
...
Allows local root signatures to work correctly and is also a good
optimization since we no longer need to dereference memory (potentially
cold cache lines) to figure out heap offset in command buffer.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-23 12:28:19 +01:00
Hans-Kristian Arntzen
1af3f9c65f
vkd3d: Use calloc for d3d12_device instead of manual memset.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-23 12:28:19 +01:00
Hans-Kristian Arntzen
1586a75ada
vkd3d: Align d3d12_desc to 64 bytes.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-23 12:28:19 +01:00
Hans-Kristian Arntzen
0c94e07ab2
vkd3d: Elide timeline semaphore waits which can be satisfied implicitly.
...
If we're signalling and waiting on same physical queue (always true for
current SINGLE_QUEUE define), we can rely on submission boundary
synchronization which doesn't require any extra submissions to resolve.
Avoids awkward GPU driver bubbles with back to back signal -> wait pairs
with timeline.
Observed 2% GPU uplift on RE2 on AMD.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-22 13:00:22 +01:00
Philip Rebohle
1d7e424c44
vkd3d: Mask certain heap flags when suballocating memory.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-19 20:18:24 +01:00
Philip Rebohle
f6c6a76735
vkd3d: Store original heap flags in d3d12_resource again.
...
Otherwise, when suballocating memory, GetHeapProperties may
not return the exact same set of flags if we ignore flags
when looking up suitable chunks.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-19 20:18:24 +01:00
Philip Rebohle
be080edc7f
vkd3d: Remove vkd3d_allocate_resource_memory.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-19 19:51:44 +01:00
Philip Rebohle
a1e5b78bc4
vkd3d: Suballocate committed images if possible and if supported by the driver.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-19 19:51:44 +01:00
Philip Rebohle
a1ffea1800
vkd3d: Fix integer underflow when checking for suitable free ranges.
...
The difference between a range's offset and the aligned
offset may be greater than the size of that range.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-19 18:11:36 +01:00
Joshua Ashton
bb3e5f6cad
vkd3d: Account for front buffer in swapchain image count
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-19 13:17:15 +01:00
Philip Rebohle
be4391b972
vkd3d: Align images manually to meet Vulkan requirements if necessary.
...
Allows us to not allocate device memory for certain render targets on
Polaris GPUs.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 18:25:23 +01:00
Philip Rebohle
d6a4826099
vkd3d: Remove heap_offset member from d3d12_resource.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
56ff4622b6
vkd3d: Remove cookie member from d3d12_resource.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
6e81621b82
vkd3d: Remove gpu_address member from d3d12_resource.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
833d7e207c
vkd3d: Remove vk_buffer/vk_image union from d3d12_resource.
...
Use the unique_resource struct instead.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
5a0a5ef44b
vkd3d: Remove unused resource flags and rename SPARSE -> RESERVED.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
6a34d3d204
vkd3d: Remove _2 suffix from memory allocation functions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
53f6a9c78a
vkd3d: Rename _2 suffix from resource creation functions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
a2e14d7d1d
vkd3d: Remove _2 suffix from d3d12_heap_2 and related functions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
6f8bb2a4c0
vkd3d: Use vkd3d_allocate_device_memory_2 for sparse metadata.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
12f0c11c7f
vkd3d: Simplify vkd3d_allocate_image_memory helper.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
ab2c190da5
vkd3d: Simplify vkd3d_allocate_buffer_memory helper.
...
This is still useful as a low-level memory allocation function when
we don't want to bother with buffer offsets or D3D12 validation.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
db2e0c7587
vkd3d: Remove vkd3d_gpu_va_allocator.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
8826f3c5bc
vkd3d: Remove d3d12_heap and old resource creation functions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
9792b02b26
vkd3d: Use vkd3d_memory_allocation for scratch buffers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Philip Rebohle
db1b425d2a
vkd3d: Use new resource and heap implementations.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-18 14:17:22 +01:00
Hans-Kristian Arntzen
8437eea2c0
vkd3d: Remove clamping assumption in RTPSO stack size.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-18 14:16:31 +01:00
Joshua Ashton
f01935d69e
vkd3d: Fix SetName for inline query types
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-18 02:41:45 +01:00
Philip Rebohle
6fc8b67576
vkd3d: Fix incorrect chunk assignment for chunk allocations.
...
Our clear code assume that this is NULL for allocations owned
by a chunk, so we should actually do it that way. Fixes some
issues where we do not wait for clears to complete if a chunk
gets destroyed.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-17 16:38:47 +01:00
Philip Rebohle
e12afd31d9
vkd3d: Actually use VKD3D_VA_BLOCK_COUNT.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-17 16:38:47 +01:00
Philip Rebohle
35f90c4b2f
vkd3d: Only print some swapchain FIXMEs once.
...
Silences a whole bunch of log spam in Control.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-17 13:37:41 +01:00
Hans-Kristian Arntzen
7051bf76f7
vkd3d: Fix validation errors with KHR_fragment_shading_rate.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-16 16:07:55 +00:00
Philip Rebohle
a39bab95a1
vkd3d: Clear suballocated memory to zero.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-16 16:06:26 +01:00
Philip Rebohle
668a4e1f2c
vkd3d: Do not suballocate small image-only heaps.
...
We have no way to manually reset these.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-16 16:06:26 +01:00
Philip Rebohle
4d68130be7
vkd3d: Add functionality to clear newly allocated memory.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-16 16:06:26 +01:00
Philip Rebohle
78713062fe
vkd3d: Introduce unique_queue_mask.
...
Has one bit set for each vkd3d_queue_family that points to a
unique queue. This can be used to iterate over device queues
without having to check for duplicates manually.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-16 16:06:26 +01:00
Philip Rebohle
812c82f8ac
vkd3d: Introduce VKD3D_QUEUE_FAMILY_INTERNAL_COMPUTE.
...
This needs a rework when we re-enable multi-queue support.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-16 16:06:26 +01:00
Philip Rebohle
ba632148d7
vkd3d: Add new functions to create and destroy resources.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 17:04:52 +01:00
Philip Rebohle
fee47ef695
vkd3d: Introduce d3d12_resource_validate_create_info.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 17:04:52 +01:00
Philip Rebohle
22f61611d1
vkd3d: Add d3d12_heap_2.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 17:04:52 +01:00
Philip Rebohle
229273fb3b
vkd3d: Add memory allocator instance to device.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 17:04:52 +01:00
Philip Rebohle
6e1867b001
vkd3d: Add some more debug output to memory allocation functions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 17:04:52 +01:00
Philip Rebohle
5e54c1fc5d
vkd3d: Register allocation cookie for descriptor debugging.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 17:04:52 +01:00
Philip Rebohle
8f6e94dc30
vkd3d: Suballocate small allocations from larger chunks.
...
This is necessary to keep the amount of allocated memory manageable
in games that allocate a lot of small heaps or committed resources.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 16:38:16 +01:00
Philip Rebohle
d65363b6b6
vkd3d: Add VA map to memory allocator.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 15:19:11 +01:00
Philip Rebohle
7c017c1dba
vkd3d: Add VA->resource map and new VA allocator.
...
This is designed to work with actual device addresses if supported by
the Vulkan implementation.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 15:19:11 +01:00
Philip Rebohle
f536daaacb
vkd3d: Introduce new memory allocation functions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 15:19:11 +01:00
Philip Rebohle
417b3b746e
vkd3d: Introduce vkd3d_allocate_cookie.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-15 14:04:16 +01:00
Joshua Ashton
00c8d1df9d
vkd3d: Refactor vkd3d_physical_device_info_init
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-15 11:25:21 +01:00
Joshua Ashton
c0d4ead8ca
vkd3d: Implement TIER_1 variable rate shading
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-12 13:39:05 +01:00
Joshua Ashton
fccbd3b5e2
vkd3d: Eliminate wchar_size, use UTF-16 string literals
...
Achieves this with C standard stuff alone, and no compiler hacks.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-09 11:26:28 +01:00
Joshua Ashton
38d2de9f4c
vkd3d: Fix warning in query logging
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-08 16:36:15 +01:00
Hans-Kristian Arntzen
c558c8f423
vkd3d: Implement Get*StackSize().
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
13b737214b
vkd3d: Remove owned root signatures.
...
Apparently the docs are lying and RTPSO does not hold references to the
root signatures after all.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
13af141e84
common: Add truncated wide export strcmp.
...
Needed for GetShaderStackSize().
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
bfe9a39c3b
vkd3d: Implement the basics of RTPSO.
...
Implement enough that the test case compiles correctly.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
859066cd9b
vkd3d-shader: Add ray-tracing pipeline support to DXIL.
...
Also updates relevant submodules.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
d8d1e82024
vkd3d-shader: Refactor DXIL resource remapping.
...
Prepare for local root signatures.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
1784351dcf
vkd3d-shader: Move root parameter structs to vkd3d-shader.
...
Need it here since local root signatures need to know
the physical layout of the record buffer up front.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
fdcf583cbc
vkd3d: Rename COUNTER buffer to AUX_BUFFER.
...
We will use the same pointer buffer to handle acceleration structures,
so unify this buffer under a new name. Simplifies some of the binding
code since SRV path and UAV path looks more similar now.
Only difference is that UAV path uses BDA -> uint32_t,
and SRV uses BDA -> RTAccelerationStructure.
RT requires BDA, so the fallback descriptor set (storage texel buffer) is never used for RT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
f3becc21a4
vkd3d: Implement local root signatures.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
9b856ed124
vkd3d: Add entry points for VK_KHR_ray_tracing_pipeline.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
86da5d9bad
common: Add string utilities for dealing with entry point conventions.
...
Used across both vkd3d-shader and vkd3d, so makes sense to move this to
common code.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Hans-Kristian Arntzen
4957d561dc
vkd3d: Add dummy entry to app overrides.
...
Empty array declaration is not legal C.
Fixes compilation error on MSVC.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-05 10:05:07 +01:00
Joshua Ashton
51bf939743
vkd3d: Implement DXGI_FORMAT_B4G4R4A4_UNORM
...
Uses VK_EXT_4444_formats.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-04 12:04:10 +01:00
Philip Rebohle
00872471eb
vkd3d: Set WriteBufferImmediateSupportFlags properly.
...
We do not support bundles, but advertizing WriteBufferImmediate
support for bundles is required for Feature Level 12_2.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-02-01 11:09:56 +01:00
Philip Rebohle
2560c76861
vkd3d: Disable accelerationStructureCaptureReplay feature.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-28 18:55:52 +01:00
Philip Rebohle
b4bc92714a
vkd3d: Always align scratch buffer for query data to 8 bytes.
...
Fixes a validation error. With VK_QUERY_RESULT_64_BIT we need
to use 8-byte alignment, but ssbo_alignment may be less.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-26 21:04:11 +01:00
Hans-Kristian Arntzen
2bc9dc7909
vkd3d: Add FL override for 12.2 (DX12 Ultimate).
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-26 15:00:15 +01:00
Hans-Kristian Arntzen
9893b7f52c
vkd3d: Enable SM 6.3.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-26 15:00:15 +01:00
Hans-Kristian Arntzen
31fa512512
vkd3d: Add checks for RayTracing tier.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-26 15:00:15 +01:00
Hans-Kristian Arntzen
c8f8b24674
vkd3d: Enable ray tracing extensions.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-26 15:00:15 +01:00
Hans-Kristian Arntzen
e89c286075
vkd3d: Report OPTIONS7 features.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-26 15:00:15 +01:00
Georg Lehmann
c76f37d41c
vkd3d: Introduce VKD3D_FILTER_DEVICE_NAME.
...
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-01-25 15:29:34 +01:00
Hans-Kristian Arntzen
326d1cde60
vkd3d-shader: Remove DXIL being optional.
...
We always build with DXIL, not using autotools anymore.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-25 14:03:37 +01:00
Philip Rebohle
c6095e740d
vkd3d: Do not create query pool for inline query types.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
7b524590ab
vkd3d: Introduce d3d12_query_heap_type_is_inline.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
098ad5c071
vkd3d: Remove disable_query_optimization workaround.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
7ea11ededb
vkd3d: Use virtual queries for transform feedback queries as well.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
c9525cf5ca
vkd3d: Allocate new virtual query for active queries as necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
b995780de1
vkd3d: Reimplement binary occlusion query resolve.
...
No longer requires BDA support since it's easier now to work
around buffer alignment issues.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
5c550b5cda
vkd3d: Rewrite binary occlusion query resolve shader.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
32f7ba6630
vkd3d: Use virtual queries for inline query types.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
4a558ce501
vkd3d: Compute query stride from heap type rather than query type.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
abc204cea4
vkd3d: Create buffer for query heap as necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
39c7f8f32d
vkd3d: Introduce pending query list.
...
This will store the list of queries to resolve.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
6e3a7d37cc
vkd3d: Store more information in active query list.
...
Allows us to map D3D12 queries to virtual queries and vice versa.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
59acbfeb41
vkd3d: Add query resolve pipelines to meta ops.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
cc8fb3ae1c
vkd3d: Add query resolve shader.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Philip Rebohle
16f5cff061
vkd3d: Implement virtual query allocation.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-19 14:11:46 +01:00
Hans-Kristian Arntzen
a531ee5fd4
vkd3d: Remove force_bindless_texel_buffer workaround.
...
Obsolete now that we fully split typed and untyped buffer descriptors.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-14 15:34:20 +01:00
Hans-Kristian Arntzen
97e0d8e751
vkd3d: Move bindless SSBO out of MUTABLE set and fill both descriptors.
...
We will need separate descriptor sets to be able to handle typed vs
untyped buffer workarounds.
Also writes multiple descriptors for buffers views to make sure MUTABLE
and SSBO sets are filled (or TEXEL_BUFFER + SSBO for non-mutable).
Applications often get this wrong and use raw buffer in shader where
typed view was written and vice versa.
To mitigate this, just write a typed and untyped view together.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-14 15:34:20 +01:00
Philip Rebohle
6bddcb4352
vkd3d: Store both byte range and element range in offset buffer.
...
The first range will store the byte offset, the second one will
be the typed buffer range. Typed descriptors should write both.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Co-authored-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-14 15:34:20 +01:00
Hans-Kristian Arntzen
dbbde3c6f1
vkd3d: Remove VKD3D_DESCRIPTOR_FLAG_DEFINED.
...
This is redundant now since this information is carried by set_info_mask.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-14 15:34:20 +01:00
Hans-Kristian Arntzen
1bddaa0fff
vkd3d: Allow a heap binding to cover multiple descriptors.
...
This begins the refactor toward letting us to use both texel buffer and
SSBO descriptors for typed buffers, which is a better workaround than
force_bindless_texel_buffers.
In this new approach, we store a mask in metadata instead of
set/binding.
When copying a descriptor, we will iterate over the masks and look up
binding directly from device->bindless_state.set_info[].
The mask is represented in terms of info index rather than set index to
avoid needless lookups. Add some new helpers to make this process
easier.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-01-14 15:34:20 +01:00
Philip Rebohle
f25df5b453
vkd3d: Reset inline queries in BeginQuery.
...
We currently never reset occlusion queries. For some reason,
validation layers do not report this.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-14 13:38:21 +01:00
Henri Verbeet
c42f4d11e2
vkd3d-shader: Decorate "precise" arithmetic instructions with SpvDecorationNoContraction.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2021-01-12 15:22:11 +01:00
Philip Rebohle
037efbdcda
vkd3d: Add mapping for PACK16 formats.
...
Dirt 5 fails with an error message otherwise.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-01-08 18:37:26 +01:00
Philip Rebohle
a3d21494f7
vkd3d: Enable query workaround for AC:Valhalla.
...
Fixes #458 .
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-12 13:01:52 +01:00
Philip Rebohle
b8c96d9b30
vkd3d: Add workaround to disable occlusion query optimization.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-12 13:01:52 +01:00
Hans-Kristian Arntzen
9cbd1b2a0d
vkd3d: Add Cyberpunk2077.exe to workaround detection.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-11 11:22:45 +01:00
Philip Rebohle
946bcd7922
vkd3d: Do not store counter address in descriptor.
...
Unnecessary because the UAV counter buffer is a host memory
allocation anyway in case of host-only descriptor heaps, so
we will not read from uncached memory.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-10 18:14:16 +01:00
Hans-Kristian Arntzen
22a907e11a
vkd3d: Add descriptor QA logging.
...
When reading GPU hang dumps, we can figure out what happened to
descriptor types along the way.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-09 14:51:53 +01:00
Philip Rebohle
1d9f28b25f
vkd3d: Add fast path for mutable descriptor copies.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-09 14:31:22 +01:00
Philip Rebohle
7d40d8a22e
vkd3d: Rework descriptor copies to copy ranges.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-09 14:31:22 +01:00
Hans-Kristian Arntzen
a888d81422
vkd3d: Fix embarassing enum bug.
...
Caused crash when using a driver that did not support
mutable_descriptor_type.
Was using the wrong enum bitfields ... Sigh, type safe enums would be nice.
Regression caused during refactor in review most likely.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-07 20:55:56 +01:00
Hans-Kristian Arntzen
051ba691be
vkd3d: Clarify comment about not using MEMORY_READ/WRITE.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-07 20:45:02 +01:00