@@ -1300,16 +1300,26 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c
13001300 HDAdditionalCameraData hdCam = null ;
13011301 var drsSettings = m_Asset . currentPlatformRenderPipelineSettings . dynamicResolutionSettings ;
13021302
1303+ #region DRS Setup
1304+ ////////////////////////////////
1305+ // setup of DRS in the camera //
1306+ ////////////////////////////////
1307+ // First step we tell the DRS handler that we will be using the scaler set by the user. Note DLSS can set a system slot in case it wants to provide
1308+ // the scale.
13031309 DynamicResolutionHandler . SetActiveDynamicScalerSlot ( DynamicResScalerSlot . User ) ;
13041310 if ( camera . TryGetComponent < HDAdditionalCameraData > ( out hdCam ) )
13051311 {
13061312 cameraRequestedDynamicRes = hdCam . allowDynamicResolution && camera . cameraType == CameraType . Game ;
13071313 }
13081314
1315+ // We now setup DLSS if its enabled. DLSS can override the drsSettings (i.e. setting a System scaler slot, and providing quality settings).
13091316 SetupDLSSForCameraDataAndDynamicResHandler ( hdCam , camera , xrPass , cameraRequestedDynamicRes , ref drsSettings ) ;
1310- DynamicResolutionHandler . UpdateAndUseCamera ( camera , drsSettings ) ;
13111317
1318+ // only select the current instance for this camera. We dont pass the settings set to prevent an update.
1319+ // This will set a new instance in DynamicResolutionHandler.instance that is specific to this camera.
1320+ DynamicResolutionHandler . UpdateAndUseCamera ( camera ) ;
13121321 var dynResHandler = DynamicResolutionHandler . instance ;
1322+
13131323 if ( hdCam != null )
13141324 {
13151325 // We are in a case where the platform does not support hw dynamic resolution, so we force the software fallback.
@@ -1321,11 +1331,16 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c
13211331 }
13221332 }
13231333
1334+ // Notify the hanlder if this camera requests DRS.
13241335 dynResHandler . SetCurrentCameraRequest ( cameraRequestedDynamicRes ) ;
13251336 dynResHandler . runUpscalerFilterOnFullResolution = ( hdCam != null && hdCam . cameraCanRenderDLSS ) || DynamicResolutionHandler . instance . filter == DynamicResUpscaleFilter . TAAU ;
13261337
1338+ // Finally, our configuration is prepared. Push it to the drs handler
1339+ dynResHandler . Update ( drsSettings ) ;
1340+
13271341 RTHandles . SetHardwareDynamicResolutionState ( dynResHandler . HardwareDynamicResIsEnabled ( ) ) ;
13281342
1343+ #endregion
13291344 // Reset pooled variables
13301345 cameraSettings . Clear ( ) ;
13311346 cameraPositionSettings . Clear ( ) ;
0 commit comments