Commit Graph

1343 Commits

Author SHA1 Message Date
Giovanni Mascellani
d304422a34 tests: Mark count buffers as buggy on MoltenVK.
They require Vulkan indirect draw count extension.
2024-01-24 22:38:28 +01:00
Giovanni Mascellani
5d4edba925 tests: Mark a timestamp query test as buggy on MoltenVK.
The generated Vulkan calls look right and do not trigger any
validation error, but the returned timestamp is 0. A valid
timestamp is returned if the CopyResource() call is commented,
or the second EndQuery() call is moved before CopyResource(),
or the first EndQuery() call is commented. I am not seeing any
sensible pattern here, so I guess there is just a bug in
MoltenVK.
2024-01-24 22:38:26 +01:00
Giovanni Mascellani
66cd2af188 tests: Mark clip distance as unsupported on MoltenVK.
At least for tessellation and geometry shaders.
2024-01-24 22:38:23 +01:00
Giovanni Mascellani
9a83e568b4 tests: Mark cull distance as buggy on MoltenVK.
The generated MSL code is not accepted by the Metal runtime, and
it looks wrong anyway.
2024-01-24 22:38:19 +01:00
Giovanni Mascellani
60e0246436 tests: Skip unbounded descriptor ranges tests when they're unsupported.
They are unsupported if the Vulkan descriptor indexing extension
is not available; on MoltenVK it is known to be buggy, so it is
disabled.
2024-01-24 22:38:18 +01:00
Giovanni Mascellani
711ce4e65d tests: Mark loading from stencil as buggy on MoltenVK.
Specifically, MoltenVK seems to be able to load from stencil, but
the specific replicating swizzle (repeating the stencil value on
all the channels) is not honored. The stencil value is read only
on the red channel.
2024-01-24 22:38:15 +01:00
Conor McCarthy
e973271a40 vkd3d-shader/spirv: Handle the ISINF and ISNAN instructions in spirv_compiler_emit_alu_instruction(). 2024-01-24 22:38:04 +01:00
Conor McCarthy
cd674d593e vkd3d-shader/spirv: Implement the ISFINITE instruction. 2024-01-24 22:38:03 +01:00
Conor McCarthy
35d46cf3d9 tests/shader-runner: Add tests for floating point special values. 2024-01-24 22:38:00 +01:00
Zebediah Figura
0f46e7bbad tests: Test signature reflection via D3DReflect().
Ported from Wine.
2024-01-24 22:37:53 +01:00
Zebediah Figura
d1be80e08d tests: Test VKD3D_SHADER_COMPILE_OPTION_BACKCOMPAT_MAP_SEMANTIC_NAMES. 2024-01-24 22:37:53 +01:00
Francisco Casas
1c73513425 tests: Use the vulkan runner to run SM1 compilation tests.
At the current moment this is a little odd because for SM1 [test]
directives are skipped, and the [shader] directives are not executed by
the shader_runner_vulkan.c:compile_shader() but by the general
shader_runner.c:compile_shader(). So in principle it is a little weird
that we go through the vulkan runner.

But fret not, because in the future we plan to make the parser agnostic
to the language of the tests, so we will get rid of the general
shader_runner.c:compile_shader() function and instead call a
runner->compile_shader() function, defined for each runner. Granted,
most of these may call a generic implementation that uses native
compiler in Windows, and vkd3d-shader on Linux, but it would be more
conceptually correct.
2024-01-24 22:37:44 +01:00
Francisco Casas
671f4ec2b2 tests/shader-runner: Call each runner only once.
If the runners require multiple calls to run_shader_tests() for
different shader model ranges, these are moved inside the sole runner
call.

For the same reason, the trace() messages are also moved inside the
runner calls.
2024-01-24 22:37:34 +01:00
Francisco Casas
79de3ec766 tests/shader-runner: Support reading multiple model range args for qualifiers.
We can now pass (sm<4) and (sm>=4) to "fail" and "todo" qualifiers, and
we can use multiple of these qualifier arguments using "&" for AND and
"|" for OR.

examples:
todo(sm>=4 & sm<6)
todo(sm<4 | sm>6)

parenthesis are not supported.

