Philip Rebohle
b85852e733
vkd3d: Fix barriers for bindless CBV-as-SSBO.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-23 16:20:38 +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
e7360fbd46
vkd3d: Fix build.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 14:39:58 +01:00
Philip Rebohle
d4d299d765
vkd3d: Initialize feature options in d3d12_device_caps_init.
...
Also reworks the check for resource binding tiers.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle
1e78cd3397
vkd3d: Determine maximium feature level in d3d12_device_caps_init.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle
bf8863568c
vkd3d: Introduce d3d12_device_caps_init.
...
This method is meant to process d3d12 device caps after the
device itself has been fully initialized. This helps avoid
code duplication in certain instances and guarantees that we
know about all enabled Vulkan features.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle
f3e8c156c2
vkd3d: Move minimum feature level check to d3d12_device_create.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle
19b971de0a
vkd3d: Introduce d3d12_caps.
...
Meant to bundle all d3d12 feature caps and options, of which
we're going to have to add more over time.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Hans-Kristian Arntzen
e85cc6288e
vkd3d: Declare inline header function as static.
...
Fixes some linking issues on my end with undeclared external symbols.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 15:39:04 +01:00
Hans-Kristian Arntzen
b7c14698b4
vkd3d-shader: Add CBV_AS_STORAGE_BUFFER support to DXIL.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 15:39:04 +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
8618bc1d5b
vkd3d: Enable storage buffer usage alongside uniform buffer usage.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Philip Rebohle
ef80658ffb
vkd3d: Do not disable storage buffer indexing features.
...
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
Philip Rebohle
a9ba32a6c4
vkd3d-shader: Add option to declare bindless CBVs as SSBOs.
...
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
Hans-Kristian Arntzen
291db5581c
vkd3d: Fix push constant size check against D3D12_MAX_ROOT_COST.
...
MAX_ROOT_COST is in terms of number of u32s.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 14:29:03 +01:00
Philip Rebohle
5bf4b207f2
vkd3d-shader: Bound-check root constant reads.
...
Safety measure in case a broken app performs out-of-bounds reads.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 11:57:35 +01:00
Philip Rebohle
423bb09b46
vkd3d-shader: Unroll root constant buffers.
...
Fixes spec violations when we have root constant ranges not
aligned to 16 bytes.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 11:57:35 +01:00
Philip Rebohle
d129e477f6
vkd3d-shader: Load constant buffer components individually.
...
Enables us to unroll root constant buffers. Not loading unneeded
components early may also help some drivers generate better code.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 11:57:35 +01:00
Philip Rebohle
01098e194e
vkd3d-shader: Simplify vkd3d_dxbc_compiler_emit_mov.
...
Having a lot of special code here just makes it harder for
us to implement UBO-specific load path, not to mention that
the mov instruction itself is very rare.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 11:57:35 +01:00
Hans-Kristian Arntzen
ceee2096a5
vkd3d: Query subgroup properties and expose SM 6.0 if present.
...
Does not cover every case for SM 6.0, but it's a useful start.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 10:58:17 +01:00
Hans-Kristian Arntzen
b88f04bd21
vkd3d-shader: Add integration for DXIL shaders.
...
If we detect that a blob contains a DXIL chunk, use dxil-spirv to
compile the shader to SPIR-V if it is enabled in the build.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 10:58:17 +01:00
Philip Rebohle
c7af09c68c
vkd3d: Allocate descriptor pool space for inline uniform blocks.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 20:49:56 +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
ada3890211
vkd3d: Write inline uniform block 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
c658eda3df
vkd3d: Enable VK_EXT_inline_uniform_block if available.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +01:00
Philip Rebohle
02e98e3d5c
vkd3d-shader: Unroll descriptor table offsets.
...
Avoids having to use 16-byte array strides when using an
inline uniform block to store the table offsets.
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
Philip Rebohle
77bc640f3f
vkd3d-shader: Implement dynamic UBO indexing.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-12 11:32:41 +01:00
Philip Rebohle
6a7f1b95e5
vkd3d-shader: Add global UBO binding declarations.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-12 11:32:41 +01:00
Philip Rebohle
b11b95f34d
vkd3d-shader: Factor out bindless resource index computation.
...
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
708f26bf40
vkd3d: Only update packed descriptor set if necessary.
...
When changing tables that only have bindless descriptors,
only update the push constants instead.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-11 10:47:58 +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
2e18afc7cb
vkd3d: Introduce dirty flags for pipeline bindings.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-11 10:47:58 +01:00
Philip Rebohle
76f42069f4
vkd3d: Add comment about WoW requiring BINDING_TIER_3 support.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +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
8847a78f33
vkd3d: Store vkd3d_physical_device_info with d3d12_device.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle
2b45574fc2
vkd3d: Invalidate descriptor heap bindings if necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle
be20e9a9c1
vkd3d: Set descriptor table offsets via push constants.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle
af4c211f34
vkd3d: Bind descriptor sets for active descriptor heaps.
...
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