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

Commit de0e114

Browse files
committed
Fixed sRGB flag on RT in 2018.1+ & cleanup
1 parent 36bd073 commit de0e114

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

PostProcessing/Runtime/PostProcessRenderContext.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Camera camera
8181

8282
// Should we flip the last pass?
8383
public bool flip { get; set; }
84-
84+
8585
// -----------------------------------------------------------------------------------------
8686
// The following is auto-populated by the post-processing stack
8787

@@ -106,12 +106,11 @@ public Camera camera
106106

107107
// TODO: Change w/h name to texture w/h in order to make
108108
// size usages explicit
109-
110109
#if UNITY_2017_2_OR_NEWER
111-
private RenderTextureDescriptor m_sourceDescriptor;
112-
private RenderTextureDescriptor GetDescriptor(int depthBufferBits = 0, RenderTextureFormat colorFormat = RenderTextureFormat.Default, RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default)
110+
RenderTextureDescriptor m_sourceDescriptor;
111+
RenderTextureDescriptor GetDescriptor(int depthBufferBits = 0, RenderTextureFormat colorFormat = RenderTextureFormat.Default, RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default)
113112
{
114-
var modifiedDesc = new RenderTextureDescriptor(m_sourceDescriptor.width, m_sourceDescriptor.height,
113+
var modifiedDesc = new RenderTextureDescriptor(m_sourceDescriptor.width, m_sourceDescriptor.height,
115114
m_sourceDescriptor.colorFormat, depthBufferBits);
116115
modifiedDesc.dimension = m_sourceDescriptor.dimension;
117116
modifiedDesc.volumeDepth = m_sourceDescriptor.volumeDepth;
@@ -126,14 +125,14 @@ private RenderTextureDescriptor GetDescriptor(int depthBufferBits = 0, RenderTex
126125

127126
if (colorFormat != RenderTextureFormat.Default)
128127
modifiedDesc.colorFormat = colorFormat;
129-
if (readWrite != RenderTextureReadWrite.Default)
130-
modifiedDesc.sRGB = (readWrite != RenderTextureReadWrite.Linear);
128+
129+
modifiedDesc.sRGB = readWrite != RenderTextureReadWrite.Linear;
131130

132131
return modifiedDesc;
133132
}
134133
#endif
135134

136-
public void GetScreenSpaceTemporaryRT(CommandBuffer cmd, int nameID,
135+
public void GetScreenSpaceTemporaryRT(CommandBuffer cmd, int nameID,
137136
int depthBufferBits = 0, RenderTextureFormat colorFormat = RenderTextureFormat.Default, RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default,
138137
FilterMode filter = FilterMode.Bilinear, int widthOverride = 0, int heightOverride = 0)
139138
{
@@ -155,11 +154,11 @@ public void GetScreenSpaceTemporaryRT(CommandBuffer cmd, int nameID,
155154

156155
cmd.GetTemporaryRT(nameID, actualWidth, actualHeight, depthBufferBits, filter, colorFormat, readWrite);
157156
// TODO: How to handle MSAA for XR in older versions? Query cam?
158-
// TODO: Pass in vrUsage into the args
157+
// TODO: Pass in vrUsage into the args
159158
#endif
160159
}
161160

162-
public RenderTexture GetScreenSpaceTemporaryRT(int depthBufferBits = 0, RenderTextureFormat colorFormat = RenderTextureFormat.Default,
161+
public RenderTexture GetScreenSpaceTemporaryRT(int depthBufferBits = 0, RenderTextureFormat colorFormat = RenderTextureFormat.Default,
163162
RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default, int widthOverride = 0, int heightOverride = 0)
164163
{
165164
#if UNITY_2017_2_OR_NEWER
@@ -194,7 +193,7 @@ public RenderTexture GetScreenSpaceTemporaryRT(int depthBufferBits = 0, RenderTe
194193

195194
// Are we currently rendering in the scene view?
196195
public bool isSceneView { get; internal set; }
197-
196+
198197
// Current antialiasing method set
199198
public PostProcessLayer.Antialiasing antialiasing { get; internal set; }
200199

0 commit comments

Comments
 (0)