@@ -1035,11 +1035,11 @@ def SPIRV_GLDistanceOp : SPIRV_GLOp<"Distance", 67, [Pure]> {
10351035 let summary = "Return distance between two points";
10361036
10371037 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).
10401039
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.
10431043
10441044 #### Example:
10451045
@@ -1068,11 +1068,17 @@ def SPIRV_GLCrossOp : SPIRV_GLBinaryArithmeticOp<"Cross", 68, SPIRV_Float> {
10681068 let summary = "Return the cross product of two 3-component vectors";
10691069
10701070 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]
10721078
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 .
10761082
10771083 #### Example:
10781084
@@ -1089,12 +1095,11 @@ def SPIRV_GLNormalizeOp : SPIRV_GLUnaryArithmeticOp<"Normalize", 69, SPIRV_Float
10891095 let summary = "Normalizes a vector operand";
10901096
10911097 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.
10941101
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.
10981103
10991104 #### Example:
11001105
@@ -1111,14 +1116,15 @@ def SPIRV_GLReflectOp : SPIRV_GLBinaryArithmeticOp<"Reflect", 71, SPIRV_Float> {
11111116 let summary = "Calculate reflection direction vector";
11121117
11131118 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:
11161120
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.
11181124
11191125 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 .
11221128
11231129 #### Example:
11241130
0 commit comments