Commit Graph

3720 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen fa1d82e141 vkd3d: Fix regressions when introducing null-copy elision.
Need to initialize the set mask so that copies happen properly
on default-initialized descriptors. Also, move the current_null_type to
metadata so that it's properly copied on descriptor copy.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-03 12:24:26 +02:00
Rodrigo Locatti b4cb5a37f8 vkd3d: Optimize repeated null descriptor updates
There are titles clearing the same descriptors constantly.
This leads to unnecessary updates that can become costly.

This commit introduces a new flag to track when D3D12 descriptors are
not null, and skips clearing them if they are already null.
Descriptors are assumed to be null by default.

This fixes a performance regression introduced by
9983a1720f

Signed-off-by: Rodrigo Locatti <rlocatti@nvidia.com>
2021-09-02 21:21:34 +02:00
Philip Rebohle 7fea3527ed vkd3d: Remove deferred clears.
Emitting render pass clears while we're in the process of starting
a render pass overrides dsv layout tracking info.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-09-02 17:11:35 +02:00
Hans-Kristian Arntzen b05145b421 tests: Add test for depth testing against null DSV.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 17:10:47 +02:00
Hans-Kristian Arntzen ff74ad0ec5 vkd3d: Skip draw call if doing depth test on null DSV.
D3D12 validation layer errors out, so unless we can prove that specific
behavior is relied upon, we should be okay to just ignore.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 17:10:47 +02:00
Hans-Kristian Arntzen b54a1a6c2b vkd3d: Fix MSVC build.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 16:56:39 +02:00
Hans-Kristian Arntzen 00e4397467 vkd3d: Ignore depth/stencil test if DSVFormat does not have that aspect.
Fix some validation errors in F1 2021.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 16:25:27 +02:00
Hans-Kristian Arntzen 6f8ebaae7e tests: Add test for planar footprints.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen bc9bd9c482 vkd3d: Fix member types in vkd3d_format.
No need to use size_t.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen 7b67de7d0e vkd3d: Generalize get_plane_footprints.
Get information directly from vkd3d_format and allow for subsampled
formats in the future.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen 3d5010555e vkd3d: Add d3d12_resource_desc_get_sub_resource_count.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen 5c2376faf5 vkd3d: Handle multiplanar formats in GetCopyableFootprints.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen b8881ff693 vkd3d-common: Log TID in Wine's format.
Allows us to stay sane when correlating logs.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-01 15:41:59 +02:00
Hans-Kristian Arntzen d9bdd515a4 tests: Check for Native16Bit support before testing dot2add.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-30 23:06:26 +02:00
Hans-Kristian Arntzen 566cf1ed78 tests: Rename get_rt_lib() to something that allows for more libs.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen 9a92d62465 tests: Use RT factory for main RT PSO as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen fb8d8616b7 tests: Introduce a factory for building RTPSO subobject lists.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen 6aecbe2482 tests: Refactor out RT collection creation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen dda18f0fcd tests: Hoist out helper function to create a complete RTAS.
Have a single helper function to create RTASes with X * Y quads.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen c1f848ed3b vkd3d: Only look at SourceRTAS when updating.
Be more robust against garbage inputs.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen af2d41f6f8 tests: Use helper functions to build top-level acceleration structures.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen 17d5984c2c tests: Add helpers for creating and copying RTASes.
Move bottom RTAS building over to new helpers.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen 82db981b26 tests: Refactor out transform buffer creation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen 99d2e39dfa tests: Refactor out test geometry allocation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen 830b9ef4e3 tests: Refactor out RT DXIL library declaration.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
Hans-Kristian Arntzen d44d359a18 tests: Refactor out RT context creation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-28 12:16:42 +02:00
rochaudhari 0828aec4f6 vkd3d: Implement new interfaces required for DX12 DLSS support.
Adds ID3D12GraphicsCommandListExt and ID3D12DeviceExt interfaces.

Signed-off-by: Roshan Chaudhari <rochaudhari@nvidia.com>
2021-08-27 11:37:15 +02:00
Joshua Ashton e9f04e8e0e vkd3d: Support SAMPLE_DESC.Count of 0
Psychonauts 2 uses a SAMPLE_DESC.Count of 0 for some things, which
previously was forcing it down the MSAA alignment placement path.

