Description

The Ellipsis overflow method on text widgets can cause an ensure to trip as a result of a render batch being sent with no indices. We could guard against this in SlateRHIRenderingPolicy by checking if FirstRenderBatchIndex == INDEX_NONE, but it would likely be more performant to prevent the empty batch from being sent in the first place.

Steps to Reproduce

1. Create a UserWidget with a canvas panel and a Text widget. Add some Lorem Ipsum to populate the text
2. On the text widget, set Clipping to "Clip to Bounds" and (I've also seen it repro with one character from the original text showing
3. Compile, then save the widget repeatedly. After a few saves, you'll trigger check(RenderBatch.NumIndices > 0)

Callstack
>    UnrealEditor-SlateRHIRenderer.dll!FSlateRHIRenderingPolicy::DrawElements(FRHICommandListImmediate & RHICmdList, FSlateBackBuffer & BackBuffer, TRefCountPtr<FRHITexture> & ColorTarget, TRefCountPtr<FRHITexture> & PostProcessTexture, TRefCountPtr<FRHITexture> & DepthStencilTarget, int FirstBatchIndex, const TArray<FSlateRenderBatch,TSizedDefaultAllocator<32>> & RenderBatches, const FSlateRenderingParams & Params) Line 883    C++
     UnrealEditor-SlateRHIRenderer.dll!FSlate3DRenderer::DrawWindowToTarget_RenderThread(FRHICommandListImmediate & InRHICmdList, const FRenderThreadUpdateContext & Context) Line 220    C++
     [Inline Frame] UnrealEditor-RenderCore.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,void __cdecl(FRHICommandListImmediate &)>::operator()(FRHICommandListImmediate &) Line 470    C++
     UnrealEditor-RenderCore.dll!FRenderThreadCommandPipe::EnqueueAndLaunch::__l5::<lambda_1>::operator()() Line 1628    C++
     [Inline Frame] UnrealEditor-RenderCore.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,void __cdecl(void)>::operator()() Line 470    C++
     [Inline Frame] UnrealEditor-RenderCore.dll!TFunctionGraphTaskImpl<void __cdecl(void),1>::DoTaskImpl(TUniqueFunction<void __cdecl(void)> & Function, ENamedThreads::Type) Line 1710    C++
     [Inline Frame] UnrealEditor-RenderCore.dll!TFunctionGraphTaskImpl<void __cdecl(void),1>::DoTask(ENamedThreads::Type) Line 1703    C++
     UnrealEditor-RenderCore.dll!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),1>>::ExecuteTask() Line 634    C++
     UnrealEditor-Core.dll!UE::Tasks::Private::FTaskBase::TryExecuteTask() Line 504    C++
     [Inline Frame] UnrealEditor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> &) Line 482    C++
     UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 779    C++
     UnrealEditor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 668    C++
     UnrealEditor-RenderCore.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 317    C++
     UnrealEditor-RenderCore.dll!FRenderingThread::Run() Line 470    C++
     UnrealEditor-Core.dll!FRunnableThreadWin::Run() Line 159    C++
     UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() Line 71    C++
     [External Code]    
 

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Editor - UI Systems - Slate
Affects Versions5.45.5
Target Fix5.5
CreatedAug 12, 2024
UpdatedSep 18, 2024
View Jira Issue