From 298407aaf3daf62b5ba4812a3323702e14a21380 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 1 Jun 2022 16:01:38 +0200 Subject: [PATCH] - workaround for clearing the start screen in Vulkan. There seems to be a bug in the backend, but I have no idea what's wrong. Clearing the start screen with a ClearRect call renders the 2D drawer in an unstable state. So for now, clear the screen by rendering a texture, but with light color black, which produces the same effect without later breaking stuff. --- src/common/startscreen/startscreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/startscreen/startscreen.cpp b/src/common/startscreen/startscreen.cpp index b7a87896d..8943bc485 100644 --- a/src/common/startscreen/startscreen.cpp +++ b/src/common/startscreen/startscreen.cpp @@ -669,8 +669,7 @@ void FStartScreen::Render(bool force) twod->Begin(screen->GetWidth(), screen->GetHeight()); // Weird shit moment: Vulkan does not render the screen clear if there isn't something textured in the buffer before it. - DrawTexture(twod, StartupTexture, 0, 0, TAG_END); - ClearRect(twod, 0, 0, twod->GetWidth(), twod->GetHeight(), GPalette.BlackIndex, 0); + DrawTexture(twod, HeaderTexture, 0, 0, DTA_VirtualWidthF, HeaderTexture->GetDisplayWidth(), DTA_VirtualHeightF, HeaderTexture->GetDisplayHeight(), DTA_KeepRatio, true, DTA_Color, PalEntry(255,0,0,0), TAG_END); if (HeaderTexture) { @@ -686,6 +685,7 @@ void FStartScreen::Render(bool force) displayheight = StartupTexture->GetDisplayHeight(); DrawTexture(twod, StartupTexture, 0, 0, DTA_VirtualWidthF, displaywidth, DTA_VirtualHeightF, displayheight, TAG_END); } + twod->End(); screen->Update(); twod->OnFrameDone();