Commit Graph

2379 Commits

Author SHA1 Message Date
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
Philip Rebohle 50a9fae263 vkd3d: Silence SetMarker/BeginEvent/EndEvent log spam.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:27:02 +02:00
Philip Rebohle 6707f3fc30 vkd3d: Invalidate descriptor heaps on root signature change.
Apparently we need to do this if the push constant layout changes.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:27:02 +02:00
Philip Rebohle c75bbb9997 vkd3d: Handle null root descriptors.
We should hook this up to the robustness2 feature at some point,
but for now, just use the dummy descriptors. Fixes a crash in
the AMD CACAO demo.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:27:02 +02:00
Philip Rebohle e99d92bef9 vkd3d: Expose Tiled Resources Tier 2.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 7e02541003 vkd3d: Implement sampler reduction modes.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 6cbf61ca92 vkd3d: Enable VK_EXT_sampler_filter_minmax if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 6478632dca vkd3d-shader: Remove old Nvidia workaround for dref instructions.
This was fixed two years ago in the 396 and later 390 drivers.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 37b9875e98 vkd3d-shader: Implement sparse ld_uav_typed instruction.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle a1b2cef928 vkd3d-shader: Implement sparse ld_raw and ld_structured instructions.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 7b9dbdc4ce vkd3d-shader: Implement sparse ld instructions.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle bb5e0969b2 vkd3d-shader: Implement sparse gather instructions.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 1839d13ef3 vkd3d-shader: Implement sparse sample_c instructions.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 45ec9b7f27 vkd3d-shader: Implement sparse sample instructions.
In addition to sparse feedback, these instructions also clamp the
LOD, with the minimum LOD being passed in as the last parameter.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle c09b66f404 vkd3d-shader: Implement check_access_fully_mapped instruction.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 277f731bd7 vkd3d-shader: Add helpers to deal with sparse instruction results.
OpImageSparse* operations return a struct containing a status value
and the sampled value, so we need to take it apart when storing results.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 26f6e59f3e vkd3d-shader: Add helper to declare a struct once.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 6d0c1b4dd3 vkd3d-shader: Handle feedback instructions in UAV read scanner.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle fa029a1a84 vkd3d-shader: Add definitions for sparse feedback instructions.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 13c6d064ab tests: Add tests for sparse feedback shader instructions.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00