|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef INTRINSIC_WAVEREADFIRSTLANE |
|
|
|
// Warning: for correctness, the argument must have the same value across the wave! |
|
|
|
// Warning: for correctness, the argument's value must be the same across all lanes of the wave. |
|
|
|
TEMPLATE_1_REAL(WaveReadFirstLane, scalarValue, return scalarValue) |
|
|
|
TEMPLATE_1_INT(WaveReadFirstLane, scalarValue, return scalarValue) |
|
|
|
#endif |
|
|
|
|
|
|
return faceID; |
|
|
|
} |
|
|
|
#endif // INTRINSIC_CUBEMAP_FACE_ID |
|
|
|
|
|
|
|
// Intrinsic isnan can't be used because it require /Gic to be enabled on fxc that we can't do. So use IsNAN instead |
|
|
|
|
|
|
|
// Intrinsic isnan can't be used because it require /Gic to be enabled on fxc that we can't do. So use IsNAN instead |
|
|
|
bool IsNAN(float n) |
|
|
|
{ |
|
|
|
return (n < 0.0 || n > 0.0 || n == 0.0) ? false : true; |
|
|
|
|
|
|
bool IsNAN(float4 v) |
|
|
|
{ |
|
|
|
return (IsNAN(v.x) || IsNAN(v.y) || IsNAN(v.z) || IsNAN(v.w)) ? true : false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------- |
|
|
|
// Common math functions |
|
|
|
|
|
|
0, 1, 0, 0, |
|
|
|
0, 0, 1, 0, |
|
|
|
0, 0, 0, 1}; |
|
|
|
|
|
|
|
|
|
|
|
// Use case examples: |
|
|
|
// (position = positionCS) => (clipSpaceTransform = use default) |
|
|
|
// (position = positionVS) => (clipSpaceTransform = UNITY_MATRIX_P) |
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
return positionCS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Use case examples: |
|
|
|
// (position = positionCS) => (clipSpaceTransform = use default) |
|
|
|