浏览代码

Fix NaN checker pass that can't work with intrinsic isnan (as it require /Gic)

/main
sebastienlagarde 7 年前
当前提交
f80ece87
共有 2 个文件被更改,包括 23 次插入2 次删除
  1. 21
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
  2. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader

21
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl


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
bool IsNAN(float n)
{
return (n < 0.0 || n > 0.0 || n == 0.0) ? false : true;
}
bool IsNAN(float2 v)
{
return (IsNAN(v.x) || IsNAN(v.y)) ? true : false;
}
bool IsNAN(float3 v)
{
return (IsNAN(v.x) || IsNAN(v.y) || IsNAN(v.z)) ? true : false;
}
bool IsNAN(float4 v)
{
return (IsNAN(v.x) || IsNAN(v.y) || IsNAN(v.z) || IsNAN(v.w)) ? true : false;
}
// ----------------------------------------------------------------------------
// Common math functions

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader


if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_NAN_TRACKER)
{
float4 color = SAMPLE_TEXTURE2D(_DebugFullScreenTexture, sampler_DebugFullScreenTexture, input.texcoord);
if (any(isnan(color)) || any(isinf(color)))
if (IsNAN(color) || any(isinf(color)))
{
color = float4(1.0, 0.0, 0.0, 1.0);
}

正在加载...
取消
保存