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

Commit 2c725df

Browse files
committed
Added an early exit in TextureLerper to save performances
1 parent 4cd8808 commit 2c725df

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

PostProcessing/Runtime/Utils/TextureLerper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ internal Texture Lerp(Texture from, Texture to, float t)
102102
Assert.IsNotNull(from);
103103
Assert.IsNotNull(to);
104104

105+
// Saves a potentially expensive fullscreen blit when using dirt textures & the likes
106+
if (from == to)
107+
return from;
108+
105109
bool is3d = to is Texture3D
106110
|| (to is RenderTexture && ((RenderTexture)to).volumeDepth > 1);
107111

0 commit comments

Comments
 (0)