Commit Graph

355 Commits

Author SHA1 Message Date
Krzysztof Bogacki 61b13cc278 build: Use separate version string and build hash
Version string is used in logging for information purposes, but pipelines blobs and libraries use uint64_t–based commit hash. Using fixed–size integer silences warnings about string length and makes storing build info a little more efficient.

The hash is obtained separately from version string and is shifted to the left by 4 bits if the working tree is dirty.

Signed-off-by: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
2020-10-28 10:40:28 +01:00
Hans-Kristian Arntzen 202a3257d7 vkd3d: Make use of StorageImageReadWithoutFormat if supported.
Death Stranding makes use of typed load from RGB10A2.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-12 14:55:24 +02:00
Hans-Kristian Arntzen c59a6abfbd meta: Introduce vkd3d_meta_create_sampler.
Will be used for immutable samplers for scalers.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-06 13:15:31 +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
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 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
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 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
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
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
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
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 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 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
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 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
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 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
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 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 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
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
Philip Rebohle d43f70bb1b vkd3d: Enable VK_EXT_robustness2 if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Joshua Ashton 287ceb207d vkd3d: Refactor platform-specific code
This commit moves the module handling code which was previously dumped in device.c and the code to retrieve the current executable path to its own file.

This also eliminates HAVE_DECL_PROGRAM_INVOCATION_NAME from config.h

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 11:07:50 +02:00
Joshua Ashton f3c85328f1 vkd3d: Remove PACKAGE_NAME usage for engine version
This isn't going to change. Drivers use this to do special things,
so changing it would probably cause a bunch of random problems anyway.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-15 21:45:35 +02:00
Hans-Kristian Arntzen cbdf6f88d2 vkd3d: Remove dependency on linking directly against libvulkan.
There is no reason to not load Vulkan dynamically, otherwise, we must
have loader dev packages installed, which is not ideal.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-15 15:47:18 +02:00
Hans-Kristian Arntzen 9534c1a345 vkd3d: Move to VK_EXT_debug_utils.
debug_marker/debug_report are both deprecated in favor of debug_utils and vkd3d was using marker in a
buggy way anways, as debug_marker requires debug_report to work, but it was
only conditionally enabled.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +02:00
Hans-Kristian Arntzen 6a038003e2 vkd3d: Always enable instance debug extension.
Prepare for moving to VK_EXT_debug_utils.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +02:00
Hans-Kristian Arntzen 726356ebb1 vkd3d: Always use PDF2/PDP2 without KHR extensions.
It is core in Vulkan 1.1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +02:00
Philip Rebohle 8ced3b53b9 vkd3d: Expose D3D12_RESOURCE_HEAP_TIER_1 based on hardware capabilities.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle bbcaeee69d vkd3d: Determine compatible memory types for different resource types.
We'll need this to more accurately select the memory type for D3D12
heaps based on which resources are allowed to be placed in it.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle e6857939e7 vkd3d: Do not enable VK_KHR_dedicated_allocation.
Core in 1.1.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Philip Rebohle 45109686be vkd3d: Do not enable VK_KHR_maintenance3.
Core in 1.1.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Philip Rebohle 317868ab2b vkd3d: Remove required extensions.
Both of these are core in 1.1.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Philip Rebohle 9852b1702d vkd3d: Require Vulkan 1.1 device.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Philip Rebohle 3880e61be2 vkd3d: Require Vulkan 1.1 instance.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Hans-Kristian Arntzen 7e229213f5 vkd3d: Enable SM 6.2 features.
Need float16_int8 and subgroup with extended types to implement new SM
6.2 features. For now, skip over SM 6.1 features until someone makes use
of them.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-05-27 14:33:24 +02:00
Philip Rebohle e99d92bef9 vkd3d: Expose Tiled Resources Tier 2.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 6cbf61ca92 vkd3d: Enable VK_EXT_sampler_filter_minmax if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 00e956dfac vkd3d: Expose Tiled Resources Tier 1.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle 7836c06204 vkd3d: Add dedicated queue for sparse binding if necessary.
This will serve as a fallback if at least one queue family
does not support sparse binding.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle 98462ea1ed vkd3d: Implement d3d12_device_GetResourceTiling.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00