Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.h:
/* DP2ADD(a, b, c) computes the scalar product of a.xy and b.xy, * then adds c. */ HLSL_OP3_DP2ADD,
- /* 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. 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. */
- /* TERNARY(a, b, c) returns 'b' if 'a' is true and 'b' otherwise. 'a' must always be boolean.
`'c' otherwise`, I believe.
However, it seems that TERNARY is now a subcase of MOVC. Is there a reason for not merging them?