Commit Graph

232 Commits

Author SHA1 Message Date
Joshua Ashton 0ab18ea09b vkd3d: Use CONST_VTBL instead of const for vtable decls
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 02:02:21 +01: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 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
Philip Rebohle 0061c9e6d7 vkd3d: Define external render pass dependencies.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 16:13:19 +02:00
Philip Rebohle d355f03d66 vkd3d: Fix depth-stencil load/store ops.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 16:13:19 +02:00
Philip Rebohle 0ff0423538 vkd3d: Store DSV layout with graphics pipelines.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle 532cb49abb vkd3d: Introduce d3d12_create_static_sampler.
It makes sense to separate this from d3d12_create_sampler since static
samplers and regular samplers differ in border color support.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-21 11:57:14 +02:00
Philip Rebohle 957aec4785 vkd3d: Restore old ClearUnorderedAccessView implementation.
The current code uses D3D12 abstractions to create pipelines but
issues raw Vulkan API calls to actually implement the functionality,
which means the code makes assumptions about the exact descriptor
set layout and push constant layout, which is generally a bad idea
now that we have multiple code paths for root constants etc.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-16 18:03:39 +02:00
Philip Rebohle 9647109559 vkd3d: Add stubs for ID3D12PipelineLibrary1.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-08 14:23:28 +02:00
Philip Rebohle 50b5959e64 vkd3d: Implement better stub for GetCachedBlob.
We currently can't implement this in a meaningful way, but we
should return an empty blob in order to not crash applications.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-08 14:23:28 +02:00
Philip Rebohle 4e3ea62e79 vkd3d: Implement depth bounds test.
Used by Resident Evil 2 and 3 if available.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 16:04:39 +02:00
Philip Rebohle 960e6f85fd vkd3d: Support multiple viewports.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 15:57:23 +02:00
Philip Rebohle ae789d9ba8 vkd3d: Pass dynamic state struct to get_or_create_pipeline.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 15:57:23 +02:00
Philip Rebohle 9cb863f84a vkd3d: Only enable dynamic states if necessary.
Avoids some unnecessary API calls.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 15:39:33 +02:00
Philip Rebohle e08580f178 vkd3d: Refactor dynamic state enablement.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 15:39:33 +02:00
Philip Rebohle 6fbc38118a vkd3d: Implement support for logic op.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 13:54:10 +02:00
Philip Rebohle f032702a74 vkd3d: Extend graphics pipeline description.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-01 10:35:40 +02:00
Philip Rebohle c41275478c vkd3d: Refactor pipeline state creation.
We need a more extensible struct to contain the pipeline
descriptions in order to be able to support new rendering
features.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-31 18:28:18 +02:00
Philip Rebohle 09b7013f59 vkd3d: Don't use push descriptors if we exceed the device limit.
This can in theory happen if we have 32 root descriptors and
bindless UAV counters.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 10:47:47 +02:00
Philip Rebohle 29d1a5e089 vkd3d: Remove unused root descriptor count from root signature.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 10:47:47 +02:00
Philip Rebohle a7a27e3c05 vkd3d: Fix descriptor count for UAV counter binding.
Copy-paste error that causes us to exceed the push descriptor
limit in some situations.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 10:47:47 +02:00
Philip Rebohle f8c842f03c vkd3d: Enable bindless UAV counters if supported.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle 000983aa73 vkd3d: Declare bindless UAV counter binding.
We'll add this to the root descriptor set since moving the binding
to one of the bindless sets would be hard to do; we'd need to track
the binding index of each "bindless" binding for set updates etc.

In order to stay within the limit of 8 sets, we also cannot introduce
a separate set for UAV counters (currently there are 6 bindless sets,
the static sampler set, and the root descriptor set).

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle cdc35483c4 vkd3d: Remove default pixel shader.
Unnecessary.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:07:28 +01:00
Philip Rebohle 682838b193 vkd3d: Enable bindless UAV.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle b6cfef09cb vkd3d: Explicitly assign UAV counter set.
Otherwise, we pass an incorrect set index when using bindless UAVs.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle 4ee06bc5d6 vkd3d: Ignore UAV counters for unbounded UAV ranges.
We cannot support that right now.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Hans-Kristian Arntzen afb47543d2 vkd3d: Always use CBV-as-SSBO path.
NVIDIA currently seems to have some issues with bindless CBV on Vulkan,
which have been reported. Somehow, bindless SSBO works around black
screen on SotTR, as well as some rendering glitches on Control.

AMD won't care since UBOs and SSBOs are basically the same thing.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-25 11:16:44 +01:00
Hans-Kristian Arntzen 8010c26ec4 vkd3d: Do not attempt to enable primitive restart for non-strip topology.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-23 12:56:16 +01:00
Philip Rebohle 95c1faeeb9 vkd3d: Add some missing bindless feature checks.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Philip Rebohle 2ffb5396cc vkd3d: Use storage buffers for bindless CBV if supported.
Used as a fallback for older Nvidia generations which do not
support bindless uniform buffers.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Philip Rebohle fda155b965 vkd3d: Adjust descriptor types if CBV_AS_SSBO is set.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Philip Rebohle 3709ae1dd8 vkd3d: Introduce VKD3D_BINDLESS_CBV_AS_SSBO flag.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Hans-Kristian Arntzen 71d8f63356 vkd3d: Split descriptor pool allocation based on usage.
Logically split up descriptor pool allocation in three types:
- STATIC: Root descriptors and internal allocation.
- VOLATILE: For packed descriptor set which comes from heaps.
- IMMUTABLE_SAMPLER: For immutable samplers. This should be removed once
  we start allocating sampler sets at sampler creation time.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 14:29:03 +01:00
Philip Rebohle 87e9bb3e82 vkd3d: Use inline uniform block for push constant data if necessary.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +01:00
Philip Rebohle 2688219573 vkd3d: Add inline uniform block to root descriptor set layout if desired.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +01:00
Philip Rebohle e899b96c10 vkd3d: Introduce root signature flag to determine push descriptor usage.
For now this is enbaled based on device capabilities, but future changes
may require this to be disabled for certain root signatures.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +01:00
Philip Rebohle d515e3efa7 vkd3d: Rename flags -> d3d12_flags in d3d12_root_signature.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +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 b495e94062 vkd3d: Enable bindless constant buffer views.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-12 11:32:41 +01:00
Hans-Kristian Arntzen fee9b2bb05 vkd3d: Implement RS 1.0 volatile for packed descriptor set.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-11 12:20:00 +01:00
Philip Rebohle 5f2d511a96 vkd3d: Store whether a descriptor table has packed descriptors.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-11 10:47:58 +01:00
Philip Rebohle fe2a4c62c9 vkd3d: Enable bindless samplers and SRVs if supported by the device.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle 4e95975182 vkd3d: Add bindless descriptor set layouts to pipeline layouts.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle e68aa6c85c vkd3d: Pass descriptor table info to shader compiler.
Adds one push constant per descriptor table to the push constant range.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle a30f511f9a vkd3d: Declare descriptor ranges as bindless if supported.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle 83674a8a61 vkd3d: Correctly handle bindless ranges when counting descriptors.
We still need to pass binding info for each range to the shader compiler,
but bindless ranges will not contribute to the packed descriptor count.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle a1e6a1510f vkd3d: Create descriptor pool and sets for descriptor heaps.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 14:30:28 +01:00
Philip Rebohle 01cbbaea81 vkd3d: Create bindless descriptor set layouts.
Don't enable any bindless features for now so that we don't
introduce regressions as features get added.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 14:07:51 +01:00
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