浏览代码

HDRenderPipeline: Small NaN correction (naming and test)

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

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


}
#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)
// Intrinsic isnan can't be used because it require /Gic to be enabled on fxc that we can't do. So use AnyIsNan instead
bool IsNan(float n)
bool IsNAN(float2 v)
bool AnyIsNan(float2 v)
return (IsNAN(v.x) || IsNAN(v.y)) ? true : false;
return (IsNan(v.x) || IsNan(v.y));
bool IsNAN(float3 v)
bool AnyIsNan(float3 v)
return (IsNAN(v.x) || IsNAN(v.y) || IsNAN(v.z)) ? true : false;
return (IsNan(v.x) || IsNan(v.y) || IsNan(v.z));
bool IsNAN(float4 v)
bool AnyIsNan(float4 v)
return (IsNAN(v.x) || IsNAN(v.y) || IsNAN(v.z) || IsNAN(v.w)) ? true : false;
return (IsNan(v.x) || IsNan(v.y) || IsNan(v.z) || IsNan(v.w));
}
// ----------------------------------------------------------------------------

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


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

正在加载...
取消
保存