Commit Graph

2039 Commits

Author SHA1 Message Date
Philip Rebohle c4a173ddca vkd3d: Separate UAV counter bindings from UAV buffer/image bindings.
Now that the binding code no longer makes any wild assumptions about
the exact binding layout, we can safely do this. Will make implementing
bindless a bit easier.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 14:07:51 +01:00
Philip Rebohle 6e15ad20b4 vkd3d: Rework descriptor table binding.
Uses the new data structures to iterate over descriptor
tables and populate the packed descriptor set.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 14:07:51 +01:00
Philip Rebohle 4979953ff9 vkd3d: Rework descriptor tables.
Further changes will require a rework of how resource binding
works inside a command list, so for now, this is just a cleanup
that also removes some old code that is no longer needed.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 13:11:10 +01:00
Philip Rebohle 28bf2eec3e vkd3d: Rework static samplers.
Static samplers are embedded in the root signature, so we can create
a separate descriptor set layout and descriptor set which we only
need to rebind when the root signature itself changes.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 13:11:10 +01:00
Philip Rebohle ae12e22187 vkd3d: Rework root descriptor updates.
Updates the root descriptor set or push descriptor at draw time.
This fixes a potential issue with shader-based clear/copy commands
invalidating previously bound root descriptors.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 12:19:07 +01:00
Philip Rebohle 82bf3e810b vkd3d: Rework root descriptors.
Streamlines descriptor set layout creation for root descriptors.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 12:19:07 +01:00
Philip Rebohle 41a8587f10 vkd3d: Implement unsafe_impl_from_ID3D12DescriptorHeap.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:59:17 +01:00
Philip Rebohle a1ade15885 vkd3d: Rename and repurpose vkd3d_descriptor_set_context members.
- descriptor_index is the index of the descriptor within the packed
  descriptor set or root descriptor set. Currently unused.
- binding_index should now index into the root_signature->bindings array.
- vk_set and vk_binding refer to the Vulkan descriptor set index and
  binding number of packed descriptors or root descriptors.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:59:17 +01:00
Philip Rebohle 189bcd39af vkd3d: Store index of root descriptor set in root signature.
This allows us to put root descriptors into a set other than 0.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 3f125ac919 vkd3d: Temporarily require VK_KHR_push_descriptor.
Allows us to more easily refactor root signature-related code
without having to worry about root descriptors for now.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
Philip Rebohle 0d071c9c37 vkd3d: Rename root signature descriptor set layout members.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 11:44:45 +01:00
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 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 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
Hans-Kristian Arntzen ae2a2bdbe8 vkd3d: Fix DXIL check in test_coverage.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-06 17:15:38 +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 d1f44ad39b vkd3d: Add dxil-spirv to autoconf
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 b04c2361e2 vkd3d: Add test for bindless samplers.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 20:50:33 +01:00
Hans-Kristian Arntzen 687b072b16 vkd3d: Upgrade SRV bindless test to include textures.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 20:50:33 +01:00
Hans-Kristian Arntzen 7c10922aac vkd3d: Add bindless test where root parameter space is exhausted.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 20:50:33 +01:00
Hans-Kristian Arntzen abb2ef8572 vkd3d: Add test for bindless SRV buffers in SM 5.1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 20:50:33 +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