Module: vkd3d
Branch: master
Commit: ee28861837c825818ace2e1e50825ade87a9c723
URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/ee28861837c825818ace2e1e50825…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Tue Sep 12 17:30:55 2023 +0200
vkd3d-shader/hlsl: Document some possibly obscure HLSL opcodes.
---
libs/vkd3d-shader/hlsl.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h
index bece9a4a..44cebaaf 100644
--- a/libs/vkd3d-shader/hlsl.h
+++ b/libs/vkd3d-shader/hlsl.h
@@ -550,8 +550,13 @@ enum hlsl_ir_expr_op
HLSL_OP2_NEQUAL,
HLSL_OP2_RSHIFT,
+ /* DP2ADD(a, b, c) computes the scalar product of a.xy and b.xy,
+ * then adds c. */
HLSL_OP3_DP2ADD,
- /* TERNARY is used specifically for ternary operator, and later lowered according to profile to e.g. MOVC. */
+ /* 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. */
HLSL_OP3_MOVC,
HLSL_OP3_TERNARY,
};