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()
237237 m_CurrentContext = new PostProcessRenderContext ( ) ;
238238 }
239239
240+ bool DynamicResolutionAllowsFinalBlitToCameraTarget ( )
241+ {
242+ return ( ! m_Camera . allowDynamicResolution || ( ScalableBufferManager . heightScaleFactor == 1.0 && ScalableBufferManager . widthScaleFactor == 1.0 ) ) ;
243+ }
240244
241245#if UNITY_2019_1_OR_NEWER
242246 // We always use a CommandBuffer to blit to the final render target
243247 // OnRenderImage is used only to avoid the automatic blit from the RenderTexture of Camera.forceIntoRenderTexture to the actual target
244248 [ ImageEffectUsesCommandBuffer ]
245249 void OnRenderImage ( RenderTexture src , RenderTexture dst )
246250 {
247- if ( finalBlitToCameraTarget && ( m_Camera . allowDynamicResolution && ScalableBufferManager . heightScaleFactor == 1.0 && ScalableBufferManager . widthScaleFactor == 1.0 ) )
251+ if ( finalBlitToCameraTarget && DynamicResolutionAllowsFinalBlitToCameraTarget ( ) )
248252 RenderTexture . active = dst ; // silence warning
249253 else
250254 Graphics . Blit ( src , dst ) ;
@@ -607,7 +611,7 @@ void BuildCommandBuffers()
607611 context . destination = cameraTarget ;
608612
609613#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 ( ) )
611615 {
612616 if ( m_Camera . targetTexture )
613617 {
You can’t perform that action at this time.
0 commit comments