Description

An assert crash is now triggered when set a widget using material to WidgetLoadingScreen of FLoadingScreenAttributes then call FDefaultGameMoviePlayer::SetupLoadingScreen().

The ensureMsgf in question is in IsInParallelRenderingThread(), ThreadingBase.cpp;

#if !UE_BUILD_SHIPPING && !UE_BUILD_TEST
    if (!LowLevelTasks::FSchedulerTls::IsBusyWaiting() &&
        !CoroTask_Detail::FCoroLocalState::IsCoroLaunchedTask() &&
        !UE::Tasks::Private::IsThreadRetractingTask())
    {
        const uint32 CurrentThreadId = FPlatformTLS::GetCurrentThreadId();
        bool oldValue = ((GRenderThreadId == 0) || bLocalIsLoadingThreadSuspended) ?  true : CurrentThreadId != GGameThreadId;
        ensureMsgf(oldValue == newValue, TEXT("oldValue(%i) newValue(%i) If this check fails make sure that there is a FTaskTagScope(ETaskTag::EParallelRenderingThread) as deep as possible on the current callstack, you can see the current value in ActiveNamedThreads(%x), GRenderingThread(%x), GIsRenderingThreadSuspended(%d)"), oldValue, newValue, FTaskTagScope::GetCurrentTag(), GRenderingThread, bLocalIsLoadingThreadSuspended);
        newValue = oldValue;
    }
#endif
Steps to Reproduce
  1. Download the repro project and unzip it.
  2. Open LoadingIssueSample.uproject and Navigate "Platforms" > "Windows" > "Cook" in the main menu bar and wait until the cook is done.
  3. Close Unreal Editor.
  4. Right click on LoadingIssueSample.uproject file and select "Generate Visual Studio project files".
  5. Double click LoadingIssueSample.sln file to open it with Visual Studio.
  6. Select "Development" configuration on the tool bar.
  7. Click "Local Windows Debugger".
  8. Once the game starts, move a player with WASD and enter a white box to see that a text base loading screen works as expected.
  9. Move the player and touch a blue-outline black box to see that a material base loading screen causes a crash.
Callstack
[Inline Frame] LoadingIssueSample.exe!IsInParallelRenderingThread::__l10::<lambda>() Line 311    C++
     LoadingIssueSample.exe!IsInParallelRenderingThread() Line 311    C++
     [Inline Frame] LoadingIssueSample.exe!FMaterial::GetRenderingThreadShaderMap() Line 1454    C++
     [Inline Frame] LoadingIssueSample.exe!FMaterial::GetShaderMapToUse() Line 1099    C++
     LoadingIssueSample.exe!FMaterial::GetUniformExpressions() Line 1107    C++
     LoadingIssueSample.exe!FMaterial::GetUniformTextureExpressions(EMaterialTextureParameterType Type) Line 1119    C++
     LoadingIssueSample.exe!UMaterial::GetUsedTextures(TArray<UTexture *,TSizedDefaultAllocator<32>> & OutTextures, EMaterialQualityLevel::Type QualityLevel, bool bAllQualityLevels, ERHIFeatureLevel::Type FeatureLevel, bool bAllFeatureLevels) Line 1132    C++
     LoadingIssueSample.exe!FSlateMaterialResource::FSlateMaterialResource(const UMaterialInterface & InMaterialResource, const UE::Math::TVector2<float> InImageSize, FSlateShaderResource * InTextureMask) Line 100    C++
     LoadingIssueSample.exe!FSlateRHIResourceManager::GetMaterialResource(const UObject * InMaterial, const FSlateBrush * InBrush, FSlateShaderResource * TextureMask, int InMaskKey) Line 925    C++
     LoadingIssueSample.exe!FSlateRHIResourceManager::GetShaderResource(const FSlateBrush & InBrush, UE::Math::TVector2<float> LocalSize, float DrawScale) Line 675    C++
     LoadingIssueSample.exe!FSlateShaderResourceManager::GetResourceHandle(const FSlateBrush & Brush, UE::Math::TVector2<float> LocalSize, float DrawScale) Line 38    C++
     LoadingIssueSample.exe!FSlateRHIRenderer::GetResourceHandle(const FSlateBrush & Brush, UE::Math::TVector2<float> LocalSize, float DrawScale) Line 2066    C++
     LoadingIssueSample.exe!FSlateBrush::UpdateRenderingResource(UE::Math::TVector2<float> LocalSize, float DrawScale) Line 162    C++
     [Inline Frame] LoadingIssueSample.exe!FSlateBrush::GetRenderingResource(UE::Slate::FDeprecateVector2DParameter) Line 459    C++
     LoadingIssueSample.exe!FSlateBoxElement::SetBrush(const FSlateBrush * InBrush, UE::Slate::FDeprecateVector2DParameter InLocalSize, float DrawScale) Line 402    C++
     LoadingIssueSample.exe!FSlateDrawElement::MakeBoxInternal(FSlateWindowElementList & ElementList, unsigned int InLayer, const FPaintGeometry & PaintGeometry, const FSlateBrush * InBrush, ESlateDrawEffect InDrawEffects, const FLinearColor & InTint) Line 267    C++
     LoadingIssueSample.exe!FSlateDrawElement::MakeBox(FSlateWindowElementList & ElementList, unsigned int InLayer, const FPaintGeometry & PaintGeometry, const FSlateBrush * InBrush, ESlateDrawEffect InDrawEffects, const FLinearColor & InTint) Line 335    C++
     LoadingIssueSample.exe!SImage::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 64    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!SCompoundWidget::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 46    C++
     LoadingIssueSample.exe!SObjectWidget::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 138    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!SCompoundWidget::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 46    C++
     LoadingIssueSample.exe!SBorder::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 129    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     [Inline Frame] LoadingIssueSample.exe!SPanel::PaintArrangedChildren(const FPaintArgs &) Line 30    C++
     LoadingIssueSample.exe!SPanel::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 12    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!SOverlay::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 221    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!SCompoundWidget::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 46    C++
     LoadingIssueSample.exe!SBorder::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 129    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     [Inline Frame] LoadingIssueSample.exe!SPanel::PaintArrangedChildren(const FPaintArgs &) Line 30    C++
     LoadingIssueSample.exe!SPanel::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 12    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!SOverlay::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 221    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!SCompoundWidget::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 46    C++
     LoadingIssueSample.exe!SVirtualWindow::OnPaint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 83    C++
     LoadingIssueSample.exe!SWidget::Paint(const FPaintArgs & Args, const FGeometry & AllottedGeometry, const FSlateRect & MyCullingRect, FSlateWindowElementList & OutDrawElements, int LayerId, const FWidgetStyle & InWidgetStyle, bool bParentEnabled) Line 1622    C++
     LoadingIssueSample.exe!FMoviePlayerWidgetRenderer::DrawWindow(float DeltaTime) Line 1029    C++
     LoadingIssueSample.exe!FSlateLoadingSynchronizationMechanism::SlateThreadRunMainLoop() Line 170    C++
     LoadingIssueSample.exe!FSlateLoadingThreadTask::Run() Line 213    C++
     LoadingIssueSample.exe!FRunnableThreadWin::Run() Line 149    C++
     LoadingIssueSample.exe!FRunnableThreadWin::GuardedRun() Line 71    C++

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-216735 in the post.

1
Login to Vote

Fixed
ComponentUE - Editor - UI Systems
Affects Versions5.4
Target Fix5.4.3
Fix Commit34241908
CreatedJun 6, 2024
ResolvedJun 10, 2024
UpdatedJun 16, 2024
View Jira Issue