Commit Graph

3330 Commits

Author SHA1 Message Date
Philip Rebohle 2ef8106136 vkd3d: Optimize sparse binding for buffers and full subresources.
Compacts ranges and only issues one bind for buffer ranges and
full subresource updates, rather than one bind per tile.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-10 13:18:44 +01:00
Philip Rebohle ead9f2d620 vkd3d: Store subresource index in d3d12_sparse_image_region.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-10 13:18:44 +01:00
Hans-Kristian Arntzen ff78b2df1c vkd3d: Dump DXIL when parsing entry points as well.
Parse can fail, and it's is useful to debug that.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 13:08:25 +01:00
Hans-Kristian Arntzen 73d55ec65a dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 13:08:25 +01:00
Hans-Kristian Arntzen cd876284e0 vkd3d: Fix some const warnings on MSVC.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 10:48:01 +00:00
Hans-Kristian Arntzen ce62d3d700 vkd3d: Fix MSVC build errors.
args... is a GNU extension.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 10:48:01 +00:00
Hans-Kristian Arntzen 369f48e499 tests: Add test for RTAS update.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:22 +01:00
Hans-Kristian Arntzen 0bf3a1d441 vkd3d-shader: Recognize recent descriptor range flag.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen 56e7cbec80 test: Test CBV table hoisting.
Adds some spicy edge cases with array size of 1 w/ nonuniform access, etc.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen 13d132f1c4 vkd3d: Add support for hoisting CBV descriptors to push descriptors.
Bindless CBV is *pretty* bad on NVIDIA, so add a code path which can
promote descriptor table CBVs into push descriptors.

We can safely do this with Root Signature 1.1 STATIC or
the somewhat obscure STATIC_KEEPING_BUFFER_BOUNDS_CHECKS.

With VOLATILE, which basically all titles are using,
we can still force this behavior through a config flag,
but this is an incorrect speed hack. It works in most
titles however, since bindless CBV is exceptionally rare.

We only hoist descriptors when the root signature range has 1 descriptor
anyway, so we should avoid any reasonable bindless scenario.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen d758a6e296 vkd3d: Convert Root Signatures to 1.1.
We will be able make use of the use STATIC vs VOLATILE flags.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen c409d0f30a vkd3d: Optimize R32UI texel buffer creation.
There is no need to scan through the Vulkan format list,
especially since texel buffer creation happens in the hot path
in cases where we know we need to create R32UI texel buffer views.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen 3e876c2857 vkd3d: Log VKD3D_CONFIG with INFO.
Useful to make sure we actually passed it correctly ...

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-10 11:46:05 +01:00
Hans-Kristian Arntzen c351dfc8d3 vkd3d: Remove dead code from d3d12_command_list.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-05 15:49:28 +01:00
Joshua Ashton ce9ae01c79 build: Warn about VLA usage
Using consts for array sizes is a C++-ism, and in GCC in C-mode it won't fold literal constants, and will instead prefer to make a VLA.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-04 15:50:28 +00:00
Hans-Kristian Arntzen 38bb845800 tests: Refactor raytracing test to be a bit more extensible.
Fixes a lot of the worst hardcoding, test different IBO / VBO formats.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Hans-Kristian Arntzen f2c5a6561c tests: Test RTAS clone and compact.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Hans-Kristian Arntzen b34af6a7fa vkd3d: Convert RT vertex format correctly.
Context sensitive formats, oh boy!

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Hans-Kristian Arntzen 686a3efc08 vkd3d: Verify VBO RTAS support when checking RT tier.
Format conventions for RT are ... special.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Hans-Kristian Arntzen b5d433baaa vkd3d: Implement RTAS clone and compact copy operations.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-04 16:30:29 +01:00
Philip Rebohle 39513d6503 vkd3d: Silence log spam around Min LOD Clamp.
This seriously hurts performance in AC:Valhalla.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-04 13:37:05 +01:00
Philip Rebohle 5e94183975 vkd3d-shader: Do not insert branch to loop header if outside of block.
Fixes invalid SPIR-V in case there is an unconditional break right
before the loop ends.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-04 13:36:31 +01:00
Philip Rebohle ba8e306452 vkd3d-shader: Ignore break instructions if there is no active block.
This can happen if a continue statement is immediately followed
by a break instruction in a switch case.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-03-04 13:36:31 +01:00
Joshua Ashton 96888b0663 build: Use --file-alignment=4096 with MinGW
Avoids a copy in the Wine loader as well as enables debug symbols to work in perf.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-03 19:22:44 +01:00
Joshua Ashton 47606f4339 build: Rename vkd3d_msvc and vkd3d_clang
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-03 19:22:44 +01:00
Hans-Kristian Arntzen 031ad9e139 vkd3d: Track dynamic pipeline stack size
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen 600a296ca7 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen 9588ec082e vkd3d: Fix warnings when AS is used without support.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen fcd00f0559 vkd3d: Implement DispatchRays.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen b162e5ec72 vkd3d: Refactor descriptor updates.
We might have to emit to different bind point than our binding entry
suggests due to DXR, so pass down information explicitly to leaf
functions.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen eeaca4a500 vkd3d: Pass down raygen pipeline layout to command list.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen 0b161f5693 vkd3d: Implement SetPipelineState1.
Refactor push constant invalidation to SetPipelineState,
it is technically more correct to only invalidate when actually pushing
constants, but we need to do full state invalidation when transitioning
between RT pipelines and non-RT pipelines due to bind point aliasing
shenanigans in D3D12, so it makes more sense to invalidate state based
on active bind point there.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen 77089065cd vkd3d: Compute default pipeline stack size.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen 9ffa3bf351 vkd3d: Support CreateSRV with RTAS.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Hans-Kristian Arntzen 9ff7b82235 vkd3d: Rename VKD3D_DESCRIPTOR_FLAG_UAV_COUNTER to RAW_VA_BUFFER.
We're going to place acceleration structures here.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-03-03 19:19:47 +01:00
Joshua Ashton 3224688295 vkd3d: Enable VK_EXT_debug_utils conditionally
Enabling VK_EXT_debug_utils comes at some overhead in Wine due to the object tracking required. There is also likely a non-zero overhead in some native implementations also.

