@@ -1035,11 +1035,11 @@ def SPIRV_GLDistanceOp : SPIRV_GLOp<"Distance", 67, [Pure]> {
1035
1035
let summary = "Return distance between two points";
1036
1036
1037
1037
let description = [{
1038
- Result is the distance between x and y. This is |x - y|, where |x| is the
1039
- length of x computed as sqrt(x * x).
1038
+ Result is the distance between p0 and p1, i.e., length(p0 - p1).
1040
1039
1041
- The operands must all be vectors whose component type is floating-point.
1042
- Result Type must be a scalar floating-point type.
1040
+ The operands must all be a scalar or vector whose component type is floating-point.
1041
+
1042
+ Result Type must be a scalar of the same type as the component type of the operands.
1043
1043
1044
1044
#### Example:
1045
1045
@@ -1068,11 +1068,17 @@ def SPIRV_GLCrossOp : SPIRV_GLBinaryArithmeticOp<"Cross", 68, SPIRV_Float> {
1068
1068
let summary = "Return the cross product of two 3-component vectors";
1069
1069
1070
1070
let description = [{
1071
- Result is the cross product of x and y, i.e. dot(x,y).
1071
+ Result is the cross product of x and y, i.e., the resulting components are, in order:
1072
+
1073
+ x[1] * y[2] - y[1] * x[2]
1074
+
1075
+ x[2] * y[0] - y[2] * x[0]
1076
+
1077
+ x[0] * y[1] - y[0] * x[1]
1072
1078
1073
- Arguments x and y must be vectors of size 3, of floating-point type.
1074
- Results are computed per component.
1075
- The result is a vector of the same type as the inputs .
1079
+ All the operands must be vectors of 3 components of a floating-point type.
1080
+
1081
+ Result Type and the type of all operands must be the same type .
1076
1082
1077
1083
#### Example:
1078
1084
@@ -1089,12 +1095,11 @@ def SPIRV_GLNormalizeOp : SPIRV_GLUnaryArithmeticOp<"Normalize", 69, SPIRV_Float
1089
1095
let summary = "Normalizes a vector operand";
1090
1096
1091
1097
let description = [{
1092
- Result is the vector v/sqrt(dot(v,v)).
1093
- The result is undefined if dot(v,v) is less than or equal to 0.
1098
+ Result is the vector in the same direction as x but with a length of 1.
1099
+
1100
+ The operand x must be a scalar or vector whose component type is floating-point.
1094
1101
1095
- The operand v must be a vector whose component type is floating-point.
1096
- The Result Type must be the same type as v.
1097
- Results are computed per component.
1102
+ Result Type and the type of x must be the same type.
1098
1103
1099
1104
#### Example:
1100
1105
@@ -1111,14 +1116,15 @@ def SPIRV_GLReflectOp : SPIRV_GLBinaryArithmeticOp<"Reflect", 71, SPIRV_Float> {
1111
1116
let summary = "Calculate reflection direction vector";
1112
1117
1113
1118
let description = [{
1114
- Result is the reflection direction vector: I - 2 * dot(N, I) * N, where I is
1115
- the incident vector and N is the surface orientation vector.
1119
+ For the incident vector I and surface orientation N, the result is the reflection direction:
1116
1120
1117
- N must be normalized to achieve the desired result.
1121
+ I - 2 * dot(N, I) * N
1122
+
1123
+ N must already be normalized in order to achieve the desired result.
1118
1124
1119
1125
The operands must all be a scalar or vector whose component type is floating-point.
1120
- Result Type and the type of all operands must be the same type.
1121
- Results are computed per component .
1126
+
1127
+ Result Type and the type of all operands must be the same type .
1122
1128
1123
1129
#### Example:
1124
1130
0 commit comments