Commit Graph

2775 Commits

Author SHA1 Message Date
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 409af5de20 vkd3d-shader: Use per-thread allocators in DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-26 12:39:26 +02:00
Hans-Kristian Arntzen 528d2decad dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-26 12:39:26 +02:00
Hans-Kristian Arntzen 50eeb42137 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:51:34 +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 01a7ec6310 tests: Use fflush()
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
Hans-Kristian Arntzen b2b730ea8b tests: Add test for open heap from address/file.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen e9aab2b8b8 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-21 11:58:21 +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 0303c396bc vkd3d: Add float_bits_to_uint32.
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 50eb972c15 include: Add hash map implementation.
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
Jens Peters 9560612bd7 build: Use widl from mingw-tools.
This removes the wine dependency for cross-builds but adds a dependency for mingw-tools instead.

Signed-off-by: Jens Peters <jp7677@gmail.com>
2020-08-04 01:22:11 +02:00
Hans-Kristian Arntzen 4cc7eed2ab dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-01 13:01:13 +02:00
Hans-Kristian Arntzen df033cbec1 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-31 18:31:03 +02:00
Hans-Kristian Arntzen 2cb6b063fe tests: Fix uninitialized Layout member.
C is fine ...

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 16:48:31 +01: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
Hans-Kristian Arntzen 27d14cb0ce meson: Target native d3d12 for Windows test binaries.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 17:34:10 +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