By enabling this conditionally, we can also avoid additional overhead from apps that set debug labels on both the Vulkan and front-end side.

The default condition is to enable it when building with Renderdoc integration or in debug builds.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton 91fc472601 vkd3d: Add mechanism for conditional extensions
Add a way to enable an extension via config flags.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton 4c6f5375a6 vkd3d: Refactor config_flags to be global rather than instance state
Makes it so we can access it in code where we have no concept of a device/instance.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton 64a6bae1a0 vkd3d: Remove vkd3d_application_info structure
This thing has no right to exist.

We don't get this information in D3D12 and it's getting in the way of me refactoring config flags.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton 78b5b347b8 build: Disable TRACE calls in release builds
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton 4da76cb51b vkd3d: Simplify properties/features tracing
Simplifies this to make it easier to add new properties/features
so we don't have a bunch of pointers to things that are just a child
of the device info structure.

Fixes warnings when compiling without traces too.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton 615b2d714f build: Minor meson formatting change
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Georg Lehmann 7d518ea78f meta: Remove .gitlab-ci.
Github Actions replaced the frogs.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-02-27 13:57:53 +00:00
Hans-Kristian Arntzen 91fad86e4d tests: Test that root parameters are correctly invalidated.
When emitting push constants for graphics, these should invalidate push
constants for compute and vice versa. In Vulkan, vkCmdPushConstants is
not tied to a bind point.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-26 17:06:18 +01:00
Hans-Kristian Arntzen 89fbe334df vkd3d: Redirect push constants to their bind point stages.
Gives a massive boost on NVIDIA for some reason.
RADV defers push constant update, so ALL_STAGES doesn't have
that much of a perf hit.

~20% uplift in RE2, ~5% uplift in CP77 from some quick and dirty testing.
Seems to be heavily content dependent either way.

Also a bug fix, since we would clobber graphics push constants from
compute and vice versa if both graphics and compute used the same root
signature.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-26 17:06:18 +01:00
Hans-Kristian Arntzen 3839f5e17c vkd3d: Ignore known useless validation warnings.
These only clutter up validation in testing.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-02-26 15:04:11 +01:00
Joshua Ashton 29b410928b tests: Add a suite of tests for SetName
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-25 21:51:43 +01:00
Joshua Ashton 8c9527cdf7 vkd3d: Refactor SetName implementation
As per MSDN, SetName is just a wrapper around SetPrivateData and a specific GUID.

Some apps and tools will use this to retrieve their name back.

So instead, just forward the name to Vulkan in the SetPrivateData call.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-25 21:51:43 +01:00
Joshua Ashton 04b86b80b6 include: Define WKPID_D3DDebugObjectName and friends
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-25 21:51:43 +01:00
Joshua Ashton a76daad03f vkd3d-common: Add vkd3d_strdup_n
There is no strndup on Windows.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-25 21:51:43 +01:00