gpu: clear target buffer offset on login screen

This prevents the previous scene from rendering during loading prior to the welcome screen being opened
This commit is contained in:
Adam
2021-10-28 18:11:47 -04:00
parent ec5179dc77
commit 3c7339771d

View File

@@ -1437,12 +1437,18 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
@Subscribe @Subscribe
public void onGameStateChanged(GameStateChanged gameStateChanged) public void onGameStateChanged(GameStateChanged gameStateChanged)
{ {
if (computeMode == ComputeMode.NONE || gameStateChanged.getGameState() != GameState.LOGGED_IN) switch (gameStateChanged.getGameState())
{ {
return; case LOGGED_IN:
if (computeMode != ComputeMode.NONE)
{
invokeOnMainThread(this::uploadScene);
}
break;
case LOGIN_SCREEN:
// Avoid drawing the last frame's buffer during LOADING after LOGIN_SCREEN
targetBufferOffset = 0;
} }
invokeOnMainThread(this::uploadScene);
} }
private void uploadScene() private void uploadScene()