Commit Graph

327 Commits

Author SHA1 Message Date
Joshua Ashton d709fd3306 vkd3d: Add vkd3d_atomic_uint32_{dec, inc}rement helper
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 21:13:35 +02:00
Joshua Ashton 45d4296a54 vkd3d: Rename vkd3d_uint32_atomic to vkd3d_atomic_uint32
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 21:13:35 +02:00
Joshua Ashton 033f76e3ae vkd3d: Define our own memory orders
We shouldn't potentially override stuff in the std library and this allows us to map directly to __ATOMIC_* memory orders which is more correct.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 21:13:35 +02:00
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 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 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 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
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 1f266cc16b vkd3d: Eliminate HAVE_PTHREAD_H
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 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 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
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
Philip Rebohle fe13c017ea vkd3d: Move is_power_of_two to common header.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle 830c1e7a06 include: Fix incorrect UpdateTileMappings declaration.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-30 18:08:25 +02:00
Hans-Kristian Arntzen 6a6aa69abb include: Add missing DXR constants to IDL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-22 16:28:19 +02:00
Hans-Kristian Arntzen 4595cacc79 vkd3d: Enforce that WCHAR is actually a WCHAR.
We will need to receive 2-byte WCHARs from apps.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-22 16:26:49 +02:00
Hans-Kristian Arntzen ca7c027cd1 vkd3d: Replace dummy atomic_fetch_add with atomic loads.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-17 15:46:09 +02:00
Philip Rebohle bfcb41706c include: Update D3D12 IDL.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 14:25:01 +02:00
Philip Rebohle d65cd725d9 include: Fix typos.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 10:35:59 +02:00
Philip Rebohle 561675410b include: Fix typo.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-14 16:27:08 +02:00
Philip Rebohle c44b168da2 include: Fix ID3D12Device2 GUID.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-08 14:23:28 +02:00
Philip Rebohle 1b41a77c19 include: Add missing logic ops.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 13:54:10 +02:00
Philip Rebohle ac1942f9ac include: Fix typos and add D3D12_DEPTH_STENCIL_DESC1.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 10:35:40 +02:00
Philip Rebohle 22feb3e8be include: Update D3D12 IDL.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 15:45:05 +02:00
Philip Rebohle b577b5c329 vkd3d-common: Implement spinlock.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-27 13:33:03 +01:00
Philip Rebohle a9ba32a6c4 vkd3d-shader: Add option to declare bindless CBVs as SSBOs.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Philip Rebohle be5cdd2e55 vkd3d-shader: Optionally declare push constant buffer as UBO.
Will be used on implementations that do not support enough
push constants to hold all root signature data.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +01:00
Philip Rebohle aff849e7f4 vkd3d: Add helpers to iterate over 64-bit masks.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 1c9b07e8b3 vkd3d-shader: Scan multi-register descriptor ranges properly.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle ade87e6c47 vkd3d-shader: Add push constants for descriptor table offsets.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle 34e128897d vkd3d-shader: Pass more info from root signature to shader compiler.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle 324da790db vkd3d-shader: Simplify UAV counter interface declaration.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-02 12:16:30 +01:00
Philip Rebohle 0689d8396d vkd3d-shader: Change the way UAV bindings are tracked.
Makes UAV-related code more readable and supports up to 64
UAV bindings, which is enough to support resource binding
tier 2.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-02 12:16:30 +01:00
Hans-Kristian Arntzen f015da5e56 vkd3d-shader: Add entry point to query if DXIL is supported.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-29 14:11:57 +01:00
Philip Rebohle 27595a8147 vkd3d-shader: Drop support for OpenGL targets.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle c4c9fa82b0 vkd3d-shader: Drop support for combined resource samplers.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Hans-Kristian Arntzen 93e4b6ff9b vkd3d: Deal correctly with SM 5.1 register spaces.
Resource index is found in idx[0] in SM 5.0, but idx[1] when using SM
5.1, and register space is encoded separately. An rb_tree keeps track of
the internal resource index idx[0] and can map that to space/binding as
required when emitting SPIR-V.

For this to work, we must also make UAV counters register space aware.
In earlier implementation, UAV counter mask was assumed to correlate 1:1
with register_index, which breaks on SM 5.1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 12:32:29 +01:00
Hans-Kristian Arntzen 484ac51267 vkd3d: Add simple pthread wrapper for MSVC.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 11:53:29 +01:00
Conor McCarthy 0d43c776c5 vkd3d/tests: Add tests for ID3D12GraphicsCommandList2::WriteBufferImmediate().
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:13 +01:00
Conor McCarthy 9c64642468 vkd3d: Add SetViewInstanceMask() to the ID3D12GraphicsCommandList1 interface.
This method was missing in version 10.0.15063.0 of the SDK, but is
present in version 10.0.18362.0, without a UUID change. Presumably that
means this was simply an omission in the older header, rather than an
API change in the newer header.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:10 +01:00
Conor McCarthy 87cc75b7e6 vkd3d: Add support for custom heap properties.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:20:50 +01:00
Hans-Kristian Arntzen f180e95e2f vkd3d: Add MSVC path for atomic_add_fetch.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 19:16:20 +02:00
Hans-Kristian Arntzen 50bd2db618 vkd3d: Fix use of non-standard vararg macros.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 19:15:39 +02:00