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

Commit f0b8c55

Browse files
committed
Merge branch 'v2' into shader-stripping
2 parents 78c7b57 + 36bd073 commit f0b8c55

File tree

8 files changed

+24
-35
lines changed

8 files changed

+24
-35
lines changed

PostProcessing/Runtime/Effects/ColorGrading.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,13 @@ void CheckInternalLogLut()
451451
m_InternalLogLut = new RenderTexture(k_Lut3DSize, k_Lut3DSize, 0, format, RenderTextureReadWrite.Linear)
452452
{
453453
name = "Color Grading Log Lut",
454+
dimension = TextureDimension.Tex3D,
454455
hideFlags = HideFlags.DontSave,
455456
filterMode = FilterMode.Bilinear,
456457
wrapMode = TextureWrapMode.Clamp,
457458
anisoLevel = 0,
458459
enableRandomWrite = true,
459460
volumeDepth = k_Lut3DSize,
460-
dimension = TextureDimension.Tex3D,
461461
autoGenerateMips = false,
462462
useMipMap = false
463463
};

PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ int RenderBuiltins(PostProcessRenderContext context, bool isFinalPass, int relea
848848

849849
if (releaseTargetAfterUse > -1) cmd.ReleaseTemporaryRT(releaseTargetAfterUse);
850850
if (motionBlurTarget > -1) cmd.ReleaseTemporaryRT(motionBlurTarget);
851-
if (depthOfFieldTarget > -1) cmd.ReleaseTemporaryRT(motionBlurTarget);
851+
if (depthOfFieldTarget > -1) cmd.ReleaseTemporaryRT(depthOfFieldTarget);
852852
if (context.bloomBufferNameID > -1) cmd.ReleaseTemporaryRT(context.bloomBufferNameID);
853853

854854
cmd.EndSample("BuiltinStack");

PostProcessing/Runtime/Utils/TextureLerper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ RenderTexture Get(RenderTextureFormat format, int w, int h, int d = 1, bool enab
8282

8383
rt = new RenderTexture(w, h, d, format)
8484
{
85+
dimension = dimension,
8586
filterMode = FilterMode.Bilinear,
8687
wrapMode = TextureWrapMode.Clamp,
8788
anisoLevel = 0,
8889
volumeDepth = d,
89-
enableRandomWrite = enableRandomWrite,
90-
dimension = dimension
90+
enableRandomWrite = enableRandomWrite
9191
};
9292
rt.Create();
9393
}

PostProcessing/Runtime/Utils/XRSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Small shim for VRSettings/XRSettings on XboxOne and Switch
2-
#if !UNITY_2018_1_OR_NEWER && (UNITY_XBOXONE || UNITY_SWITCH)
2+
#if !UNITY_2018_2_OR_NEWER && (UNITY_XBOXONE || UNITY_SWITCH) && !UNITY_EDITOR
33
using System;
44

55
namespace UnityEngine.XR

PostProcessing/Shaders/API/OpenGL.hlsl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@
2929
#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r
3030
#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r
3131

32-
#define UNITY_BRANCH
33-
#define UNITY_FLATTEN
34-
#define UNITY_UNROLL
35-
#define UNITY_LOOP
36-
#define UNITY_FASTOPT
32+
#if SHADER_API_GLES
33+
# define UNITY_BRANCH
34+
# define UNITY_FLATTEN
35+
# define UNITY_UNROLL
36+
# define UNITY_LOOP
37+
# define UNITY_FASTOPT
38+
#else
39+
# define UNITY_BRANCH [branch]
40+
# define UNITY_FLATTEN [flatten]
41+
# define UNITY_UNROLL [unroll]
42+
# define UNITY_LOOP [loop]
43+
# define UNITY_FASTOPT [fastopt]
44+
#endif
3745

3846
#define CBUFFER_START(name)
3947
#define CBUFFER_END

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: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ float rcp(float value)
5555
}
5656
#endif
5757

58+
#if defined(SHADER_API_GLES)
59+
#define mad(a, b, c) (a * b + c)
60+
#endif
61+
5862
#ifndef INTRINSIC_MINMAX3
5963
float Min3(float a, float b, float c)
6064
{
@@ -143,40 +147,25 @@ float4 PositivePow(float4 base, float4 power)
143147
}
144148

145149
// NaN checker
150+
// /Gic isn't enabled on fxc so we can't rely on isnan() anymore
146151
bool IsNan(float x)
147152
{
148-
#if !defined(SHADER_API_GLES)
149-
return isnan(x) || isinf(x);
150-
#else
151153
return (x <= 0.0 || 0.0 <= x) ? false : true;
152-
#endif
153154
}
154155

155156
bool AnyIsNan(float2 x)
156157
{
157-
#if !defined(SHADER_API_GLES)
158-
return any(isnan(x)) || any(isinf(x));
159-
#else
160158
return IsNan(x.x) || IsNan(x.y);
161-
#endif
162159
}
163160

164161
bool AnyIsNan(float3 x)
165162
{
166-
#if !defined(SHADER_API_GLES)
167-
return any(isnan(x)) || any(isinf(x));
168-
#else
169163
return IsNan(x.x) || IsNan(x.y) || IsNan(x.z);
170-
#endif
171164
}
172165

173166
bool AnyIsNan(float4 x)
174167
{
175-
#if !defined(SHADER_API_GLES)
176-
return any(isnan(x)) || any(isinf(x));
177-
#else
178168
return IsNan(x.x) || IsNan(x.y) || IsNan(x.z) || IsNan(x.w);
179-
#endif
180169
}
181170

182171
// -----------------------------------------------------------------------------

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Requires Unity 5.6.1+ or 2017.1+.
2121
License
2222
-------
2323

24-
MIT (see [LICENSE](LICENSE))
24+
Unity Companion License (see [LICENSE](LICENSE))

0 commit comments

Comments
 (0)