Found from playing a native D3D12 apitrace back and seeing
the log spam.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-08-26 14:23:37 +02:00
Philip Rebohle 715eca1b95 vkd3d: Reimplement frame latency event as a semaphore.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-08-26 14:21:38 +02:00
Philip Rebohle fef30f5037 vkd3d: Support releasing semaphores from a D3D12 fence.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-08-26 14:21:38 +02:00
Joshua Ashton 68a035c605 vkd3d-shader: Fix vkd3d-compiler crash
Since we added validation here for FH4, this crashes now as vkd3d-compiler passes a NULL shader_interface_info.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-08-26 14:06:47 +02:00
Joshua Ashton 56e12d88ce vkd3d-shader: Fix multiple constant buffers with RAW_VA
Consider we have declarations of CB0 of size 36 and CB1 of size 153.
Previously we'd just return the struct of CB0 when accessing CB1 because it came first as we didn't consider the size.

Psychonauts 2 indexes into CB1 by constant values above 36.
There is no reason a compiler could not eliminate these reads as it is technically out of bounds for the underlying array type.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-08-26 14:05:52 +02:00
Hans-Kristian Arntzen 5ef3d4bff9 tests: Move test implementations to appropriate files.
Avoids crippling 50+ ksloc files which are impossible to navigate
efficiently. IDEs tend to give up on files these large and editors start
to chug hard.

This commit is essentially pure cut 'n paste, which is why it's all in
one large commit. There is little to no reason to attempt to split this
up into multiple smaller commits.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen c2473fb873 tests: Improve log quality.
Set test name equal to the test that is actually running, not a global
"d3d12" which isn't very useful for a case with multiple files since
line number alone isn't enough to know where to look.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen 1a7ea5e0a6 tests: Make tests extern.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen 195e1a3447 tests: Declare test prototypes in separate header.
Allows for moving test implementations to their own translation units.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen 4a6fba9f56 tests: Make some statics in headers extern.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen 9d5cf16fc3 tests: Move common test code to its own file.
Some ifdef jank required since the various headers declare the main function.
Some additional jank with INITGUID, otherwise we get multiple
declaration errors.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen f589462ab5 tests: Move math MATH defines to d3d12_crosstest.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen aaaac271bd tests: Make other entry points extern.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen 8c89dacf76 tests: Make common test functionality extern.
Prepares for a situation where tests can be spread across multiple
translation units.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-26 14:05:23 +02:00
Hans-Kristian Arntzen 7ff3ef2654 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-24 12:52:56 +02:00
Hans-Kristian Arntzen f3fd2bf70b vkd3d: Use BAR memory type for descriptor heap helpers.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-23 13:24:43 +02:00
Hans-Kristian Arntzen 7e165238e6 vkd3d: Allow all memory types if UPLOAD_HVV is used.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-23 13:24:43 +02:00
Joshua Ashton 1b957a1f74 vkd3d: Add config to use host-visible vram for UPLOAD heap
Adds the "upload_hvv" config flag, which will make D3D12_HEAP_TYPE_UPLOAD attempt to use host-visible VRAM for allocations.

This takes advantage of large or resizable BAR if available.

I see a perf delta of 83-84 -> 92-94 (~12%) when using this in Horizon Zero Dawn.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-08-23 13:24:43 +02:00
Hans-Kristian Arntzen 05e31bfba9 vkd3d: Ensure we do not fallback device allocations to BAR.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-08-23 13:24:43 +02:00
Robin Kertels 76f37c3cbf vkd3d: Only disable raster based on SO stream if SO is used.
Signed-off-by: Robin Kertels <robin.kertels@gmail.com>
2021-08-23 13:10:14 +02:00
Hans-Kristian Arntzen b2c99b035a vkd3d: Allow SM 6.2 on NV.
FloatControlProperties struct appears to be broken, and it does seem to
work just fine.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-30 15:19:35 +00:00
Hans-Kristian Arntzen 41d54e19f4 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-30 13:03:48 +02:00
Hans-Kristian Arntzen 093a8c49f3 vkd3d: Expose shader model 6.5.
WaveMatch and WaveMultiPrefix are implemented and pass test.
Other features are gated behind feature bits.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 20:42:32 +02:00