Commit Graph

2414 Commits

Author SHA1 Message Date
Joshua Ashton 25f6e1d0a9 vkd3d: Use __atomic builtins instead of stdatomic
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 21:13:35 +02:00
Joshua Ashton 26c9dc90f4 vkd3d: Implement sequential consistency on MSVC
Also optimize and reduce unnecessary barriers.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 21:13:35 +02:00
Joshua Ashton 0d1dea607a demos/gears: Don't redefine _GNU_SOURCE
We define this globally now.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:27:22 +02:00
Joshua Ashton 4c819baad3 vkd3d: Use pthread reimplementation only on MSVC
We can use pthreads properly under MinGW
2020-06-24 15:27:22 +02:00
Joshua Ashton fb02f28c41 vkd3d: Don't redefine InterlockedIncrement under MinGW
Fixes compiler warnings

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:27:22 +02:00
Joshua Ashton 2e32cb11ba programs/vkd3d-compiler: Add build script
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:27:22 +02:00
Joshua Ashton c79d073b67 build: Fallback to vkd3d-utils if no d3d12 lib is present
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:27:22 +02:00
Philip Rebohle 945ec70f4d tests: Don't build uninteresting tests.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-24 15:19:18 +02:00
Joshua Ashton 161dc007c5 build: Link dxil-spirv statically
Don't need to link this in any fancy way

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Joshua Ashton 8931770654 subprojects: Update dxil-spirv submodule
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Joshua Ashton 22545c189a vkd3d-shader: Build statically
We don't need this to be another random so floating around...

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Joshua Ashton 4521b253dd vkd3d: Toss VKD3D_DEBUG_ENV_NAME
Creates linking problems if we want to build vkd3d-shader statically given this links back to something in vkd3d-common.

We don't need this distinction anyways...

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Hans-Kristian Arntzen 69f338be8f build: Fix MinGW build.
Revert removal of MinGW forceinline hacks.
They are necessary or MinGW fails to build.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-24 14:17:34 +01:00
Hans-Kristian Arntzen 2b7ef38248 Revert "vkd3d: make spinlock_t atomic to make clang happy"
This reverts commit 7b1dce2667.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-24 13:40:03 +02:00
Georg Lehmann 7b1dce2667 vkd3d: make spinlock_t atomic to make clang happy
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2020-06-24 13:26:31 +02:00
Hans-Kristian Arntzen 24be81fdfb vkd3d/meta: Initialize flags variable.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-24 12:43:19 +02:00
Joshua Ashton 8c216e637c build: Add Meson build system
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +02:00
Joshua Ashton 45f9836c60 vkd3d: Eliminate config.h
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +02:00
Joshua Ashton da2c9a1043 vkd3d: Eliminate HAVE_SPIRV_UNIFIED1_SPIRV_H and HAVE_SPIRV_UNIFIED1_GLSL_STD_450_H
These are submodules now.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +02:00
Joshua Ashton 1f266cc16b vkd3d: Eliminate HAVE_PTHREAD_H
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +02:00
Joshua Ashton e34eb3bf0f subprojects: Add submodules for dependencies
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +02:00
Georg Lehmann a95e56675a vkd3d: use pause while spinning on x86
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2020-06-17 09:49:08 +02:00
Joshua Ashton bfd7127284 vkd3d-shader: Don't use return value semantics in void functions
Fixes warnings in MSVC.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 12:13:54 +02:00
Joshua Ashton 0b1a25a9e5 vkd3d: Add vkd3d_atomic.h to Makefile.am
This was missing previously.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 11:07:50 +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 f3ec53cb5d vkd3d: Implement vkd3d_get_program_name for Win32
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 11:07:50 +02:00
Hans-Kristian Arntzen da782831e4 Revert "vkd3d: Use monotonically increasing fence values in test suite."
Rewinding fence values were undocumented at the time, but new
documentation makes it clear that it is allowed to rewind a fence, even
if behavior is unpredictable in nature.

This reverts commit 3b9f1f8a9c.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-16 11:00:08 +02:00
Hans-Kristian Arntzen 349412f19f vkd3d: Support rewinding ID3D12Fence.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-16 11:00:08 +02:00
Hans-Kristian Arntzen 5ef7b99e0b vkd3d: Fix uninitialized return value in CPU fence signaling.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-16 11:00:08 +02:00
Joshua Ashton 75089f0e1d demos/gears: Use hpc for getting time on Win32
There's no sys/time.h on MSVC.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 10:55:56 +02:00
Joshua Ashton b711125f60 demos/gears: Define _USE_MATH_DEFINES
Needed for M_PI on MSVC

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 10:55:56 +02:00
Joshua Ashton 697dc565a9 demos: Use WinMain instead of wmain on Win32
We're going to want to build as a GUI app, so we need
to use real WinMain on Windows for this.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 10:55:56 +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
Joshua Ashton cd5d01d25c vkd3d: Refactor atomics
There is no stdatomic available on MSVC so let's clean things up.

This moves all the atomic helpers to vkd3d_atomic.h and implements all platform's spinlocks in entirely the same way.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-15 20:40:10 +02:00
Joshua Ashton b9909854fe vkd3d: Make nameless unions really nameless
This makes it consistent across tests and vkd3d.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-15 19:59:52 +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
Philip Rebohle 4cf8467b9d vkd3d-shader: Introduce vkd3d_dxbc_compiler_find_register_info.
Does not generate logs when not finding a register, which reduces
some misleading spam in Anno 1800 tessellation shaders.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-15 13:32:55 +02:00
Hans-Kristian Arntzen 9defd87f95 vkd3d: Implement BeginEvent/EndEvent.
Only support ANSI/UNICODE version for now. The PIX3BLOB format is
extremely weird, complicated and undocumented.
We can refer to RenderDoc if we need it later ...

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +02:00
Hans-Kristian Arntzen cae30f8602 utils: Add a max_elements parameter to wchar conversion.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +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
Hans-Kristian Arntzen d8ca2cef6d vkd3d: Serialize all queue submissions.
Gets rid of the full barrier on command buffer end.
Instead, do what D3D12 wants, which is to serialize all
ExecuteCommandLists. Simplify the existing timeline sempahore setup for
sparse queues and use it for all submissions.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-09 14:28:13 +02:00
Philip Rebohle bc7426ceb0 vkd3d-shader: Fix modifier handling.
This is a set of flags, so we should treat it as such.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-09 13:20:36 +02:00
Philip Rebohle 1fa3686638 vkd3d: Use ALLOW_ONLY_BUFFERS for committed buffer resources.
Otherwise, we may end up failing to allocate memory on Tier 1
hardware, and also fail to use dedicated allocations in some
cases.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle 8ca1a5aab4 tests: Test image creation on ALLOW_ONLY_BUFFERS heap.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle d49f47dbc2 vkd3d: Validate heap flags for placed resources.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle eda59ea66c vkd3d: Remove vkd3d_select_memory_type.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle 2b88df93a2 vkd3d: Use new memory allocation code in d3d12_resource_bind_sparse_metadata.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle 5bf492c207 vkd3d: Rework vkd3d_allocate_device_memory.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00