690 Commits

Author SHA1 Message Date
Francisco Casas
825784322d vkd3d-shader/ir: Properly lower texldp. 2024-12-18 17:30:15 +01:00
Francisco Casas
02fc26507b tests/hlsl: Test tex2Dproj(). 2024-12-18 17:29:10 +01:00
Francisco Casas
7cc802afd7 vkd3d-shader/ir: Properly lower texldb. 2024-12-18 17:27:43 +01:00
Anna (navi) Figueiredo Gomes
f09ac4959e vkd3d-shader/hlsl: Implement the GatherCmp() methods. 2024-12-18 17:27:43 +01:00
Anna (navi) Figueiredo Gomes
fd8bcc188f tests/hlsl: Add GatherCmp() tests. 2024-12-18 17:27:43 +01:00
Conor McCarthy
8d479d2ea6 vkd3d-shader/dxil: Implement DX intrinsic EvalCentroid. 2024-12-18 17:27:43 +01:00
Conor McCarthy
1bb3b13c0a vkd3d-shader/dxil: Implement DX intrinsic EvalSampleIndex. 2024-12-18 17:27:43 +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
27c7776947 tests: Use fail(sm<5) instead of [require] for uav-atomics. 2024-12-17 16:37:41 +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
Henri Verbeet
c4f69f4d3d vkd3d-shader/hlsl: Prefer overload candidates without component count widening. 2024-12-16 17:09:40 +01:00
Henri Verbeet
64bb4150f0 vkd3d-shader/hlsl: Prefer overload candidates without component type narrowing. 2024-12-16 17:09:40 +01:00
Henri Verbeet
32d432ab5e vkd3d-shader/hlsl: Prefer overload candidates with matching component types. 2024-12-16 17:09:40 +01:00
Henri Verbeet
6b8878377f vkd3d-shader/hlsl: Prefer overload candidates with matching component type classes. 2024-12-16 17:09:40 +01:00
Henri Verbeet
63fce3062e vkd3d-shader/hlsl: Prefer overload candidates without component count narrowing. 2024-12-16 17:09:40 +01:00
Henri Verbeet
cdf6100fe5 tests: Add yet more overload resolution tests. 2024-12-16 17:09:40 +01:00
Victor Chiletto
a1d995e740 vkd3d-shader/hlsl: Unroll loops with conditional jumps. 2024-12-12 16:54:04 +01:00
Shaun Ren
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
Francisco Casas
aa3a716249 vkd3d-shader/hlsl: Allow lowering separate sampler arrays on deref offset 0. 2024-12-10 15:52:52 +01:00
Francisco Casas
2c9269ac3a vkd3d-shader/hlsl: Allocate samplers by decreasing bind count in SM1. 2024-12-10 15:52:50 +01:00
Francisco Casas
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
Francisco Casas
58d318719c tests: Test sampler array allocation. 2024-12-10 15:51:34 +01:00
Francisco Casas
a0a555878f tests: Add additional sampler allocation tests for SM1. 2024-12-10 14:02:00 +01:00
Conor McCarthy
f3fac95bb6 tests/hlsl: Add int64 wave op tests. 2024-12-09 14:21:49 +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
Feifan He
9d4bcc951d vkd3d-shader/msl: Implement VKD3DSIH_USHR. 2024-12-05 21:26:03 +01:00
Feifan He
138e7caa03 vkd3d-shader/msl: Implement VKD3DSIH_ISHR. 2024-12-05 21:26:03 +01:00
Feifan He
5d6ed0fa30 vkd3d-shader/msl: Implement VKD3DSIH_ISHL. 2024-12-05 21:26:03 +01:00
Feifan He
a425c242a4 vkd3d-shader/msl: Implement VKD3DSIH_MAD. 2024-12-05 21:26:03 +01:00
Feifan He
8e0de82c74 vkd3d-shader/msl: Implement support for VKD3DSPDM_SATURATE modifiers. 2024-12-05 21:26:03 +01:00
Feifan He
ebf5828542 vkd3d-shader/msl: Implement VKD3DSIH_ELSE. 2024-12-05 21:25:35 +01:00
Feifan He
bbe10dcf17 vkd3d-shader/msl: Implement VKD3DSIH_NOT. 2024-12-05 21:13:29 +01:00
Feifan He
a06e664730 vkd3d-shader/msl: Implement VKD3DSIH_RSQ. 2024-12-04 14:26:20 +01:00
Feifan He
bc67f2eb75 vkd3d-shader/msl: Implement VKD3DSIH_MIN. 2024-12-04 14:26:20 +01:00
Feifan He
ab2cb43e15 vkd3d-shader/msl: Implement VKD3DSIH_MAX. 2024-12-04 14:26:20 +01:00
Feifan He
64ea033c81 vkd3d-shader/msl: Implement VKD3DSIH_LOG. 2024-12-04 14:26:20 +01:00
Feifan He
b1e6dbe83f vkd3d-shader/msl: Handle SV_IS_FRONT_FACE inputs. 2024-12-04 14:26:20 +01:00
Feifan He
568296c88f vkd3d-shader/msl: Implement VKD3DSIH_ROUND_NE. 2024-12-04 14:26:20 +01:00
Feifan He
610a11ddf8 vkd3d-shader/msl: Implement VKD3DSIH_IF and VKD3DSIH_ENDIF. 2024-12-04 14:26:20 +01:00
Feifan He
28068c9d4c vkd3d-shader/msl: Implement VKD3DSIH_ROUND_NI. 2024-12-04 14:26:20 +01:00
Feifan He
a81a9fb7bc vkd3d-shader/msl: Implement VKD3DSIH_LTO. 2024-12-03 14:44:32 +01:00
Feifan He
24753747a1 vkd3d-shader/msl: Implement VKD3DSIH_EXP. 2024-12-03 14:44:32 +01:00
Feifan He
ac897781ba vkd3d-shader/msl: Implement VKD3DSIH_IEQ. 2024-12-03 14:44:32 +01:00
Feifan He
67dd1d2b0c vkd3d-shader/msl: Handle the VKD3DSIM_LINEAR interpolation modifier on inputs. 2024-12-03 14:42:49 +01:00
Feifan He
8ae6a04561 vkd3d-shader/msl: Implement VKD3DSIH_SQRT. 2024-12-03 14:42:27 +01:00
Feifan He
77ed788a60 vkd3d-shader/msl: Implement VKD3DSIH_DP2. 2024-12-03 14:42:27 +01:00
Feifan He
6f7ee57e29 vkd3d-shader/msl: Implement VKD3DSIH_DP4. 2024-12-03 14:42:27 +01:00
Feifan He
046e9b5286 vkd3d-shader/msl: Implement VKD3DSIH_DP3. 2024-12-03 14:42:19 +01:00
Henri Verbeet
d0e4331640 vkd3d-shader/hlsl: Use hlsl_error() instead of hlsl_fixme() for ambiguous function calls.
This changes the return code, and some tests start passing as a result.
2024-12-03 14:38:33 +01:00