Philip Rebohle
7785c60a08
vkd3d: Add image parameter to vk_image_view_desc.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
3c9a54cb73
vkd3d: Introduce vkd3d_buffer_view_desc.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
05381caac9
vkd3d: Use vkUpdateDescriptorSets for descriptor copies.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
a056922293
vkd3d: Create separate descriptor set layout for host-only pools.
...
D3D12 allows much larger pools to be created for heaps that are not
shader-visible, which some games make use of. Fixes crashes on Nvidia.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
68fc3f9322
vkd3d: Create descriptor pools for all descriptor heaps.
...
Not just the shader visible ones, since we'll be using Vulkan
descriptor set copies to implement D3D12 descriptor copies.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
8e4aaeff05
vkd3d: Introduce new descriptor metadata struct.
...
Stores info about where exactly the descriptor is stored in the
Vulkan descriptor pool, and whether we have to worry about an
additional UAV counter descriptor.
This is meant to replace all the other non-static data stored
inside d3d12_desc.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
fcc0c4c163
vkd3d: Remove default null image views.
...
We're not using these anywhere because we need formats to be correct
for image views. Buffer views are used for root descriptors and null
UAV counters.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Hans-Kristian Arntzen
00618cb2c1
vkd3d: Load VK_LAYER_KHRONOS_validation if we enable debug mode.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 17:36:53 +02:00
Philip Rebohle
9e8b2a22ed
vkd3d: Don't destroy UAV counter view if it's the null view.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 16:35:15 +02:00
Philip Rebohle
651ecfe7f6
vkd3d: Set counter buffer view to null view for buffer UAVs.
...
Fixes a crash on drivers that don't support null descriptors.
Image UAVs and other descriptor types cannot have counters.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 15:16:51 +02:00
Hans-Kristian Arntzen
b47dae95e5
vkd3d: Lower MAX_DESCRIPTOR_SETS to 9.
...
We just removed packed set.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 11:58:58 +02:00
Philip Rebohle
3364758746
vkd3d: Remove volatile packed descriptor handling.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle
c580866648
vkd3d: Remove packed descriptor set from root signature.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle
fd249acb64
vkd3d: Remove packed descriptor set update code.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle
2cd23f5305
vkd3d: Require bindless samplers and SRV/UAV/CBV.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Hans-Kristian Arntzen
1b100aa40d
vkd3d: Fix broken access to dead stack variable.
...
Fallout from UAV counter bindless PR.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-29 17:15:00 +02:00
Philip Rebohle
d0f64cfbb7
vkd3d: Always use bindless UAV counters if UAVs are bindless.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
3766e7e994
vkd3d: Rename BINDLESS_UAV_COUNTERS -> RAW_VA_UAV_COUNTERS.
...
For clarity, since we'll be moving to full bindless anyway.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
7f36039c9c
vkd3d: Update uav counter set as necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
949e38e0b3
vkd3d: Add binding for uav counter views.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
40764d82ef
vkd3d-shader: Introduce VKD3D_SHADER_BINDING_FLAG_RAW_VA.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
fa3085400d
vkd3d: Handle pRegion == NULL in DiscardSubresource.
...
Fixes a crash in Shadow of the Tomb Raider.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-23 16:23:31 +02:00
Hans-Kristian Arntzen
4611c9a96f
vkd3d: Fix warnings in calibrated timestamp implementation.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-22 10:52:03 +02:00
Philip Rebohle
abb8d32642
vkd3d: Add DXGI_FORMAT_R9G9B9E5_SHAREDEXP.
...
Needed by Battlefield 1.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-20 19:42:44 +02:00
Hans-Kristian Arntzen
7df9a48528
vkd3d: Add some other interesting profiling regions.
...
Useful to measure submission times, as well as time spent acquiring the
Vulkan queues. This correlates 1:1 with swapchain as well, so it's
useful when we want to get some "X / frame" metrics.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-20 16:39:15 +02:00
Hans-Kristian Arntzen
6a60834379
vkd3d: Make profiled vtable for ID3D12GraphicsCommandList4.
...
Similar to ID3D12Device profiled vtable, disgusting, but it should do
the trick.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-20 16:39:15 +02:00
Hans-Kristian Arntzen
37e4ce7ce7
vkd3d: Make a profiled vtable for ID3D12Device.
...
There are two advantages of doing it like this:
- When profiling is not enabled, we get no overhead for device calls.
- Avoids cluttering up the main implementation.
Disadvantage is that rolling inherited vtables like this is quite
disgusting, but this is C, what you gonna do ...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-20 16:39:15 +02:00
Hans-Kristian Arntzen
9a1943d57b
vkd3d: Init profiling when we create an instance.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-20 16:39:15 +02:00
Joshua Ashton
b38a18dbd8
vkd3d: Move copy descriptors implementation into a new func
...
Calling this from CopyDescriptorsSimple on its own is a bad idea given its __stdcall and GCC doesn't like optimizing that.
Also marked it as inline given it can easily be optimized greatly contextually for CopyDescriptorsSimple
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-17 14:02:18 +02:00
Philip Rebohle
2729c4ad41
vkd3d: Implement GetClockCalibration.
...
Manually uses QPC if the Vulkan implementation does not support
the QPC domain by itself.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-17 11:49:38 +02:00
Philip Rebohle
1af4c6c719
vkd3d: Enable VK_EXT_calibrated_timestamps if available.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-17 11:49:38 +02:00
Philip Rebohle
c3d5a60e01
vkd3d: Implement DiscardResource.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Philip Rebohle
ef2eacefee
vkd3d: Rework d3d12_command_list_find_attachment.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Philip Rebohle
37e7fbd5c5
vkd3d: Rework d3d12_get_view_rect.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Philip Rebohle
b212b3fb9c
vkd3d: Introduce d3d12_resource_get_vk_subresource.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Philip Rebohle
def7cf409a
vkd3d: Introduce discard mask for deferred clear operations.
...
Allows us to skip clears while still initializing the image.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Hans-Kristian Arntzen
96402f1164
vkd3d: Fix straggling warnings for MSVC.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-16 13:00:09 +02:00
Hans-Kristian Arntzen
dd6656fbe9
vkd3d: Avoid redundant pipeline binds.
...
When we're using extended dynamic state, we will often end up with dummy
pipeline binds, which we should try to avoid if we can.
Also avoids having to rebind dynamic state redundantly.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
84d9e4b0db
vkd3d: Emit vertex buffer sizes even when not using dynamic stride.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
0f91099dd4
vkd3d: Refactor dynamic state to be per-pipeline.
...
Cleans up dynamic state such that we do not have to keep dynamic state
create infos around.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
69fdd87aa0
vkd3d: Add more debug logging when we fall back.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
d8ba75e160
vkd3d: Use strip type by default when using primitive restart.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
0e9a1555c1
vkd3d: Add dynamic state information to vkd3d_pipeline_key.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
e9dcdc1308
vkd3d: Move vkd3d_pipeline_key to private header.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
5968d28e75
vkd3d: Refactor out dynamic stride checks to its own function.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
10d6823e34
vkd3d: Do not attempt to create a pipeline with invalid DS format.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
2e57b3d27e
vkd3d: Do not attempt to create pipelines with unknown topology type.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
6967576904
vkd3d: Statically deduce patch vertex count for HS.
...
Fall back when there is a mismatch, which can happen if application does
not declare inputs to hull shader (unlikely).
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
084a3e6928
vkd3d: Validate minimum vertex buffer stride when using dynamic stride.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
5ef3ebce61
vkd3d: Implement extended dynamic state.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00