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

Commit b2f81ab

Browse files
committed
GC fix
1 parent 708ed9e commit b2f81ab

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
### Fixed
1010
- Post-processing would crash if "Managed Stripping Level" was set to Medium or High.
1111
- Serialization warnings on build.
12+
- Removed unwanted garbage collection.
1213

1314
## [2.1.5] - 2019-03-25
1415

PostProcessing/Runtime/Effects/ScreenSpaceReflections.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,17 @@ public override DepthTextureMode GetCameraFlags()
151151
return DepthTextureMode.Depth | DepthTextureMode.MotionVectors;
152152
}
153153

154-
internal void CheckRT(ref RenderTexture rt, int width, int height, RenderTextureFormat format, FilterMode filterMode, bool useMipMap)
154+
internal void CheckRT(ref RenderTexture rt, int width, int height, FilterMode filterMode, bool useMipMap)
155155
{
156-
if (rt == null || !rt.IsCreated() || rt.width != width || rt.height != height || rt.format != format)
156+
if (rt == null || !rt.IsCreated() || rt.width != width || rt.height != height)
157157
{
158158
if (rt != null)
159159
{
160160
rt.Release();
161161
RuntimeUtilities.Destroy(rt);
162162
}
163163

164-
rt = new RenderTexture(width, height, 0, format)
164+
rt = new RenderTexture(width, height, 0, RuntimeUtilities.defaultHDRRenderTextureFormat)
165165
{
166166
filterMode = filterMode,
167167
useMipMap = useMipMap,
@@ -203,7 +203,7 @@ public override void Render(PostProcessRenderContext context)
203203
int lodCount = Mathf.FloorToInt(Mathf.Log(size, 2f) - 3f);
204204
lodCount = Mathf.Min(lodCount, kMaxLods);
205205

206-
CheckRT(ref m_Resolve, size, size, context.sourceFormat, FilterMode.Trilinear, true);
206+
CheckRT(ref m_Resolve, size, size, FilterMode.Trilinear, true);
207207

208208
var noiseTex = context.resources.blueNoise256[0];
209209
var sheet = context.propertySheets.Get(context.resources.shaders.screenSpaceReflections);
@@ -234,7 +234,7 @@ public override void Render(PostProcessRenderContext context)
234234
}
235235
else
236236
{
237-
CheckRT(ref m_History, size, size, context.sourceFormat, FilterMode.Bilinear, false);
237+
CheckRT(ref m_History, size, size, FilterMode.Bilinear, false);
238238

239239
if (m_ResetHistory)
240240
{

0 commit comments

Comments
 (0)