Philip Rebohle
408fed0910
vkd3d: Fix root descriptor indexing.
...
The packed descriptor index is no longer needed, and causes issues in
case a game sets a root signature, then binds a root descriptor, and
then sets a different root signature which maps the given root parameter
index to a different descriptor since we may now read undefined data
when updating push descriptors.
Fixes #366 .
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-06 16:07:47 +01:00
Philip Rebohle
a8f9cc15b3
vkd3d: Create root signature from shader blobs as necessary.
...
MSDN states that root signatures across multiple stages in a graphics
pipeline must be identical, but the D3D12 runtime does not validate
this and mixing different root signatures results in undefined
behaviour, so just taking this from the VS should be safe.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-05 15:21:16 +01:00
Philip Rebohle
1d823f8659
vkd3d: Do not store root signature in graphics pipeline state.
...
We only need to know the pipeline layout for pipeline variant
creation. We are not holding a strong reference to the root
signature anyway, which may be problematic, but this should
not introduce a regression.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-11-05 15:21:16 +01:00
Hans-Kristian Arntzen
e4600edb03
vkd3d: Always enable typed offset buffer.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-04 19:05:28 +01:00
Hans-Kristian Arntzen
670fba6c6f
vkd3d: Enable typed offset buffer in root signature.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-04 19:05:28 +01:00
Hans-Kristian Arntzen
fdd16168be
vkd3d: Rename SSBO_OFFSET_BUFFER to a more generic offset buffer.
...
We will use it for typed buffers as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-11-04 19:05:28 +01:00
Philip Rebohle
49d3fa30a7
vkd3d: Enable offset buffer as necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-28 10:30:12 +01:00
Philip Rebohle
b57a5dd96d
vkd3d: Add extra binding for SSBO offset buffer.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-28 10:30:12 +01:00
Philip Rebohle
15b1fb7128
vkd3d: Restore d3d12_device_use_ssbo_root_descriptors.
...
We will not have offset information for root descriptors, so
we can still only use them with four-byte aligned SSBOs.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-28 10:30:12 +01:00
Philip Rebohle
dd13d44bd5
vkd3d: Use UAV counter address binding from descriptor heap.
...
Instead of binding it via push descriptors at draw time.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-23 12:36:17 +02:00
Philip Rebohle
a76e311c5e
vkd3d: Add UAV counter address buffer to descriptor heap bindings.
...
Introduces 'extra' bindings to bindless sets which can be used to
bind additional storage buffers to the pipeline, which will occur
before the bindless descriptor array in the descriptor set.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-23 12:36:17 +02:00
Philip Rebohle
7e32f833ed
vkd3d: Store binding index in descriptor.
...
Needed for when we add additional descriptors to the bindless
descriptor sets.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-23 12:36:17 +02:00
Hans-Kristian Arntzen
16f09a0ba0
vkd3d: Do not perform any alignment analysis for SSBOs.
...
We cannot rely on alignment analysis since games are buggy and screw up
RAW vs structured on occasion.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-22 13:07:05 +02:00
Hans-Kristian Arntzen
eed4f54a80
vkd3d: Enable SSBO path.
...
For now, don't enable it on NV due to a very likely driver bug.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-21 14:34:37 +02:00
Philip Rebohle
544a6184e9
vkd3d: Enable raw SSBOs for root descriptors on supported hardware.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 16:20:26 +02:00
Philip Rebohle
993cdd254e
vkd3d: Emit resource declarations for raw SSBOs.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Philip Rebohle
3eac9f9c7d
vkd3d: Introduce vkd3d_bindless_set_flag.
...
This will allow us to use the same bindless descriptor set for
different types of descriptor ranges.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Philip Rebohle
c097c00167
vkd3d: Explicitly set descriptor types for bindless sets.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Philip Rebohle
07e6687f6a
vkd3d: Rework descriptor set lookup.
...
This is no longer performance-critical, so in order to simplify changing
the binding model, remove hard-coded descriptor set numbers and instead
look them up based on the requested descriptor properties.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Philip Rebohle
b82bbe265e
vkd3d: Pass storage buffer alignment to shader compiler.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Hans-Kristian Arntzen
f1818c267f
vkd3d: Fix menu regression in RE2.
...
If rendering to A8 format, do not apply output swizzle in non-PS stages.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-14 10:46:46 +02:00
Hans-Kristian Arntzen
f0f1ca161f
vkd3d: Always pass down compiler args.
...
Needed for all stages since typed UAV read can happen in all stages.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-12 14:55:24 +02:00
Hans-Kristian Arntzen
9c04f35757
vkd3d: Fix validation error when render pass is used without attachment.
...
Just drop the VkSubpassDependency in this case to satisfy the validator,
since stages == 0 is not allowed.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-07 17:43:53 +02:00
Joshua Ashton
3c54cf8ad6
vkd3d: Use VK_NULL_HANDLE instead of NULL for VkPipelineCache
...
Fixes a warning in MSVC.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-09-30 01:44:50 +02:00
Hans-Kristian Arntzen
9d36ab59d6
vkd3d: Add support for a shader debug ring.
...
Will allow replaced shaders to emit debug messages to a buffer.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-29 15:00:36 +02:00
Hans-Kristian Arntzen
1ce14c2ef3
vkd3d: Remove bindless CBV workaround.
...
Not relevant anymore, and should see good uplift on NV depending on
content.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-11 16:54:00 +02:00
Hans-Kristian Arntzen
52ecd35dee
vkd3d: Set shader module name to the hash.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Hans-Kristian Arntzen
adde8947c6
vkd3d: Trace which pipelines are being bound and if they are replaced.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-09-08 15:03:41 +02:00
Philip Rebohle
92b6e71ce4
vkd3d: Factor out pipeline state struct conversion.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
15ed944e40
vkd3d: Implement ID3D12PipelineState::GetCachedBlob.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
0396ee544c
vkd3d: Implement support for cached PSO pipeline state.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
2b885c4981
vkd3d: Move ID3D12PipelineLibrary imlpementation to separate file.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-09-08 12:31:32 +02:00
Philip Rebohle
17cf1f69d7
vkd3d: Use global descriptor sets for static samplers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
d4f13b755f
vkd3d: Use new global sampler state for static samplers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle
a056922293
vkd3d: Create separate descriptor set layout for host-only pools.
...
D3D12 allows much larger pools to be created for heaps that are not
shader-visible, which some games make use of. Fixes crashes on Nvidia.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle
3364758746
vkd3d: Remove volatile packed descriptor handling.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle
c580866648
vkd3d: Remove packed descriptor set from root signature.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle
2cd23f5305
vkd3d: Require bindless samplers and SRV/UAV/CBV.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle
d0f64cfbb7
vkd3d: Always use bindless UAV counters if UAVs are bindless.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
3766e7e994
vkd3d: Rename BINDLESS_UAV_COUNTERS -> RAW_VA_UAV_COUNTERS.
...
For clarity, since we'll be moving to full bindless anyway.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
949e38e0b3
vkd3d: Add binding for uav counter views.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
40764d82ef
vkd3d-shader: Introduce VKD3D_SHADER_BINDING_FLAG_RAW_VA.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Hans-Kristian Arntzen
0f91099dd4
vkd3d: Refactor dynamic state to be per-pipeline.
...
Cleans up dynamic state such that we do not have to keep dynamic state
create infos around.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
69fdd87aa0
vkd3d: Add more debug logging when we fall back.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
d8ba75e160
vkd3d: Use strip type by default when using primitive restart.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
e9dcdc1308
vkd3d: Move vkd3d_pipeline_key to private header.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
5968d28e75
vkd3d: Refactor out dynamic stride checks to its own function.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
10d6823e34
vkd3d: Do not attempt to create a pipeline with invalid DS format.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
2e57b3d27e
vkd3d: Do not attempt to create pipelines with unknown topology type.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen
6967576904
vkd3d: Statically deduce patch vertex count for HS.
...
Fall back when there is a mismatch, which can happen if application does
not declare inputs to hull shader (unlikely).
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00