This question was created in reference to: [checkf in [Content removed]
As the linked issue mentioned, I’m encountering an issue with RaytracingGeometryManager thinking that it is called 2x in 1 frame.
> checkf(GFrameCounterRenderThread != PreviousFrameCounter, TEXT(“FRayTracingGeometryManager::Tick() should only be called once per frame”));
And tied to this bug report:
> Unreal Engine Issues and Bug Tracker (UE-254119
This started happening to us in our integration branch for 5.6, right on boot during the movie logo phase. After some investigation, I was able to track it down to the code below.
The sum up, the movie player is in a loop that’s ticking the engine, which enqueue a RenderCommand to tick the GeoManager. Unfortunately the code doesn’t increment ‘GFrameCounterRenderThread’ which is tested by the GeoManager.
The fix I made is to set the value of GFrameCounterRenderThread with ‘GFrameCounter’ as I saw done in other locations. Does it makes sens?
void FDefaultGameMoviePlayer::WaitForMovieToFinish(bool bAllowEngineTick)
{
const bool bEnforceMinimumTime = LoadingScreenAttributes.MinimumLoadingScreenDisplayTime >= 0.0f;
if (LoadingScreenIsPrepared() && IsMovieCurrentlyPlaying())
{
//...
// Continue to wait until the user calls finish (if enabled) or when loading completes or the minimum enforced time (if any) has been reached.
// Don't continue playing on game shutdown
while ( !IsEngineExitRequested() &&
((bWaitForManualStop && !bUserCalledFinish)
|| (!bUserCalledFinish && !bEnforceMinimumTime && !IsMovieStreamingFinished() && !bAutoCompleteWhenLoadingCompletes)
|| (bEnforceMinimumTime && (FPlatformTime::Seconds() - LastPlayTime) < LoadingScreenAttributes.MinimumLoadingScreenDisplayTime)))
{
//...
if (FSlateApplication::IsInitialized())
{
//...
if (GEngine && bAllowEngineTick && LoadingScreenAttributes.bAllowEngineTick)
{
//---------------------------------------------------------
// NOTE: Calls 'FRendererModule::PostRenderAllViewports'
// which enqueue the RenderThread GeometryManager::Tick
//---------------------------------------------------------
GEngine->Tick(DeltaTime, false);
}
//...
FDefaultGameMoviePlayer* InMoviePlayer = this;
ENQUEUE_RENDER_COMMAND(BeginLoadingMovieFrameAndTickMovieStreamer)(
[InMoviePlayer, DeltaTime, CurrentFrameCounter = GFrameCounter](FRHICommandListImmediate& RHICmdList)
{
GFrameNumberRenderThread++;
//---------------------------------------------------------
// NOTE: Missing increment to 'GFrameCounterRenderThread'
// which is checked by GeometryManager
GFrameCounterRenderThread = CurrentFrameCounter; // <=== THE FIX IS THIS
//---------------------------------------------------------
InMoviePlayer->TickStreamer(DeltaTime);
}
);
//...
}
}
//...
}
}