Commit Graph

2502 Commits

Author SHA1 Message Date
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 f0269739b1 debug: Add support for a log file.
Simplistic implementation. Also, make sure lines are written atomically
to not get garbled logs.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 16:09:00 +02:00
Hans-Kristian Arntzen 7fb97940f1 vkd3d: Initialize debug code once with pthread_once_t.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 16:09:00 +02:00
Hans-Kristian Arntzen b16b98e77d d3d12: Initialize Vulkan library once with pthread_once_t.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 16:09:00 +02:00
Hans-Kristian Arntzen 8743577ca5 vkd3d: Add MSVC path for pthread_once_t.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 16:09:00 +02:00
Hans-Kristian Arntzen 7f29d25611 debug: Flush logging output.
On Windows, we don't get a flush naturally after every newline,
so flush manually every time to make sure we get everything in a timely
fashion.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 16:09:00 +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
Hans-Kristian Arntzen d919c74276 vkd3d: Add test for 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 2b2c4a2e33 d3d12: Fix ordinal exports
These were originally copied from d3d12.crosslib.def but it turns out those are wrong.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-07 17:42:21 +01:00
Joshua Ashton 6056df3332 d3d12: Declare exports as __declspec(dllexport) on MinGW
Otherwise the stdcall-alias/fixup doesn't get exported.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-07 17:44:36 +02:00
Joshua Ashton 3fe9dd765d build: Add stdcall alias/fixup when building x86
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-07 17:44:36 +02:00
Hans-Kristian Arntzen 0c59c30e08 vkd3d: Fix tzcnt64 on MSVC 32-bit and 64-bit.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-07 16:31:29 +01:00
Hans-Kristian Arntzen c97a8ba253 vkd3d-compiler: Fix build on MSVC.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-07 16:31:29 +01:00
Hans-Kristian Arntzen b6e5760b6e d3d12: Use CreateDXGIFactory1 instead of 2.
MinGW-w64 somehow does not export 32-bit symbols of DXGIFactory2.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-07 16:31:29 +01: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
Hans-Kristian Arntzen c3392dad97 vkd3d: Fix automake build.
Missing IDL header.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-06 21:32:16 +02:00
Hans-Kristian Arntzen a6d8ea4800 vkd3d: Update clone link in README.md.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-06 21:32:06 +02:00
Hans-Kristian Arntzen 1ea32a66ce vkd3d: Update README.md.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-06 20:32:00 +02:00
Joshua Ashton 5e5eee368c subprojects: Update dxil-spirv to fix Windows builds 2020-07-06 18:56:54 +01: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 cbebf9efed build: Add build_standalone_d3d12 option
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton 3d52186d3a build: Move build options to top of build script
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton cb4fcd5a98 include: Replace MinGW hack with Win32 platform header
Replace this hack with a more versatile one that works for multiple compilation objects.

Consolidates this hack across all the code bases (soon to be used in a D3D12 standalone patch)

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 10f7ec4ad8 build: Remove -Wno-incompatible-pointer-types
No longer needed with recent changes.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton 19c910904b vkd3d-shader: Use uint32 for immediate constants
DWORD and uint32_t are different types on Windows.
Fixes warnings.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton 77679e8b32 vkd3d-shader: Split read_dword into read_uint32
On Windows, DWORD is unsigned long, which means it's technically a different pointer type.

Let's keep type safety (as much as we can in C) and remove some warnings.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton ec8d14593a build: Remove -Wno-discarded-qualifiers
We don't need this since the CONST_VTBL change.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +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
Joshua Ashton b05371432a build: Remove -Wno-missing-braces
Hold over from autotools that isn't needed.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton 12e4014b54 vkd3d-shader: Fix incorrect assertion
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Hans-Kristian Arntzen 6e944dab6b vkd3d: Use ptrdiff in utf8 strdup.
max_elements is in number of elements, not bytes.
Fix regression from refactor.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-02 12:28:03 +02:00
Hans-Kristian Arntzen 49190da623 vkd3d: Fix pointer type mismatch.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-02 12:28:03 +02:00