Hi!
We are woking on a game on console platofrm.
And we have several device profiles.
Unfortunatelly in game, when we switch from quality to performance, it could take up to 20s to change.
The issue comes from :
`Manager.SetOverrideDeviceProfile(NewDeviceProfile);`
which in the end makes several calls to
`FGlobalComponentRecreateRenderStateContext RecreateRenderStateContext;`
I followed a little bit the spirit of `ActiveGlobalRecreateRenderStateContextCount` :
and I added a bool to avoid the call to be able to be done
```
FGlobalComponentRecreateRenderStateContext::FGlobalComponentRecreateRenderStateContext()
{
if(FApp::CanEverRender() && !bManualStopRecreation)
```
But with `bManualStopRecreation` being explicitly called to stop the recreation to be done.
It seems to work, but I was wondering why `ActiveGlobalRecreateRenderStateContextCount`is not usable.
Now we do :
UDeviceProfileManager& Manager = UDeviceProfileManager::Get();
FString NewDeviceProfileName = GetBestDeviceProfileName();
if (Manager.GetActiveDeviceProfileName() != NewDeviceProfileName)
{
UDeviceProfile* NewDeviceProfile = Manager.FindProfile(NewDeviceProfileName, true);
if(NewDeviceProfile != nullptr)
{
FGlobalComponentRecreateRenderStateContext::ManuallyBlockRecreation();
TRACE_BOOKMARK(TEXT("Change for Profile : %s"), *NewDeviceProfileName);
Manager.RestoreDefaultDeviceProfile();
Manager.SetOverrideDeviceProfile(NewDeviceProfile);
UE_LOG(LogConsoleResponse, Log, TEXT("Overrided Device Profile: [%s]"), *NewDeviceProfileName);
FGlobalComponentRecreateRenderStateContext::ManuallyAllowRecreation();
// force refresh to avoid rendering glitches
FGlobalComponentRecreateRenderStateContext RecreateRenderStateContext;
}
}
Do it feel safe for you?
If there another way to block the recreation when calling the sink of all cvars?
Thanks
[Attachment Removed]