24 Commits

Author SHA1 Message Date
Henri Verbeet
d30c992039 vkd3d-shader/glsl: Implement VSIR_OP_UDIV_SIMPLE. 2025-08-28 20:06:32 +02:00
Shaun Ren
245430002a vkd3d-shader/hlsl: Fold some general unary identities.
The following unary identities are applied:

  ||x|| -> |x|
  |-x| -> |x|
  ~(~x) -> x
  f(g(x)) -> g(x), where f(), g() are floor() or ceil() functions.
  -(-x) -> x
  !!x -> x
  !(x == y) -> x != y, !(x < y) -> x >= y, etc (for integers).
2025-08-21 16:00:46 +02:00
Giovanni Mascellani
3817df1164 tests/shader_runner_metal: Run the Metal shader runner with DXIL shaders. 2025-08-04 14:34:23 +02:00
Henri Verbeet
90b6412daa vkd3d-shader/msl: Implement VSIR_OP_UMAX and VSIR_OP_UMIN. 2025-07-14 18:13:43 +02:00
Giovanni Mascellani
cc42581a34 tests/hlsl: Test uint64 comparisons. 2025-07-14 18:12:03 +02:00
Henri Verbeet
5899d8f54b vkd3d-shader/msl: Implement VKD3DSIH_XOR. 2025-06-11 20:27:54 +02:00
Henri Verbeet
9c987e5a0b tests/shader_runner: Introduce the "u32" probe format. 2025-06-10 17:48:19 +02:00
Henri Verbeet
a570932b82 vkd3d-shader/msl: Implement VKD3DSIH_IMUL. 2025-06-10 17:45:06 +02:00
Henri Verbeet
3673b65485 vkd3d-shader/msl: Implement VKD3DSIH_IADD. 2025-06-09 16:20:53 +02:00
Giovanni Mascellani
a477502a05 tests/hlsl: Test minimum precision 16-bit unsigned integers. 2025-05-24 20:57:42 +02:00
Henri Verbeet
808931b108 vkd3d-shader/glsl: Implement VKD3DSIH_XOR. 2025-03-17 15:07:51 +01:00
Henri Verbeet
b9ebf87114 vkd3d-shader/hlsl: Do not collect expressions across different operations in hlsl_normalize_binary_exprs(). 2025-03-12 21:34:17 +01:00
Henri Verbeet
b4296e1a2d tests/hlsl: Add another constant folding test. 2025-03-12 21:34:02 +01:00
Conor McCarthy
2a0d49bb58 tests/hlsl: Add more arithmetic uint16 tests. 2025-02-10 13:19:16 +01:00
Conor McCarthy
033a0d29c5 tests/hlsl: Add some arithmetic uint16 shader tests. 2025-01-28 13:13:44 +01:00
Shaun Ren
646087d54c vkd3d-shader/hlsl: Collect together terms with constant coefficients.
We apply distributivity to applicable expressions, specifically with
the following rewrite rules:

  (x OPL a) OPR (x OPL b) -> x OPL (a OPR b)
  (y OPR (x OPL a)) OPR (x OPL b) -> y OPR (x OPL (a OPR b))
  ((x OPL a) OPR y) OPR (x OPL b) -> (x OPL (a OPR b)) OPR y
  (x OPL a) OPR ((x OPL b) OPR y) -> (x OPL (a OPR b)) OPR y
  (x OPL a) OPR (y OPR (x OPL b)) -> (x OPL (a OPR b)) OPR y

where a, b are constants.
2025-01-10 19:17:43 +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
Feifan He
fd1beedc07 vkd3d-shader/msl: Implement support for VSIR_DIMENSION_VEC4 immediate constants. 2024-11-23 23:43:42 +01:00
Feifan He
b0646cb427 tests/shader_runner: Introduce a Metal shader runner. 2024-10-31 16:47:26 +01:00
Atharva Nimbalkar
2fc35da940 vkd3d-shader/glsl: Implement support for VSIR_DIMENSION_VEC4 immediate constants. 2024-09-20 17:16:33 +02:00
Elizabeth Figura
d3ba810c98 tests: Stop probing all pixels when drawing a uniform colour.
This is simply unnecessary and wastes time.

As part of this, simply remove the "all" directive. Only for a couple of tests
is it even potentially interesting to validate all pixels (e.g.
nointerpolation.shader_test), and for those "all" is replaced with an explicit
(0, 0, 640, 480) rect.

In all other cases we just probe (0, 0).
2024-06-13 23:55:31 +02:00
Henri Verbeet
0715734dfb tests/shader_runner: Add GLSL support to the GL runner. 2024-03-19 22:57:50 +01:00
Conor McCarthy
57280673e5 tests/shader-runner: Test shaders with dxcompiler.
The location of dxcompiler should be set during configuration with
'DXCOMPILER_LIBS=-L/path/to/dxcompiler', and then at runtime with
LD_LIBRARY_PATH, WINEPATH or PATH as applicable.

A new 'fail(sm<6)' decoration is needed on many shader declarations
because dxcompiler succeeds on many shaders which fail with fxc. The
opposite case is less common and is flagged with 'fail(sm>=6)'. A few
tests cause dxcompiler to crash or hang, so these are avoided using
[require], which now skips tests until reset instead of exiting. Also,
'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results.
2023-10-11 22:21:14 +02:00
Zebediah Figura
0d2f2e1860 tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00