Description

FHighResScreenShotConfig::Init() sets the materials only in the Editor, due to a #if
WITH_EDITOR block. However, the FViewport class exposes the TakeHighResScreenShot to
non-editor builds as well, leading to a crash when the function is used in non-editor builds

Steps to Reproduce

1. Download the attached project, package, then run packaged game, optionally with
debugger attached.
2. Click the screenshot button without the mask checkbox enabled. No crash happens.
3. Enable the mask checkbox, click the screenshot button again. Crash ensues, or a
debug break if the debugger is attached

Callstack

> HiResScrShotRepo.exe!AddHighResolutionScreenshotMaskPass(FRDGBuilder &
GraphBuilder, const FViewInfo & View, const FHighResolutionScreenshotMaskInputs &
Inputs) Line 823 C++
HiResScrShotRepo.exe!AddPostProcessingPasses(FRDGBuilder & GraphBuilder,
const FViewInfo & View, int ViewIndex, bool bAnyLumenActive, EReflectionsMethod
ReflectionsMethod, const FPostProcessingInputs & Inputs, const Nanite::FRasterResults *
NaniteRasterResults, FInstanceCullingManager & InstanceCullingManager,
FVirtualShadowMapArray * VirtualShadowMapArray, FLumenSceneFrameTemporaries &
LumenFrameTemporaries, const FSceneWithoutWaterTextures &
SceneWithoutWaterTextures, FScreenPassTexture TSRMoireInput) Line 1368 C++
HiResScrShotRepo.exe!FDeferredShadingSceneRenderer::Render(FRDGBuilder &
GraphBuilder) Line 4275 C++
HiResScrShotRepo.exe!RenderViewFamilies_RenderThread(FRHICommandListImmediate &
RHICmdList, const TArray<FSceneRenderer *,TSizedDefaultAllocator<32>> &
SceneRenderers) Line 4413 C++
HiResScrShotRepo.exe!FRendererModule::BeginRenderingViewFamilies::__l87::<lambda>(F
RHICommandListImmediate & RHICmdList) Line 4681 C++
HiResScrShotRepo.exe!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererM
odule::BeginRenderingViewFamilies'::`87'::FDrawSceneCommandName,void
<lambda>(FRHICommandListImmediate &)>>::ExecuteTask(TArray<FBaseGraphTask
*,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread, bool
bDeleteOnCompletion) Line 1311 C++
[Inline Frame]
HiResScrShotRepo.exe!FBaseGraphTask::Execute(TArray<FBaseGraphTask
*,TSizedDefaultAllocator<32>> & CurrentThread, ENamedThreads::Type) Line 919 C++
HiResScrShotRepo.exe!FNamedTaskThread::ProcessTasksNamedThread(int
QueueIndex, bool bAllowStall) Line 758 C++
HiResScrShotRepo.exe!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex)
Line 649 C++
HiResScrShotRepo.exe!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent)
Line 417 C++
HiResScrShotRepo.exe!FRenderingThread::Run() Line 569 C++
HiResScrShotRepo.exe!FRunnableThreadWin::Run() Line 149 C++
HiResScrShotRepo.exe!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-181019 in the post.

3
Login to Vote

Unresolved
ComponentUE - Rendering Architecture
Affects Versions5.2
Target Fix5.5
CreatedMar 22, 2023
UpdatedJan 19, 2024