Commit Graph

2398 Commits

Author SHA1 Message Date
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
Philip Rebohle 95716029a8 vkd3d: Use new memory allocation code in vkd3d_allocate_image_memory.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle 615e933db6 vkd3d: Use new memory allocation code in vkd3d_allocate_buffer_memory.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle 43e2c3ffe6 vkd3d: Add new memory allocation helpers.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +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
Hans-Kristian Arntzen f0c9627db9 configure.ac: Report that 1.2.140 is required, not 1.1.140.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-03 15:39:32 +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 9875d65d35 vkd3d: Apply heap offsets for ExecuteIndirect buffers.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-05-29 13:03:32 +02:00
Philip Rebohle 1ade8c0cc5 vkd3d: Issue full barrier at the end of command lists.
D3D12 apparently does this implicitly. Fixes rendering issues in
the AMD COCOA demo on Polaris with RADV, which does not emit a
barrier between the AO compute passes and the tone mapping pass
in the next command buffer.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-27 14:59:21 +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
Hans-Kristian Arntzen b3be23c066 vkd3d-shader: Only sample with the required number of components.
Works around a driver bug on NV which affected RE2 in particular, but
probably other titles as well.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-05-22 11:54:04 +02:00
Hans-Kristian Arntzen 71034acc76 configure: Check for 1.1.140 headers.
Needed for VK_EXT_custom_border_color.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-05-14 14:06:45 +02:00