Handled error: Ensure condition failed: CurrentDepthTexture

In binary 4.8 at a certain part of game loop I started getting following errors:

Ensure condition failed: CurrentDepthTexture [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11Commands.cpp] [Line: 650]

UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() {0x000007fede8fa846} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FDebug::EnsureFailed() {0x000007fede794071} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FDebug::EnsureNotFalse_OptionallyLogFormattedEnsureMessageReturningFalse() {0x000007fede794323} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-D3D11RHI.dll!FD3D11DynamicRHI::ValidateExclusiveDepthStencilAccess() {0x000007fed498c379} + 53 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-D3D11RHI.dll!FD3D11DynamicRHI::RHISetDepthStencilState() {0x000007fed497fc94} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Renderer.dll!FTranslucencyDrawingPolicyFactory::DrawMesh() {0x000007fedc6ff9ce} + 42 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Renderer.dll!FTranslucencyDrawingPolicyFactory::DrawDynamicMesh() {0x000007fedc6feb95} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Renderer.dll!FRendererModule::DrawTileMesh() {0x000007fedc5d6040} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Engine.dll!FTileRenderer::DrawTile() {0x000007fed8120a4b} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Engine.dll!`FCanvasTileRendererItem::Render_GameThread'::`5'::EURCMacro_DrawTileCommand::DoTask() {0x000007fed811899d} + 413 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Engine.dll!TGraphTask<`FCanvasTileRendererItem::Render_GameThread'::`5'::EURCMacro_DrawTileCommand>::ExecuteTask() {0x000007fed8128dd1} + 18 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FTaskThread::ProcessTasks() {0x000007fede6363be} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FTaskThread::ProcessTasksUntilQuit() {0x000007fede6365ed} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-RenderCore.dll!RenderingThreadMain() {0x000007fee8065d3b} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-RenderCore.dll!FRenderingThread::Run() {0x000007fee806624f} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FRunnableThreadWin::Run() {0x000007fede8f65f8} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FRunnableThreadWin::GuardedRun() {0x000007fede8e14ad} + 8 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
kernel32.dll {0x00000000772059cd} + 0 bytes
ntdll.dll {0x000000007743b981} + 0 bytes
ntdll.dll {0x000000007743b981} + 0 bytes

So many of them that sudden log dump freezes both PIE window and editor for a good minute. Then game resumes like nothing happened. I tried to find exact location of problem by setting blueprint breakpoints but I wasn’t able to pinpoint a specific node: with breakpoints freezing does not happen (a variable amount of log prints do) and I couldn’t find a node which executes instantly after freeze. Sometimes I get only a single instance of error message above when I stop simulation.

This is what is happening up to freeze: I take away input from pawn and disable collisions on it. Then a timeline adjusts a few material parameters so a post process material covers up screen. timeline also has a few events which control when I teleport pawn to a new location. timeline finishes with removing cover effect from screen, pawn gets input and collision. And around this time freeze occurs.

I’m not sure where to keep digging, there are a quite a few things happening in game at that point.


I disabled my “blendable” post process material, SSAO, DOF, MotionBlur and Temporal AA but none of that helped.

I get 90-150 messages in one dump, ~16 ms apart. I’m not sure why message count varies this much, issues shows up after a 4 second long automated sequence with no human control. As far as I can tell that’s all finished and error occurs just as game logic starts idling (actors ticking, waiting for human interaction).

error occurs in a 32bit packaged game too: incident occurs at same place in game loop but freeze is much shorter, less than a second and error count is more than a 1000.

Hi -

Do you happen to have a project which you can share that replicates this endure? I am trying to replicate issue internally but number of variables to test is fairly high in this instance and it would speed things along to be able to eliminate variables from a project that already is causing this issue.

If you would like to keep project private please feel free to message me via forums with a link to download project.

Thank You

Eric Ketchum

I tracked issue to a single node. Here is chain of events:

  • A “Mission” is started.
  • mission spawns a weapon.
  • new weapon actor is initialized by calling one of its functions.
  • That function registers this weapon in game state through an interface custom game state class implements.
  • implementation takes weapon instance as parameter and sets a variable to that value.

If I unlink that last step in game state class, Set node, no error appears.
I’m packing up project and send you details in PM.

Hi ,

I’m not sure cause of ensure, but I can verify that we see this in project you provided. I’ve created a bug report for issue (UE-17723) and I’ll keep you updated on its progress. Thanks for report!

Would it be possible to explain to me what that error message means? At least on a high level, maybe I can find more clues as keep working, refactoring. I know how digging through someone else’s project is not most fun job, so I’d like to help any way I can. :slight_smile:

I’ll send an email out, see if I can find an answer for you before bug report is looked into. No promises, but I will try to find out what that error message is coming from.

Actually, I just remembered that we found another report with same ensure spam, and it appears in that case to involve using a Translucent Material with Responsive AA enabled inside a HUD class with Draw Material Simple.

Yes! weapon added it’s own crosshair which indeed had responsive AA turned on. Now it’s off, no more errors. Thank you!