178 Commits

Author SHA1 Message Date
Shaun Ren
9fab6e4383 tests/shader_runner_gl: Add "opengl" tag. 2025-01-20 15:23:09 +01:00
Henri Verbeet
b60995b106 tests/shader_runner: Do not use skip() for shader model requirements.
Like we did before commit 067e6deee4aba447c6627ce02b58c6bdcd90470e.
These skips aren't all that interesting; it's entirely intentional that
e.g. a 2.0-3.0 run wouldn't run 4.0 shaders.
2024-12-19 21:17:05 +01:00
Anna (navi) Figueiredo Gomes
d5ed4df254 tests/shader_runner: Add a "mesa<23.3" tag. 2024-12-19 20:34:55 +01:00
Henri Verbeet
31ea11fb0e tests/shader_runner: Ignore the "backcompat" option for shader model 5.1+. 2024-12-19 12:24:02 +01:00
Giovanni Mascellani
ed552e4519 tests/hlsl: Add tests for the EvaluateAttribute*() intrinsics.
Based on earlier tests by Conor McCarthy.
2024-12-18 17:27:31 +01:00
Elizabeth Figura
8fcbbfb8b1 tests/shader_runner: Test versions where the compilation result changes.
Adjust the algorithm for deciding for which profiles to test compilation.

We first ensure that if the compilation result changes (most often as the result
of a feature introduced in a specific version), we test the versions immediately
on either side of the change, to validate that vkd3d-shader is emulating the
same version behaviour.

We then ensure that we are testing at least one version from each set of sm1,
sm4, and sm6.
2024-12-17 16:35:09 +01:00
Elizabeth Figura
067e6deee4 tests/shader_runner: Test HLSL compilation in a separate pass.
Mainly in order to not waste time compile-testing the same version
more than once [as we do with e.g. the d3d11 and d3d12 runners, or
d3d12, GL, and Vulkan].
2024-12-17 16:24:00 +01:00
Elizabeth Figura
e91c07e1de tests/shader_runner: Record HLSL todo/fail state for each shader model.
When a shader fails to compile for a range of versions, we want to validate that
we are correctly implementing that behaviour. E.g. if a feature requires shader
model 5.0, we should validate that it compiles correctly with 5.0 (which we do),
but also that it *fails* to compile with 4.1 (which we do not).

The obvious and simple solution is to simply run compile tests for each version.
There are, however, at least 12 versions of HLSL up to and including 6.0, at
least 10 of which are known to introduce new features. Shader compilation takes
about 10-15% of the time that draw and dispatch does, both for native and
(currently) vkd3d. Testing every version for every shader would add a
noticeable amount of time to the tests.

In practice, the interesting versions to test for most shaders are:

* At least one from each range 1-3, 4-5, and 6. It's common enough for the
  semantics of the HLSL to differ between bytecode formats, or for features to
  be added or removed across those boundaries.

* If the shader requires a given feature, we want to test both sides of the cusp
  to ensure we're requiring the same version for the feature.

In practice this is 3 or 4 versions, which is measurably less than the 12 we'd
otherwise be running.

In order to achieve this goal of testing only the 3 or 4 interesting versions
for a shader, we need to know what version is actually required for a feature.
This is encoded in the shader itself using e.g. [pixel shader fail(sm<5)].

This patch therefore implements the first step towards this goal, namely,
determining which versions succeed and fail, so we can figure out which ones are
interesting.

