Elizabeth Figura
bf702331d9
vkd3d-shader/hlsl: Use replace_ir() for hlsl_normalize_binary_exprs().
2025-11-06 14:10:53 +01:00
Elizabeth Figura
1f40222a0d
vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_exprs().
2025-10-28 16:30:49 +01:00
Elizabeth Figura
6e8eeb8f7a
vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_identities().
2025-10-28 16:30:49 +01:00
Elizabeth Figura
bdb31a4983
vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_swizzles().
2025-10-28 16:30:49 +01:00
Henri Verbeet
3e47752c95
vkd3d-shader/hlsl: Fold "x < 0" to false for unsigned x.
2025-09-22 11:36:39 +02:00
Petrichor Park
e35604dbf0
vkd3d-shader/hlsl: Implement the firstbitlow() intrinsic.
2025-09-22 11:26:42 +02:00
Petrichor Park
e6d840170d
vkd3d-shader/hlsl: Implement the firstbithigh() intrinsic.
2025-09-22 11:26:42 +02:00
Petrichor Park
e49beca0d5
vkd3d-shader/hlsl: Implement the countbits() intrinsic.
2025-09-22 11:26:42 +02:00
Henri Verbeet
e569245e1f
vkd3d-shader/hlsl: Implement constant folding of 'round' expressions.
2025-09-09 14:59:11 +02:00
Henri Verbeet
23ee29a953
vkd3d-shader/hlsl: Implement constant folding of 'reinterpret' expressions.
...
As encountered in tests/hlsl/frexp.shader_test.
2025-09-09 14:59:11 +02:00
Henri Verbeet
e330ad2ac7
vkd3d-shader/hlsl: Implement constant folding of 'cos' expressions.
...
As encountered in tests/hlsl/trigonometry.shader_test.
2025-09-09 14:59:01 +02:00
Henri Verbeet
08e7806b7f
vkd3d-shader/hlsl: Implement constant folding of 'sin' expressions.
...
As encountered in tests/hlsl/trigonometry.shader_test.
2025-09-09 14:51:15 +02:00
Henri Verbeet
d7a05d823c
vkd3d-shader/hlsl: Implement constant folding of 'mad' expressions.
...
As encountered in tests/hlsl/trigonometry.shader_test.
2025-09-09 14:51:15 +02:00
Shaun Ren
320c3c9652
vkd3d-shader/hlsl: Fold some general conditional identities.
...
The following conditional identities are applied:
c ? x : x -> x
false ? x : y -> y; true ? x : y -> x
c ? true : false -> c; c ? false : true -> !c
!c ? x : y -> c ? y : x
Lastly, for expression chains x, y in a conditional expression
c ? x : y,
we evaluate all conditionals in the expression chains with the
condition c, assuming c is true (for x), or false (for y).
2025-08-21 16:00:51 +02:00
Shaun Ren
4c37800f52
vkd3d-shader/hlsl: Check whether "expr" has more than 2 operands in hlsl_normalize_binary_exprs().
2025-08-21 15:32:27 +02:00
Elizabeth Figura
a06b9f6646
vkd3d-shader/hlsl: Do not emit HLSL_OP1_ABS for unsigned types.
2025-05-14 14:55:59 +02: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
Elizabeth Figura
18ca7affad
vkd3d-shader/hlsl: Make min16uint into a first-class type.
...
And properly implement translation into some binary enumerations.
2025-03-06 17:15:15 +01:00
Elizabeth Figura
662d60ad6b
vkd3d-shader/hlsl: Add a hlsl_block_add_expr() helper.
2025-03-03 17:48:03 +01:00
Elizabeth Figura
2989373212
vkd3d-shader/hlsl: Add a hlsl_block_add_binary_expr() helper.
2025-02-24 16:19:07 +01:00
Elizabeth Figura
fe52e69662
vkd3d-shader/hlsl: Use a block in hlsl_normalize_binary_exprs().
2025-02-05 13:53:53 +01:00
Elizabeth Figura
d049ea640f
vkd3d-shader/hlsl: Implement broadcasts in constant folding.
...
Normally lower_broadcasts() takes care of this, but loop unrolling executes before other constant passes.
2025-01-27 14:48:03 +01:00
Francisco Casas
9b3b47b1b8
vkd3d-shader: Avoid left shifting signed integers. (ubsan)
...
Otherwise ubsan reports these errors on the bitwise.shader_test:
libs/vkd3d-shader/hlsl_constant_ops.c:970:50: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
libs/vkd3d-shader/hlsl_constant_ops.c:970:50: runtime error: left shift of negative value -12
2025-01-10 19:51:55 +01:00
Elizabeth Figura
29bac62ba2
vkd3d-shader/hlsl: Move the "dimx" and "dimy" fields to the type-specific union.
2025-01-10 19:38:13 +01:00
Elizabeth Figura
1ff1a51e4b
vkd3d-shader/hlsl: Avoid some uses of the default case when switching over hlsl_base_type.
...
Since we have -Wswitch, this forces the developer to update all relevant
switches when an enum case is added.
Places where the default is just a FIXME are left alone.
2025-01-10 19:24:10 +01:00