vkd3d-shader/hlsl: Implement ternary operator for SM1.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov
2023-09-26 20:48:58 +02:00
committed by Alexandre Julliard
parent 522a0dfb56
commit 76e42fbd21
Notes: Alexandre Julliard 2023-11-08 23:02:17 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/371
4 changed files with 83 additions and 19 deletions

View File

@@ -578,7 +578,10 @@ enum hlsl_ir_expr_op
/* MOVC(a, b, c) returns c if a is bitwise zero and b otherwise.
* TERNARY(a, b, c) returns c if a == 0 and b otherwise.
* They differ for floating point numbers, because
* -0.0 == 0.0, but it is not bitwise zero. */
* -0.0 == 0.0, but it is not bitwise zero. CMP(a, b, c) returns b
if a >= 0, and c otherwise. It's used only for SM1-SM3 targets, while
SM4+ is using MOVC in such cases. */
HLSL_OP3_CMP,
HLSL_OP3_MOVC,
HLSL_OP3_TERNARY,
};