Adding additional model ranges for the tests, if we need them, should be
easier now, since they only have to be added to the "valid_args" array.
2024-01-24 22:37:30 +01:00
Zebediah Figura
57c4a13024 tests: Add tests for valid conditional types. 2024-01-23 20:26:47 +01:00
Conor McCarthy
b3903636f7 vkd3d-shader/dxil: Implement DX intrinsic Binary. 2024-01-23 20:26:29 +01:00
Nikolay Sivov
2c1905b780 vkd3d-shader/hlsl: Allow annotations on techniques.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-23 20:26:19 +01:00
Nikolay Sivov
341963bbec tests/hlsl: Add some tests for annotations. 2024-01-23 20:26:14 +01:00
Giovanni Mascellani
72e2eeaf14 tests: Add a test for SV_ViewportArrayIndex. 2024-01-22 22:19:16 +01:00
Giovanni Mascellani
bd84b96e9f tests: Use test utils to create the pipeline state in test_ps_layer(). 2024-01-22 22:19:16 +01:00
Giovanni Mascellani
245cce02bd tests: Test using SV_RenderTargetArrayIndex in the vertex shader. 2024-01-22 22:19:16 +01:00
Giovanni Mascellani
5ddf745d95 tests: Compile HLSL shaders at runtime in test_ps_layer(). 2024-01-22 22:19:15 +01:00
Conor McCarthy
55c7cd5c22 vkd3d-shader/dxil: Handle semantic kind ISFRONTFACE. 2024-01-22 22:18:33 +01:00
Conor McCarthy
9f409b67d7 vkd3d-shader/dxil: Handle semantic kind VERTEXID. 2024-01-22 22:18:32 +01:00
Conor McCarthy
ca7487a56d vkd3d-shader/spirv: Handle UINT32_MAX result from FIRSTBIT_HI and FIRSTBIT_SHI instructions. 2024-01-22 22:18:27 +01:00
Conor McCarthy
62e15dac8d tests/d3d12: Add a raw firstbit test to test_shader_instructions(). 2024-01-22 22:18:25 +01:00
Zebediah Figura
9ad48f16ea vkd3d-shader/hlsl: Forbid mismatched argument types in ternaries. 2024-01-18 23:15:44 +01:00
Zebediah Figura
275901557c vkd3d-shader/hlsl: Handle scalar values in ternaries. 2024-01-18 23:15:43 +01:00
Zebediah Figura
11112798c8 vkd3d-shader/hlsl: Handle scalar conditions in ternaries. 2024-01-18 23:15:42 +01:00
Zebediah Figura
2c8751478f vkd3d-shader/hlsl: Forbid objects in ternary conditions. 2024-01-18 23:15:41 +01:00
Giovanni Mascellani
93100edb4b tests: Test a couple of degenerate switch instances. 2024-01-18 23:15:35 +01:00
Giovanni Mascellani
6cb7487fb0 tests: Add a test with non-trivial control flow. 2024-01-18 23:15:35 +01:00
Conor McCarthy
83851133c5 vkd3d-shader/ir: Set merged signature element interpolation mode only from used elements. 2024-01-18 23:15:27 +01:00
Conor McCarthy
759362b527 tests: Test an interpolated PS input where component x is unused.
FXC does not emit an interpolation mode for unused elements.
2024-01-18 23:15:26 +01:00
Conor McCarthy
4c30b23821 vkd3d-shader: Make the control point count the outer dimension of I/O arrays.
The relative-addressed case in shader_register_normalise_arrayed_addressing()
leaves the control point id in idx[0], while for constant register
indices it is placed in idx[1]. The latter case could be fixed instead,
but placing the control point count in the outer dimension is more
logical.
2024-01-17 22:28:59 +01:00
Conor McCarthy
b8561d6fd2 tests: Test punned array access in patch constant functions.
The FXC optimiser sometimes converts a local array of input values into
direct array addressing of the inputs, which can result in a
dcl_indexrange instruction spanning input elements with different masks.
2024-01-17 22:28:58 +01:00
Zebediah Figura
16962ac6f1 vkd3d-shader/hlsl: Allow non-numeric types in the ternary operator. 2024-01-17 22:28:51 +01:00
Zebediah Figura
9ac210eb1e tests: Add many more tests for ternary expressions. 2024-01-17 22:28:50 +01:00
Nikolay Sivov
e7d65d39ba vkd3d-shader/fx: Initial support for fx_5_0 output. 2024-01-15 19:57:42 +01:00
Francisco Casas
43ff28b00b vkd3d-shader/hlsl: Emit fixmes on non-constant vector addressing.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56162

Storing to a vector component using a non-constant index is not allowed
on profiles lower than 6.0. Unless this happens inside a loop that can be
unrolled, which we are not doing yet.

For this reason, a validate_nonconstant_vector_store_derefs pass is
added to detect these cases.

Ideally we would want to emit an hlsl_error on this pass, but before
implementing loop unrolling, we could reach this point on valid HLSL.

Also, as pointed out by Nikolay in the mentioned bug, currently
new_offset_from_path_index() fails an assertion when this happens,
because it expects an hlsl_ir_constant, so a check is added.
It also felt correct to emit an hlsl_fixme there, despite the
redundancy.
2024-01-15 19:57:12 +01:00
Conor McCarthy
c5bc28b454 tests/d3d12: Test vector parameter for countbits() and firstbithigh() in test_shader_instructions(). 2024-01-15 19:56:36 +01:00
Nikolay Sivov
a0207436f2 vkd3d-shader/tpf: Add initial support for writing fx_4_0/fx_4_1 binaries.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:48 +01:00
Nikolay Sivov
e527d7c1e7 vkd3d-shader/hlsl: Handle effect group statement.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:46 +01:00
Nikolay Sivov
f7a02a5da2 vkd3d-shader/hlsl: Add variables for techniques.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:45 +01:00
Nikolay Sivov
c3af1f9989 vkd3d-shader/hlsl: Add 'fxgroup' token.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:42 +01:00
Nikolay Sivov
ffae369748 tests: Add some tests for effects groups syntax.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:42 +01:00
Giovanni Mascellani
90bcc6691d tests: Mark resource arrays as buggy on MoltenVK.
They require Vulkan descriptor indexing extension, which is
exposed by MoltenVK but known to be buggy, so we assume it is
disabled.
2024-01-08 21:44:58 +01:00
Giovanni Mascellani
a610ccaed9 tests: Mark predicated rendering as buggy on MoltenVK.
It requires Vulkan conditional rendering extension.
2024-01-08 21:44:56 +01:00
Giovanni Mascellani
54514ba7dd tests: Mark streaming output as buggy on MoltenVK.
It requires Vulkan transform feedback extension.
2024-01-08 21:44:55 +01:00
Giovanni Mascellani
1cc2ccaf98 tests: Mark some sampling tests as buggy on MoltenVK.
Apparently Metal doesn't support specifying a bias directly in the
sampler, and, with "nearest" mip filtering, it doesn't switch
precisely at LOD 0.5 (though still between 0.5 and 0.6).
2024-01-08 21:44:53 +01:00