Commit Graph

2674 Commits

Author SHA1 Message Date
Joshua Ashton 07e22a13d0 vkd3d: Fix potential lack of null termination on cache blob versions
The Git sha's are 7 characters long, but this may change if we tag a release that has a name.
Ensure this is null terminated to shut up a compiler warning.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-04 18:28:42 +01:00
Joshua Ashton 31edccd237 vkd3d: Migrate version to a header
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-04 18:13:31 +01: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 2572b370d5 README: Add docs for shader logging.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-29 15:00:36 +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 7238802806 README: Add docs for auto capturing.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-22 12:44:18 +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 1b2e190877 tests: Clean up misc warnings from tests.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-11 15:20:52 +02:00
Hans-Kristian Arntzen a015ab04cd tests: Cleanup warnings in pipeline library tests.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-11 15:20:52 +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 5872257e31 README: Update to mention VKD3D_SHADER_OVERRIDE.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03: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
Hans-Kristian Arntzen 586f002536 vkd3d-shader: Add shader replacement.
For debugging purposes, it can be extremely useful to be able to
pinpoint and replace specific shaders for testing hypotheses.

To make this practical, change the shader dumping to use hashes rather
than monotonically incrementing indices.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Hans-Kristian Arntzen f473370678 vkd3d-shader: Add hash function for shader blobs.
Simple FNV-1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Hans-Kristian Arntzen b93963b6ce debug: Log thread ID as well.
For multi-threaded apps, this is vital to make any sense of the log.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Philip Rebohle 6ba9656b12 tests: Add tests for GetCachedBlob and pipeline libraries.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +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 3002d52ed4 include: Define D3D12 error codes as necessary.
These are technically supposed to be defined in winerror.h,
but current MinGW headers do not support these yet.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle c06e2bdc83 vkd3d: Introduce vkd3d_wcslen.
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
Hans-Kristian Arntzen 254868a326 vkd3d: Enable pthread workaround paths on MinGW as well.
winpthread is slow on Wine as it requires OS synchronization
objects, which involves wineserver.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 09:34:26 +02:00
Hans-Kristian Arntzen 7d8ab2fb06 vkd3d: Replace CS with SRW.
On Wine, this is more efficient as it can use futex paths.

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 c4bccbb8ee dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-04 16:44:31 +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 630b70cbbd tests: Remove todos from test_write_buffer_immediate.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-28 17:27:05 +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