Commit Graph

681 Commits

Author SHA1 Message Date
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
c4f69f4d3d vkd3d-shader/hlsl: Prefer overload candidates without component count widening. 2024-12-16 17:09:40 +01:00
64bb4150f0 vkd3d-shader/hlsl: Prefer overload candidates without component type narrowing. 2024-12-16 17:09:40 +01:00
32d432ab5e vkd3d-shader/hlsl: Prefer overload candidates with matching component types. 2024-12-16 17:09:40 +01:00
6b8878377f vkd3d-shader/hlsl: Prefer overload candidates with matching component type classes. 2024-12-16 17:09:40 +01:00
63fce3062e vkd3d-shader/hlsl: Prefer overload candidates without component count narrowing. 2024-12-16 17:09:40 +01:00
cdf6100fe5 tests: Add yet more overload resolution tests. 2024-12-16 17:09:40 +01:00
a1d995e740 vkd3d-shader/hlsl: Unroll loops with conditional jumps. 2024-12-12 16:54:04 +01:00
2c9cf7c78b vkd3d-shader/hlsl: Implement normalization of binary expressions.
We normalize binary expressions by attempting to group constants
together, in order to facilitate further simplification of the
expressions.

For any binary operator OP, non-constants x, y, and constants a, b, we
apply the following rewrite rules:

  a OP x -> x OP a, if OP is commutative.

  (x OP a) OP b -> x OP (a OP b), if OP is associative.

  (x OP a) OP y -> (x OP y) OP a, if OP is associative and commutative.

  x OP (y OP a) -> (x OP y) OP a, if OP is associative.

Note that we consider floating point operations to be
non-associative.
2024-12-11 15:32:22 +01:00
aa3a716249 vkd3d-shader/hlsl: Allow lowering separate sampler arrays on deref offset 0. 2024-12-10 15:52:52 +01:00
2c9269ac3a vkd3d-shader/hlsl: Allocate samplers by decreasing bind count in SM1. 2024-12-10 15:52:50 +01:00
3a6bf3be24 vkd3d-shader/hlsl: Lower separated samplers for SM1.
The combined sampler is created as a SAMPLER instead of a TEXTURE
because that fits all our current infrastructure. The only problem is
that in the CTAB it must appear as a Texture, so the new field
hlsl_type.is_combined_sampler is added.

Co-authored-by: Elizabeth Figura <zfigura@codeweavers.com>
2024-12-10 15:51:43 +01:00
58d318719c tests: Test sampler array allocation. 2024-12-10 15:51:34 +01:00
a0a555878f tests: Add additional sampler allocation tests for SM1. 2024-12-10 14:02:00 +01:00
f3fac95bb6 tests/hlsl: Add int64 wave op tests. 2024-12-09 14:21:49 +01:00
50306a8b08 tests/hlsl: Add uint64 wave op tests. 2024-12-09 14:20:28 +01:00
f0f8bb3f36 tests/hlsl: Add float64 wave op tests. 2024-12-09 14:17:05 +01:00
9d4bcc951d vkd3d-shader/msl: Implement VKD3DSIH_USHR. 2024-12-05 21:26:03 +01:00
138e7caa03 vkd3d-shader/msl: Implement VKD3DSIH_ISHR. 2024-12-05 21:26:03 +01:00
5d6ed0fa30 vkd3d-shader/msl: Implement VKD3DSIH_ISHL. 2024-12-05 21:26:03 +01:00
a425c242a4 vkd3d-shader/msl: Implement VKD3DSIH_MAD. 2024-12-05 21:26:03 +01:00
8e0de82c74 vkd3d-shader/msl: Implement support for VKD3DSPDM_SATURATE modifiers. 2024-12-05 21:26:03 +01:00
ebf5828542 vkd3d-shader/msl: Implement VKD3DSIH_ELSE. 2024-12-05 21:25:35 +01:00
bbe10dcf17 vkd3d-shader/msl: Implement VKD3DSIH_NOT. 2024-12-05 21:13:29 +01:00
a06e664730 vkd3d-shader/msl: Implement VKD3DSIH_RSQ. 2024-12-04 14:26:20 +01:00