Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 36bd073

Browse files
committed
/Gic isn't enabled on fxc so we can't rely on isnan() anymore
1 parent 914e05d commit 36bd073

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

PostProcessing/Shaders/Builtins/CopyStd.shader

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,12 @@ Shader "Hidden/PostProcessing/CopyStd"
5353
//>>> We don't want to include StdLib.hlsl in this file so let's copy/paste what we need
5454
bool IsNan(float x)
5555
{
56-
#if !SHADER_API_GLES
57-
return isnan(x) || isinf(x);
58-
#else
5956
return (x <= 0.0 || 0.0 <= x) ? false : true;
60-
#endif
6157
}
6258

6359
bool AnyIsNan(float4 x)
6460
{
65-
#if !SHADER_API_GLES
66-
return any(isnan(x)) || any(isinf(x));
67-
#else
6861
return IsNan(x.x) || IsNan(x.y) || IsNan(x.z) || IsNan(x.w);
69-
#endif
7062
}
7163
//<<<
7264

PostProcessing/Shaders/StdLib.hlsl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,40 +147,25 @@ float4 PositivePow(float4 base, float4 power)
147147
}
148148

149149
// NaN checker
150+
// /Gic isn't enabled on fxc so we can't rely on isnan() anymore
150151
bool IsNan(float x)
151152
{
152-
#if !defined(SHADER_API_GLES)
153-
return isnan(x) || isinf(x);
154-
#else
155153
return (x <= 0.0 || 0.0 <= x) ? false : true;
156-
#endif
157154
}
158155

159156
bool AnyIsNan(float2 x)
160157
{
161-
#if !defined(SHADER_API_GLES)
162-
return any(isnan(x)) || any(isinf(x));
163-
#else
164158
return IsNan(x.x) || IsNan(x.y);
165-
#endif
166159
}
167160

168161
bool AnyIsNan(float3 x)
169162
{
170-
#if !defined(SHADER_API_GLES)
171-
return any(isnan(x)) || any(isinf(x));
172-
#else
173163
return IsNan(x.x) || IsNan(x.y) || IsNan(x.z);
174-
#endif
175164
}
176165

177166
bool AnyIsNan(float4 x)
178167
{
179-
#if !defined(SHADER_API_GLES)
180-
return any(isnan(x)) || any(isinf(x));
181-
#else
182168
return IsNan(x.x) || IsNan(x.y) || IsNan(x.z) || IsNan(x.w);
183-
#endif
184169
}
185170

186171
// -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)