Skip to content

Commit

Permalink
Engine: force gfxdriver to clear batches when releasing render targets
Browse files Browse the repository at this point in the history
This is to ensure that no pointers or references to these render targets are left in gfx driver.
In the worst case, the game will skip 1 draw frame after resuming or switching display mode.
  • Loading branch information
ivan-mogilko committed Jan 29, 2023
1 parent c47baf3 commit 278ba3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Engine/ac/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ void release_drawobj_rendertargets()
!gfxDriver->ShouldReleaseRenderTargets())
return;

gfxDriver->ClearDrawLists(); // force clear to ensure nothing stays cached
for (auto &tex : gui_render_tex)
{
if (tex)
Expand Down

0 comments on commit 278ba3b

Please sign in to comment.