Skip to content

Commit

Permalink
[Port] [2023.2] [HDRP] Fix performance issue with reflection probe in…
Browse files Browse the repository at this point in the history
…spector

the loop was changing the quality settings which is slow
  • Loading branch information
svc-reach-platform-support authored and Evergreen committed Nov 6, 2023
1 parent 63c1ef3 commit de6aaed
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,20 @@ static internal bool IsHighestSettingForCubeResolution()
CubeReflectionResolution highestResolution = highestTierInCurrent;

//Iterate over every quality setting to check their settings for the cubemap resolution
QualitySettings.ForEach(() =>
for (int i = 0; i < QualitySettings.count; ++i)
{
HDRenderPipelineAsset asset = QualitySettings.renderPipeline as HDRenderPipelineAsset;
if(asset != null)
var asset = QualitySettings.GetRenderPipelineAssetAt(i) as HDRenderPipelineAsset;
if (asset != null)
{
//Iterate through reflection cube map quality tiers
CubeReflectionResolution highestInTier = GetHighestCubemapResolutionSetting(asset.currentPlatformRenderPipelineSettings);

if(highestInTier > highestResolution)
if (highestInTier > highestResolution)
{
highestResolution = highestInTier;
}
}
});
}

return highestResolution == highestTierInCurrent;
}
Expand Down

0 comments on commit de6aaed

Please sign in to comment.