Go to the source code of this file.
Functions | |
typedef | __attribute__ ((ext_vector_type(4))) |
float4 | maxvec (float4 a, float4 b) |
float4 | minvec (float4 a, float4 b) |
float | powf (float num, float p) |
float | sqrtf (float x) |
float4 | powvec (float4 vec, float4 q) |
float4 | sqrtvec (float4 vec) |
float4 | sltvec (float4 v1, float4 v2) |
void | abs (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w) |
void | dp3 (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w, float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w) |
void | dp4 (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w, float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w) |
void | lit (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w) |
void | min (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w, float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w) |
void | max (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w, float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w) |
void | pow (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w, float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w) |
void | rsq (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w) |
void | slt (float4 *res, float4 tmp0x, float4 tmp0y, float4 tmp0z, float4 tmp0w, float4 tmp1x, float4 tmp1y, float4 tmp1z, float4 tmp1w) |
typedef __attribute__ | ( | (ext_vector_type(4)) | ) |
Definition at line 34 of file soabuiltins.c.
00042 { 00043 float4 res; 00044 res.x = fabsf(vec.x); 00045 res.y = fabsf(vec.y); 00046 res.z = fabsf(vec.z); 00047 res.w = fabsf(vec.w); 00048 00049 return res; 00050 }
Definition at line 104 of file soabuiltins.c.
00106 { 00107 res[0] = absvec(tmp0x); 00108 res[1] = absvec(tmp0y); 00109 res[2] = absvec(tmp0z); 00110 res[3] = absvec(tmp0w); 00111 }
void dp3 | ( | float4 * | res, | |
float4 | tmp0x, | |||
float4 | tmp0y, | |||
float4 | tmp0z, | |||
float4 | tmp0w, | |||
float4 | tmp1x, | |||
float4 | tmp1y, | |||
float4 | tmp1z, | |||
float4 | tmp1w | |||
) |
Definition at line 113 of file soabuiltins.c.
00116 { 00117 float4 dot = (tmp0x * tmp1x) + (tmp0y * tmp1y) + 00118 (tmp0z * tmp1z); 00119 00120 res[0] = dot; 00121 res[1] = dot; 00122 res[2] = dot; 00123 res[3] = dot; 00124 }
void dp4 | ( | float4 * | res, | |
float4 | tmp0x, | |||
float4 | tmp0y, | |||
float4 | tmp0z, | |||
float4 | tmp0w, | |||
float4 | tmp1x, | |||
float4 | tmp1y, | |||
float4 | tmp1z, | |||
float4 | tmp1w | |||
) |
Definition at line 126 of file soabuiltins.c.
00129 { 00130 float4 dot = (tmp0x * tmp1x) + (tmp0y * tmp1y) + 00131 (tmp0z * tmp1z) + (tmp0w * tmp1w); 00132 00133 res[0] = dot; 00134 res[1] = dot; 00135 res[2] = dot; 00136 res[3] = dot; 00137 }
Definition at line 139 of file soabuiltins.c.
References float4::f, maxvec(), minvec(), and powvec().
00141 { 00142 const float4 zerovec = (float4) {0.0, 0.0, 0.0, 0.0}; 00143 const float4 min128 = (float4) {-128.f, -128.f, -128.f, -128.f}; 00144 const float4 plus128 = (float4) {128.f, 128.f, 128.f, 128.f}; 00145 00146 res[0] = (float4){1.0, 1.0, 1.0, 1.0}; 00147 if (tmp0x.x > 0) { 00148 float4 tmpy = maxvec(tmp0y, zerovec); 00149 float4 tmpw = minvec(tmp0w, plus128); 00150 tmpw = maxvec(tmpw, min128); 00151 res[1] = tmp0x; 00152 res[2] = powvec(tmpy, tmpw); 00153 } else { 00154 res[1] = zerovec; 00155 res[2] = zerovec; 00156 } 00157 res[3] = (float4){1.0, 1.0, 1.0, 1.0}; 00158 }
Definition at line 52 of file soabuiltins.c.
00053 { 00054 return (float4){(a.x > b.x) ? a.x : b.x, 00055 (a.y > b.y) ? a.y : b.y, 00056 (a.z > b.z) ? a.z : b.z, 00057 (a.w > b.w) ? a.w : b.w}; 00058 }
Definition at line 60 of file soabuiltins.c.
00061 { 00062 return (float4){(a.x < b.x) ? a.x : b.x, 00063 (a.y < b.y) ? a.y : b.y, 00064 (a.z < b.z) ? a.z : b.z, 00065 (a.w < b.w) ? a.w : b.w}; 00066 }
void pow | ( | float4 * | res, | |
float4 | tmp0x, | |||
float4 | tmp0y, | |||
float4 | tmp0z, | |||
float4 | tmp0w, | |||
float4 | tmp1x, | |||
float4 | tmp1y, | |||
float4 | tmp1z, | |||
float4 | tmp1w | |||
) |
Definition at line 181 of file soabuiltins.c.
References powvec().
00184 { 00185 res[0] = powvec(tmp0x, tmp1x); 00186 res[1] = res[0]; 00187 res[2] = res[0]; 00188 res[3] = res[0]; 00189 }
float powf | ( | float | num, | |
float | p | |||
) |
Definition at line 191 of file soabuiltins.c.
References sqrtvec().
00193 { 00194 const float4 onevec = (float4) {1., 1., 1., 1.}; 00195 res[0] = onevec/sqrtvec(absvec(tmp0x)); 00196 res[1] = onevec/sqrtvec(absvec(tmp0y)); 00197 res[2] = onevec/sqrtvec(absvec(tmp0z)); 00198 res[3] = onevec/sqrtvec(absvec(tmp0w)); 00199 }
Definition at line 91 of file soabuiltins.c.
00092 { 00093 float4 p; 00094 p.x = (v1.x < v2.x) ? 1.0 : 0.0; 00095 p.y = (v1.y < v2.y) ? 1.0 : 0.0; 00096 p.z = (v1.z < v2.z) ? 1.0 : 0.0; 00097 p.w = (v1.w < v2.w) ? 1.0 : 0.0; 00098 return p; 00099 }
float sqrtf | ( | float | x | ) |