Commit Graph

2206 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen 89cefd87d5 vkd3d: Add test for bindless UAV counters.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-25 14:42:32 +01:00
Hans-Kristian Arntzen 2d83388313 vkd3d: Add test for bindless UAV.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-25 14:42:32 +01:00
Hans-Kristian Arntzen 7c479f6dae vkd3d: Disable index_buffer_strip_cut spam in normal runtime.
Demote this warning to TRACE only.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-25 12:54:44 +01:00
Hans-Kristian Arntzen 4939e38c14 vkd3d: Clamp RTV/DSV array sizes to their real array lengths.
Avoids overflowing vkCreateFramebuffer later with UINT_MAX layers.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-25 11:27:14 +01:00
Hans-Kristian Arntzen f7ea9967d0 vkd3d: Use minimum width/height/layer framebuffer.
All attachments must be at least as large as the framebuffer, using a
max operator is not compliant with Vulkan.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-25 11:17:01 +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
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
Hans-Kristian Arntzen e21d077a04 vkd3d: Workaround CBV bindless test.
DXC is bugged and does not emit the NonUniformResourceIndex qualifier
in DXIL, and thus we expect this test to fail on AMD (it works just fine
on NV though). Only check the first lane of the workgroup for
correctness.

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
Hans-Kristian Arntzen a6b61fbc1d vkd3d: Add bindless CBV test for DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-12 12:01:23 +01:00
Hans-Kristian Arntzen 8fff9c3028 vkd3d: Add bindless samplers test for DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-12 12:01:23 +01:00
Hans-Kristian Arntzen 9ebb14727d vkd3d: Add bindless SRV test for DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-12 12:01:23 +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 912840351f vkd3d: Add test for bindless CBV.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-12 11:11:25 +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