Commit Graph

3655 Commits

Author SHA1 Message Date
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
Hans-Kristian Arntzen 3c350ec0f5 dxil-spirv: Update submodule.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 20:42:32 +02:00
David McCloskey a2a7d78c27 vkd3d: Fixing CopyTextureRegion going out of bounds when src_box is null.
Signed-off-by: David McCloskey <davmcclo@gmail.com>
2021-07-29 17:28:52 +02:00
David McCloskey 155195ef99 tests: Adding test for crash caused by CopyTextureRegion with null source box from larger texture to smaller.
Signed-off-by: David McCloskey <davmcclo@gmail.com>
2021-07-29 17:28:52 +02:00
Hans-Kristian Arntzen 3f3162ab5f tests: Add test for fence signal with NULL event.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 17:21:20 +02:00
Hans-Kristian Arntzen e1bb5f3b77 vkd3d: Handle NULL event handles in ID3D12Fence::SetEvent*().
We need to block here for whatever reason.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 17:21:20 +02:00
Hans-Kristian Arntzen 455f00fe26 vkd3d: Log failures when signaling external events.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 17:21:20 +02:00
Hans-Kristian Arntzen 88978ab059 tests: Add SM 6.5 wave intrinsics test.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 16:58:07 +02:00
Hans-Kristian Arntzen a7e77fa777 tests: Add test for SM 6.4 packed arithmetic instructions.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 4d97efc9d4 tests: Add test for SM 6.2 FP32 denorm attribute.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 435a087047 vkd3d: Rework how shader model versions are exposed.
From native testing, we can expose higher shader models if
cap bits features are not supported. E.g. Polaris exposes SM 6.5, even
when 16-bit and barycentrics are not supported.

With latest dxil-spirv updates we can support the required SM 6.4
features.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 760e8e1565 tests: Add tests for FP16 and how features are handled.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 5b013d0b02 vkd3d: Validate shader meta against features.
We're supposed to validate and fail compilation if certain features are
not supported.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 5df4a5c083 vkd3d-shader: Add 16-bit feature usage to meta.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen ab9e99cbfa vkd3d: Check for Int16 capability as well as extended subgroup types when exposing 16-bit ops.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 27e0ca9bc1 dxil-spirv: Update submodule.
Add support for SM 6.2 denorm, SM 6.4 packed arith intrinsics.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 14:53:11 +02:00