Hans-Kristian Arntzen
70af36a6e2
swapchain: Actually use matching mode when going fullscreen.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-05 19:53:05 +02:00
Hans-Kristian Arntzen
d02d95f606
swapchain: Workaround weird behavior with FindClosestMatchingMode.
...
Use a default format if there is no format specified.
Otherwise, the call fails on both Wine and DXVK DXGIs.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-05 19:53:05 +02:00
Hans-Kristian Arntzen
624e42f742
swapchain: Add thread safety.
...
IDXGISwapchain should be thread safe, doesn't cost much to add it.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-05 19:53:05 +02:00
Joshua Ashton
f5b2f45f13
vkd3d: Use already existing format for sparse multi-planar test
...
This was wrong anyway as it assumed depth always.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-05 10:50:28 +02:00
Joshua Ashton
eee64787c7
vkd3d: Keep track of vkd3d_format for resources
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-05 10:50:28 +02:00
Joshua Ashton
a991fddeeb
build: Use `-fvisibility=hidden` and define exports manually
...
When building natively on Windows we use dllexport/dllimport for vkd3d/vkd3d_utils public exports.
When building natively on Linux we simply make those visibility default.
Nothing changes for standalone here.
Closes #152
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-05 10:44:10 +02:00
Joshua Ashton
be2c0c1f1e
include: Remove DECLSPEC_HIDDEN from headers
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-05 10:44:10 +02:00
Joshua Ashton
e09f129064
vkd3d: Use enum for VKD3D_META_COPY_MODE
...
Just some extra type-safety.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-09-30 13:00:32 +02:00
Joshua Ashton
2d3df0838a
vkd3d: Use generated shaders
...
Now we don't have the autotools path, we can use what we make now.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-09-30 13:00:32 +02:00
Joshua Ashton
fa60742114
build: Remove autotools build path
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-09-30 13:00:32 +02:00
Joshua Ashton
3c54cf8ad6
vkd3d: Use VK_NULL_HANDLE instead of NULL for VkPipelineCache
...
Fixes a warning in MSVC.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-09-30 01:44:50 +02:00
Philip Rebohle
759e21d821
vkd3d: Remove d3d12_descriptor_heap_set_index_from_magic.
...
Unused, should have been in previous commit. Whoops.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 15:15:49 +02:00
Hans-Kristian Arntzen
9d36ab59d6
vkd3d: Add support for a shader debug ring.
...
Will allow replaced shaders to emit debug messages to a buffer.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-29 15:00:36 +02:00
Philip Rebohle
29fe4da015
vkd3d: Remove unused fields from d3d12_desc.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Philip Rebohle
0450ae9f85
vkd3d: Introduce VKD3D_DESCRIPTOR_FLAG_VIEW.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Philip Rebohle
eb0ada76e8
vkd3d: Remove unused code for descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Philip Rebohle
3682e4d9f7
vkd3d: Rework UAV descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Philip Rebohle
3177d80814
vkd3d: Rework SRV descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Philip Rebohle
c2439d67b8
vkd3d: Rework sampler descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Philip Rebohle
5c066940a0
vkd3d: Rework CBV descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-29 14:48:26 +02:00
Hans-Kristian Arntzen
250357c998
debug: Integrate automatic RenderDoc capturing.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-22 12:44:18 +02:00
Hans-Kristian Arntzen
1ce14c2ef3
vkd3d: Remove bindless CBV workaround.
...
Not relevant anymore, and should see good uplift on NV depending on
content.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-11 16:54:00 +02:00
Hans-Kristian Arntzen
e823715ac8
vkd3d: Clean up warnings.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-11 15:20:52 +02:00
Philip Rebohle
cea17b2440
vkd3d: Don't call vkGetPipelineCacheData on a null handle.
...
On systems without extended dynamic state, or for certain pipelines,
it is possible for vk_pso_cache to be VK_NULL_HANDLE, so we need to
check for this during serialization.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 18:11:41 +02:00
Hans-Kristian Arntzen
52ecd35dee
vkd3d: Set shader module name to the hash.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Hans-Kristian Arntzen
adde8947c6
vkd3d: Trace which pipelines are being bound and if they are replaced.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Philip Rebohle
3a39f38fc5
vkd3d: Advertize support for relevant shader cache features.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
dcb03257f9
vkd3d: Implement pipeline library functionality based on VkPipelineCache.
...
This is used extensively by Horizon Zero Dawn, and allows us
to skip the compile screen after the initial first run.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
92b6e71ce4
vkd3d: Factor out pipeline state struct conversion.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
d4f4e34656
vkd3d: Remove pipeline cache from d3d12_device.
...
Unused now, instead we should implement D3D12 caching primitives
correctly and rely on the Vulkan driver otherwise.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
15ed944e40
vkd3d: Implement ID3D12PipelineState::GetCachedBlob.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
0396ee544c
vkd3d: Implement support for cached PSO pipeline state.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
2b885c4981
vkd3d: Move ID3D12PipelineLibrary imlpementation to separate file.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Hans-Kristian Arntzen
eb4ce56139
vkd3d: memset instance and device structs.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 09:34:26 +02:00
Robin Kertels
51d2a3bad2
vkd3d: Set VKD3D_DYNAMIC_STATE_VERTEX_BUFFER when binding a new pipeline
...
... if we have dirty vbo slots left.
Fixes textures when inspecting items in the inventory in RE2 and RE3.
Signed-off-by: Robin Kertels <robin.kertels@gmail.com>
2020-09-06 10:08:33 +02:00
Hans-Kristian Arntzen
ec441808c8
vkd3d: Emit host memory barrier as needed.
...
There is no resource state associated with this, so emit the barrier at
the end of a command buffer based on trivial tracking.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-02 14:46:12 +02:00
Hans-Kristian Arntzen
92b4f13f76
vkd3d: Zero out descriptor heaps on allocation.
...
Only bother if nullDescriptors are supported.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-31 17:22:17 +02:00
Philip Rebohle
2fd2cb1be2
vkd3d: Implement generic fallback for WriteBufferImmediate.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-28 17:27:05 +02:00
Philip Rebohle
c71e70335a
vkd3d: Implement WriteBufferImmediate with AMD_buffer_marker.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-28 17:27:05 +02:00
Philip Rebohle
6940716417
vkd3d: Enable VK_AMD_buffer_marker if available.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-28 17:27:05 +02:00
Hans-Kristian Arntzen
e3d2484a49
vkd3d: Rewrite timeline semaphore handling.
...
Need to handle large (> 4G) jumps in timeline value, which is not
supported by all implementations.
There is no good way to handle that, so rewrite and clean up timeline
semaphore handling by separating the timeline into a virtual timeline
(which can rewind and jump around arbitrarely) and a physical timeline
which increments by one each time.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-28 14:13:47 +02:00
Hans-Kristian Arntzen
2d22317f31
vkd3d: Never attempt to use PCI-pinned memory types.
...
These memory types might end up being used as fallback memory types,
which is problematic due to their tiny sizes, and unexpected performance
behavior. Generally, when we want to fallback, we should cleanly fall
back to system memory rather than a different device local type.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-27 12:45:58 +02:00
Hans-Kristian Arntzen
4ec05b99b4
vkd3d: Fix crash in validation layer when freeing static descriptor set.
...
vk_pool cannot be NULL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-27 12:37:45 +02:00
Philip Rebohle
0d0917508b
vkd3d: Remove VKD3D_DESCRIPTOR_POOL_TYPE_IMMUTABLE_SAMPLER.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
17cf1f69d7
vkd3d: Use global descriptor sets for static samplers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
a862d02c4c
vkd3d: Introduce global descriptor pools for static samplers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
d4f13b755f
vkd3d: Use new global sampler state for static samplers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
d4bbd4b43e
vkd3d: Add sampler state object to d3d12_device.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
a09a0ed86d
vkd3d: Introduce vkd3d_sampler_state.
...
Manages unique static samplers for now, in order to reduce duplicates.
Can be extended to also manage descriptor pools for static samplers in
the future.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Hans-Kristian Arntzen
d416d65d40
vkd3d: Fallback allocate memory for OpenExistingHeapFrom*.
...
RenderDoc does not support external_memory_host yet, and these heaps are
generally only used for debugging, so we should be able to get away with
this in practice.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
23968fc423
vkd3d: Fall back to visible/coherent for host imported memory.
...
On NVIDIA, we can only import as uncached, introduce a fallback for that
scenario.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
b5e521fd6a
vkd3d: Validate resource sharing flag.
...
If heap is cross adapter, resource must also be cross adapter.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
6260d18716
vkd3d: Implement OpenExistingHeapFromFileMapping.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
0c1b49d681
vkd3d: Implement OpenExistingHeapFromAddress.
...
Refactors out some common code in d3d12_heap_init.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
6e2b153235
vkd3d: Add host import to allocate_buffer_memory.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
aafc9aec96
vkd3d: Add helper to allocate imported host memory.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen
95b6596d75
vkd3d: Enable VK_EXT_external_memory_host.
...
Needed for OpenExistingHeapFromAddress and friends.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Philip Rebohle
5a9d132b20
vkd3d: Get rid of descriptor spinlocks.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
73d578e5ab
vkd3d: Do not ref-count views in descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
684c658e22
vkd3d: Do not ref-count view in ClearUnorderedAccessView.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
9098221f0a
vkd3d: Add sampler map to device.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
28c1b7757c
vkd3d: Add sampler support to view map.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
daf9f5c69f
vkd3d: Store views created from resource in resource's view map.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
6545cb4f7d
vkd3d: Add view map to null resources.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
4f3fce5914
vkd3d: Introduce vkd3d_view_map_create_view.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
ff69d59fa6
vkd3d: Add view map to d3d12_resource.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
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
Hans-Kristian Arntzen
7139621c3f
vkd3d: Add conversion for topology type to Vulkan.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
85f8a6ac7c
vkd3d: Add helper to check if topology type can use primitive restart.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
551bc54546
vkd3d: Add topology type to pipeline state.
...
Needed to build dynamic pipeline.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
fc0a94ad04
vkd3d: Add a common pipeline for graphics pipeline state.
...
When using EXT_extended_dynamic_state, we will be able to compile a
master pipeline. Only in special cases will we have to fallback.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
b52a9c46bd
vkd3d: Refactor graphics pipeline creation out to separate function.
...
Preparation for extended dynamic state refactor.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
926f2033a9
vkd3d: Enable VK_EXT_extended_dynamic_state.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
9425b4d438
vkd3d: Bump VKD3D_MAX_DESCRIPTORS_SETS to 9.
...
This can happen in the worst case where we have all bindless sets, and:
- Static samplers
- Packed descriptors (UAV counters on drivers without support for this)
- Root descriptors
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 10:08:38 +02:00
Philip Rebohle
15106808f9
vkd3d: Implement IDXGISwapChain4.
...
SetHDRMetaData implementation taken from DXVK.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-13 10:25:51 +02:00
Philip Rebohle
90d44eeac5
vkd3d: Make swap chain implementation more easily extensible.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-13 10:25:51 +02:00
Biswapriyo Nath
41b0f5a96c
vkd3d: remove redeclaration of IWineDXGISwapChainFactory
...
IWineDXGISwapChainFactory will be in header from vkd3d_swapchain_factory.idl
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
2020-07-11 20:33:59 +02:00
Hans-Kristian Arntzen
7bccab7427
debug: Re-introduce different debug channels.
...
vkd3d-shader is currently kinda buggy and crashes when you try to trace
DXBC. This used to never be run since it was guarded by
VKD3D_SHADER_DEBUG, but with the move to a static build we merged all
debug logging under VKD3D_DEBUG. Reintroduce different debug channels in
a way that is compatible with a statically linked vkd3d.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 14:18:15 +02:00
Hans-Kristian Arntzen
854814d81c
vkd3d: Fix various minor warnings.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 14:18:15 +02:00
Hans-Kristian Arntzen
337f75b76a
vkd3d: Workaround broken MEMORY_READ/WRITE on RADV.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-09 14:50:50 +02:00
Hans-Kristian Arntzen
1341409b88
vkd3d: Implement aliasing barriers.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-09 14:50:50 +02:00
Philip Rebohle
fee4781f2b
vkd3d: Fix suspended render pass state tracking.
...
Otherwise, if a render pass gets suspended twice in a row, we
never emit the barrier because render_pass_suspended will be
set to false the second time.
Fixes validation errors in Hitman 2.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-08 17:31:58 +02:00
Joshua Ashton
9625096577
vkd3d: Correctly handle output + fix NULL old targets for fullscreen
...
The output here is actually for secure presentation and restricting a swapchain to a certain output.
Correctly handle NULL (desktop) targets that we used to have.
Fixes crashes with titles that use fullscreen via an initial fullscreen desc.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-07 01:42:34 +02:00
Hans-Kristian Arntzen
cb1da02af9
vkd3d: Fix some warnings.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-06 21:32:16 +02:00
Joshua Ashton
7204c8d76f
d3d12: Add standalone d3d12 library
...
When building for Windows, specify `-Denable_standalone_d3d12=True` in Meson to enable.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton
aa3b7c3b26
vkd3d: Use newer ID3D12Device funcs for COM
...
Fixes warnings under MSVC and MinGW.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton
9c105a78a9
vkd3d: Implement swapchain and swapchain factory
...
Needed for standalone D3D12.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton
e24914b11f
include: Pull in Win32 Vulkan exts when building for Win32
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton
dff27c9e9c
vkd3d: Load INSTANCE_EXT procs into device table
...
We need these for the upcoming swapchain factory implementation
for standalone D3D12.
They're also probably good to have around in future for the
d3d12 device.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton
ba3dabe3bb
vkd3d: Add debug_dxgi_format helper
...
DXGI_FORMAT -> string
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Hans-Kristian Arntzen
d6b6da6206
Revert "vkd3d: Add support for serializing root signature version 1.1"
...
This reverts commit 0384362065
.
It is not allowed to use RS 1.1 serialization for the non-versioned
entry point. RS 1.1 serialization must use the versioned entry point.
Reverting this fixes the relevant test case in d3d12.c:12522.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-06 17:41:03 +01:00
Joshua Ashton
08544fb938
vkd3d: Use CONST_VTBL instead of const for vtable decls
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton
0384362065
vkd3d: Add support for serializing root signature version 1.1
...
Make this code more extensible too...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-01 19:46:09 +02:00
Philip Rebohle
ee949c0916
vkd3d: Avoid UAV counter address updates for non-UAV descriptors.
...
Saves a few CPU cycles. We expect things to explode anyway when
the app uses a non-UAV descriptor as a UAV in the shader.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
d524b770bc
vkd3d: Do not create view for NULL UAV descriptors if possible.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
e50b707709
vkd3d: Do not create view for NULL SRV descriptors if possible.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
e10b9a72e2
vkd3d: Handle views being null in non-bindless descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
3434c4ef6f
vkd3d: Handle views being null in bindless descriptor updates.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
c8e97a581d
vkd3d: Use NULL descriptors for constant buffer views.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
fbbcb30590
vkd3d: Use NULL descriptors for vertex buffers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Philip Rebohle
87bf1e8937
vkd3d: Use NULL descriptors for undefined root descriptors.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00