We could require the test writer to specify which versions are interesting ahead
of time (e.g. "for version in 2.0 4.1 5.0 6.0") but this is both redundant (and
there are a *lot* of tests that need some feature gate) and easy for a test
writer to get wrong by missing interesting versions.
2024-12-17 16:18:21 +01:00
Elizabeth Figura
5827197246 tests/shader_runner: Don't bother distinguishing directive substrings.
Consider ']' a terminator for any string.
2024-12-12 17:28:45 +01:00
Elizabeth Figura
830bdd0037 tests/shader_runner: Use a separate variable for shader type. 2024-12-12 17:26:49 +01:00
Elizabeth Figura
edb36c078f tests/shader_runner: Use is_todo instead of separate shader states. 2024-12-12 17:26:37 +01:00
Conor McCarthy
50306a8b08 tests/hlsl: Add uint64 wave op tests. 2024-12-09 14:20:28 +01:00
Conor McCarthy
f0f8bb3f36 tests/hlsl: Add float64 wave op tests. 2024-12-09 14:17:05 +01:00
Giovanni Mascellani
73be28a252 tests: Use plain skip() when skipping a test in the shader runner.
The context already gives the location in the .shader_test file.
2024-12-03 12:38:26 +01:00
Elizabeth Figura
d56601c8d0 vkd3d-shader/ir: Implement exponential fog. 2024-12-02 17:12:20 +01:00
Elizabeth Figura
1fbbc82f3a vkd3d-shader/ir: Allow controlling the fog source through a parameter. 2024-12-02 17:12:16 +01:00
Elizabeth Figura
f86d1e72a4 vkd3d-shader/ir: Allow controlling fog through parameters.
Fog requires several parameters to even implement the most basic of
functionality correctly, so this commit is relatively large.
2024-12-02 17:12:06 +01:00
Henri Verbeet
92fa68cb07 tests/shader_runner: Slightly simplify dxc handling. 2024-11-13 16:18:36 +01:00
Giovanni Mascellani
7450c4a368 tests: Mark some tests in wave-reconvergence.shader_test as buggy on MoltenVK. 2024-11-06 22:15:09 +01:00
Feifan He
b0646cb427 tests/shader_runner: Introduce a Metal shader runner. 2024-10-31 16:47:26 +01:00
Henri Verbeet
da75582a14 tests/shader_runner: Check whether copy/dispatch/draw succeeded in parse_test_directive(). 2024-10-31 16:46:59 +01:00
Henri Verbeet
b5f1979475 tests/shader_runner: Print "(none)" for an empty caps list in trace_shader_caps().
Like we do in trace_format_cap().
2024-10-31 16:46:59 +01:00
Henri Verbeet
aeae8322da tests: Add a test for actual multisample loads.
The existing test loads from a single sample texture.
2024-10-28 17:58:05 +01:00
Elizabeth Figura
b3eee0a323 tests/shader_runner: Centralize the compile_hlsl() helper in shader_runner.c. 2024-10-28 17:23:10 +01:00
Elizabeth Figura
591ae5e18e tests/shader_runner: Store the dxc_compiler in the shader_runner. 2024-10-28 17:23:10 +01:00
Elizabeth Figura
b492ebc374 tests/shader_runner: Store shader sources as an array. 2024-10-28 17:23:06 +01:00
Elizabeth Figura
d39e840c14 tests/shader_runner: Store shader caps using an array. 2024-10-28 16:20:27 +01:00
Henri Verbeet
d48f7409fe tests/shader_runner: Print the test context in fatal_error().
In particular, this gets us line numbers.
2024-10-24 20:53:45 +02:00
Giovanni Mascellani
8d8e0fd55a tests: Test mismatching RTV and pixel shader output types. 2024-10-22 20:38:18 +02:00
Giovanni Mascellani
dff7c0e7b8 tests: Mark interface packing pipeline creation as todo on MoltenVK.
Most Vulkan drivers are happy to compile a pipeline with interstage
interface mismatches, even if the pipeline will be broken. Metal,
and therefore MoltenVK, instead doesn't and errors out immediately.
2024-10-22 20:32:51 +02:00
Giovanni Mascellani
bc830fa06b tests: Compute the correct value for condition conjunctions.
Currently the value of the last conjunct is returned.
2024-10-22 20:29:25 +02:00
Elizabeth Figura
6fd1a1ce7e tests: Test point sprite. 2024-10-22 19:14:05 +02:00
Giovanni Mascellani
bc351f4b70 tests/shader-runner: Make geometry shaders optional.
This allows the Vulkan runner to execute in environments which do
not support geometry shaders, most notably MoltenVK. In particular,
that enables SM<4 shaders to run in such environments
2024-10-15 16:55:15 +02:00
Elizabeth Figura
cd249a47b8 tests: Test FFP point size clamping. 2024-10-10 22:44:33 +02:00
Elizabeth Figura
ec53e325b6 tests: Test FFP point size. 2024-10-10 22:30:35 +02:00
Henri Verbeet
3ddf46649b tests/shader_runner: Trace the "clip-planes" cap. 2024-10-10 22:28:26 +02:00
Conor McCarthy
d76435cd21 tests: Move the dxc compilation helpers to utils.h. 2024-10-08 20:34:03 +02:00
Giovanni Mascellani
fbd8b1a8c4 tests/shader-runner: Print the WARP driver version.
Since recent versions seem to have more features and possibly
fewer bugs it is useful to know what you're dealing with.

