Commit Graph

1364 Commits

Author SHA1 Message Date
Philip Rebohle 287f4e525b vkd3d: Remove some useless null pointer checks in d3d12_root_signature_cleanup.
All vkDestroy* functions are defined to perform no operation when passed
a null handle. vkd3d_free should follow regular free semantics.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 5e8821d561 vkd3d: Clean up root signature descriptor counting.
Removes some unused counters and repurposes the existing ones to
differentiate between bindings (i.e. the array passed to the shader
compiler) and packed descriptors.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 7c276f5e82 vkd3d: Rework root constant updates.
Fixes an issue where push constants can be invalidated by
shader-based clear/copy commands.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 0eed8a1080 vkd3d: Rework root constants.
Uses one push constant range with VK_SHADER_STAGE_ALL. This
will allow us to easily add descriptor table offsets as push
constants.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 5700b37aa4 vkd3d-shader: Work around games not declaring bindings properly.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle a7fbb728ec vkd3d-shader: Apply NonUniformEXT decorations to resources as needed.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle d92d2af986 vkd3d-shader: Parse NonUniform operand modifier.
This modifier can be applied to both destination and source
operands, so for the sake of simplicity and to avoid having
to pass down modifier information explicitly, just store this
state with the register.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +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 ffaa31e1d9 vkd3d-shader: Implement bindless sampler declarations and indexing.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle 6f20fcc488 vkd3d-shader: Implement bindless resource indexing.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 10:55:24 +01:00
Philip Rebohle 6c4a476318 vkd3d-shader: Implement bindless resource declarations.
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 4218009e79 vkd3d-shader: Add helpers to declare runtime arrays.
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 598afec8ea vkd3d: Create NULL sampler.
Defaults taken from D3D11.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-05 13:03:44 +01:00
Philip Rebohle 8fc2fb9842 vkd3d: Create NULL buffer and image views.
An upcoming change to the binding model will use these to
initialize descriptors that have the wrong resource type
bound, or were left uninitialized by the application.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-05 13:03:44 +01:00
Philip Rebohle 0ecce2ec2f vkd3d: Use different formats for UAVs than for SRVs.
Otherwise we might run into undefined behaviour if an app
tries to read a NULL UAV or perform atomic operations.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-05 13:03:44 +01:00
Hans-Kristian Arntzen 92724ce15c vkd3d: Attempt to create a Vulkan 1.1 instance and device.
Need this to support subgroup operations for SM 6.0.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-05 11:03:01 +01:00
Philip Rebohle dfa208f909 vkd3d: Remove d3d12_command_list_invalidate_bindings.
The primary purpose of this function was to invalidate UAV
counters upon binding a pipeline. This is no longer an issue
and we don't have any other per-pipeline bindings, so this
function can be dropped.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-03 20:58:46 +01:00
Philip Rebohle f3d89a548a vkd3d: Reintroduce UAV counters.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-02 12:16:30 +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
Philip Rebohle 0dab14ed22 vkd3d: Temporarily drop UAV counter support.
This needs a major rework as the current implementation has bugs,
is hard to reason about, and very hard to maintain as we're about
to make major changes to the binding model as a whole.

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
Hans-Kristian Arntzen 3ebe2eb527 vkd3d-shader: Expose debug shader dumping in private header.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 19:46:30 +01:00
Hans-Kristian Arntzen 4928f9c094 vkd3d-shader: Add path for debug dumping SPIR-V as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 19:46:30 +01:00
Hans-Kristian Arntzen 0f971790e6 vkd3d-shader: Attempt to parse ISG1 as well when parsing input signatures.
DXIL blobs use ISG1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 15:20:10 +01:00
Hans-Kristian Arntzen 4a9ab29903 vkd3d-shader: Add helper function to query if a blob is DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 15:20:10 +01:00
Hans-Kristian Arntzen edd4c990ed vkd3d-shader: Move vkd3d_find_shader into private header.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 15:20:10 +01:00
Philip Rebohle 82f9f76931 vkd3d-shader: Rework SPIR-V extension enablement.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-27 10:30:34 +01:00
Philip Rebohle 7cccf5756a vkd3d-shader: Rework SPIR-V capability enablement.
We're going to need more capabilities outside the 0-63 range
going forward, so a bitmask doesn't cut it and adding extra
struct members for each capability seems excessive.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-27 10:30:34 +01:00
Hans-Kristian Arntzen 1da8ee9f86 vkd3d: Remove obsolete FIXME for immutable samplers with register space.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 20:50:05 +01:00
Hans-Kristian Arntzen 0c241ff54f vkd3d: Fix regression with UAV counters.
Need to report back actual bindings, not 0/0.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 13:00:10 +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
Philip Rebohle c3871951ad vkd3d-shader: Factor out methods to retrieve resource binding info.
Allows us to get more detailed info about any given binding.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle 74e706cbe3 vkd3d-shader: Introduce vkd3d_shader_descriptor_type_from_register_type helper.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle d95762db65 vkd3d-shader: Also log register space for unmapped bindings.
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 00eec801de vkd3d: Load Vulkan dynamically in d3d12 test app.
On Windows, it is not ideal to rely on Vulkan being available as a
linkable library as a full install of the Vulkan SDK must be present and
set up, be friendly and load Vulkan dynamically instead.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 11:53:29 +01:00
Hans-Kristian Arntzen 69ad7c91c4 vkd3d-utils: Make vkd3d-utils compilable on MSVC.
Useful to be able to run unit tests on Windows.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 11:53: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
Andrew Eikum f548d817e5 Merge remote-tracking branch 'philip/metro-tess-fixes' into proton_5.0 2020-02-19 15:14:12 -06:00
Hans-Kristian Arntzen 89c516e5da vkd3d: Disable async compute queues for the time being.
Cannot disable VK_EXT_descriptor_indexing as we relied on internal
behavior in RADV related to global_bo_list. Implementing bindless
properly in vkd3d will solve this correctly.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-19 15:39:51 +01:00
Hans-Kristian Arntzen 022500044f vkd3d-shader: Use correct register offset.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Hans-Kristian Arntzen c6fd8e442a vkd3d-shader: Fix TessFactor order for isolines.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Hans-Kristian Arntzen 5a7ebf7630 vkd3d-shader: Deal with reading packed TessFactor in DS.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Hans-Kristian Arntzen 185c037f98 vkd3d-shader: Compute XfbOffset per buffer.
Fixes Hairworks GPU crash on Metro Exodus.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Philip Rebohle 4bdec95f37 vkd3d-shader: Clean up vkd3d_dxbc_compiler_emit_shader_phase_input.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-12 14:15:55 +01:00
Philip Rebohle 934646027a vkd3d-shader: Allow hull shader join phases to read patch constants.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-12 14:15:55 +01:00