This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -237,14 +237,18 @@ void InitLegacy()
237
237
m_CurrentContext = new PostProcessRenderContext ( ) ;
238
238
}
239
239
240
+ bool DynamicResolutionAllowsFinalBlitToCameraTarget ( )
241
+ {
242
+ return ( ! m_Camera . allowDynamicResolution || ( ScalableBufferManager . heightScaleFactor == 1.0 && ScalableBufferManager . widthScaleFactor == 1.0 ) ) ;
243
+ }
240
244
241
245
#if UNITY_2019_1_OR_NEWER
242
246
// We always use a CommandBuffer to blit to the final render target
243
247
// OnRenderImage is used only to avoid the automatic blit from the RenderTexture of Camera.forceIntoRenderTexture to the actual target
244
248
[ ImageEffectUsesCommandBuffer ]
245
249
void OnRenderImage ( RenderTexture src , RenderTexture dst )
246
250
{
247
- if ( finalBlitToCameraTarget && ( m_Camera . allowDynamicResolution && ScalableBufferManager . heightScaleFactor == 1.0 && ScalableBufferManager . widthScaleFactor == 1.0 ) )
251
+ if ( finalBlitToCameraTarget && DynamicResolutionAllowsFinalBlitToCameraTarget ( ) )
248
252
RenderTexture . active = dst ; // silence warning
249
253
else
250
254
Graphics . Blit ( src , dst ) ;
@@ -607,7 +611,7 @@ void BuildCommandBuffers()
607
611
context . destination = cameraTarget ;
608
612
609
613
#if UNITY_2019_1_OR_NEWER
610
- if ( finalBlitToCameraTarget && ! RuntimeUtilities . scriptableRenderPipelineActive && ( ! m_Camera . allowDynamicResolution || ( ScalableBufferManager . heightScaleFactor == 1.0 && ScalableBufferManager . widthScaleFactor == 1.0 ) ) )
614
+ if ( finalBlitToCameraTarget && ! RuntimeUtilities . scriptableRenderPipelineActive && DynamicResolutionAllowsFinalBlitToCameraTarget ( ) )
611
615
{
612
616
if ( m_Camera . targetTexture )
613
617
{
You can’t perform that action at this time.
0 commit comments