Currently the latest WARP drivers are distributed here:

  https://www.nuget.org/packages/Microsoft.Direct3D.WARP
2024-10-07 17:33:50 +02:00
Elizabeth Figura
3b1760134f tests: Test clip planes. 2024-10-02 21:49:54 +02:00
Anna (navi) Figueiredo Gomes
e761b2cad1 tests/shader_runner: Introduce a "d3d12" tag. 2024-09-11 14:53:33 +02:00
Anna (navi) Figueiredo Gomes
3eb2a3d0e4 tests/shader_runner: Introduce a 'depth-bounds' test option. 2024-09-11 14:53:21 +02:00
Francisco Casas
b701f8d393 tests/shader_runner: Explicitly require UAV load support.
The used UAV formats are explicitly added in the [require] section of
every test that uses them.

Some of these tests were failing on Intel UHD graphics 770 because of
missing support for additional UAV load types, explicitly requiring
these formats allows these tests to be skipped.
2024-08-22 16:22:18 +02:00
Francisco Casas
fb153bf5d4 tests/shader_runner: Don't skip shader compilation on missing caps.
Currently we are skipping compilation tests ([* shader] blocks) on
missing capabilities. This is not really necessary and it is useful to
test shader compilation even on machines that can't run these tests.

So, this commit moves the checks to the [test] blocks, skipping them
entirely when caps are not met.

To make the effects of enum test_action values more explicit, these
are renamed to TEST_ACTION_SKIP_COMPILATION and
TEST_ACTION_SKIP_EXECUTION.
2024-08-22 16:01:37 +02:00
Francisco Casas
19c23ca6f2 tests/shader_runner: Replace spaces with dashes in format names.
Probably good if we want to allow specifying several formats in the same
line, separated by spaces.

While at it, rename "r32g32 int" to "r32g32-sint".
2024-08-22 16:01:37 +02:00
Francisco Casas
cec62c54ad tests/shader_runner: Move parse_format() up. 2024-08-22 16:01:32 +02:00
Francisco Casas
164076d176 tests/shader_runner: Require explicit formats for UAV resources.
The current default is r32g32b32a32 but it requires special support
which is not available on all GPUs, so it is not a very convenient
default.

Instead of changing the default making it different from RTV resoures,
the format is required to always be explicit for UAVs.

The exceptions are counter_buffer and buffers with "stride", which don't
require a format because it is already implied.
2024-08-22 16:01:26 +02:00
Francisco Casas
9dec7403d9 tests/shader-runner: Add missing trace for wave_ops caps. 2024-08-07 15:54:36 +02:00
Francisco Casas
2efc79bb81 tests: Report tests skipped because of missing capabilities. 2024-08-07 15:54:36 +02:00
Elizabeth Figura
947b937a1a tests: Test shade mode. 2024-07-24 16:08:10 +02:00
Elizabeth Figura
5a53b73995 tests: Test alpha test. 2024-07-11 17:02:53 +02:00