浏览代码

Implement SafeDiv()

/main
GitHub 7 年前
当前提交
30eac094
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 9
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Common.hlsl

9
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Common.hlsl


{
data ^= 1u << offset;
}
#ifndef INTRINSIC_WAVEREADFIRSTLANE
// Warning: for correctness, the argument's value must be the same across all lanes of the wave.

{
real dp3 = max(REAL_MIN, dot(inVec, inVec));
return inVec * rsqrt(dp3);
}
// Division which returns 1 for (inf/inf) and (0/0).
// If any of the input parameters are NaNs, the result is a NaN.
real SafeDiv(real numer, real denom)
{
return (numer != denom) : numer / denom : 1;
}
// Generates a triangle in homogeneous clip space, s.t.

正在加载...
取消
保存