Commit Graph

372 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen 22a907e11a vkd3d: Add descriptor QA logging.
When reading GPU hang dumps, we can figure out what happened to
descriptor types along the way.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-09 14:51:53 +01:00
Philip Rebohle 1d9f28b25f vkd3d: Add fast path for mutable descriptor copies.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-09 14:31:22 +01:00
Philip Rebohle 7d40d8a22e vkd3d: Rework descriptor copies to copy ranges.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-12-09 14:31:22 +01:00
Hans-Kristian Arntzen aa21d2d03d vkd3d: Add support for VK_VALVE_mutable_descriptor_type.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-07 15:17:08 +01:00
Hans-Kristian Arntzen f67f55827e vkd3d: Parse patch version of PACKAGE_NAME as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-12-03 15:05:13 +01:00
Philip Rebohle afb85c79cd vkd3d: Add code to create, destroy and recycle scratch buffers.
Command lists may need to allocate temporary device memory for
certain operations. In order to avoid frequent alloc/free calls,
we'll recycle these scratch buffers until a certain threshold.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-24 16:45:55 +01:00
Georg Lehmann 11bdc76aa0 vkd3d: Use static init for device map.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2020-11-18 18:29:48 +00:00
Joshua Ashton a950191008 vkd3d: Implement singleton devices.
Matches D3D12 behaviour.

Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-18 12:39:14 +01:00
Hans-Kristian Arntzen f54ac3b9c5 vkd3d: Add app detection for buggy game: ds.exe.
Game renders the map with wrong descriptor type, which means we must
implement everything as texel buffers to make this work.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 12:27:19 +01:00
Hans-Kristian Arntzen 6f8ae20015 vkd3d: Add VKD3D_CONFIG option to disable bindless SSBO.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-18 12:27:19 +01:00
Hans-Kristian Arntzen 0749f46d8e vkd3d: Re-enable wave ops.
dxil-spirv update fixed the issue for me.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-17 10:49:40 +01:00
Hans-Kristian Arntzen 74a654e273 vkd3d: Disable waveops for time being.
The fix which enabled waveops detection broke HZD, since we never tested
with that feature enabled.

Keep it disabled until we can figure out what is going on.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-13 12:58:22 +01:00
Philip Rebohle b536723f5a vkd3d: Fix shader model-related feature detection.
We need to know the supported shader model to detect support
for certain features like wave ops correctly.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-11 10:41:11 +01:00
Joshua Ashton 8dea487861 meta: Add missing newlines to end of files
Remove trailing whitespace also

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-11-05 17:16:57 +01:00
Philip Rebohle f29b397a9f vkd3d: Implement RTV/DSV descriptor copies.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-30 17:02:17 +01:00
Philip Rebohle 109c881ccb vkd3d: Unify RTV and DSV descriptor types.
The struct definitions were identical anyway, and unifying
these will prevent unnecessary code duplication.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-30 17:02:17 +01:00
Hans-Kristian Arntzen d8bd309ab2 vkd3d: Log vkd3d applicationVersion and build hash.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-28 17:03:54 +01:00
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