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,13 +1437,19 @@ 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())
{
case LOGGED_IN:
if (computeMode != ComputeMode.NONE)
{ {
return;
}
invokeOnMainThread(this::uploadScene); invokeOnMainThread(this::uploadScene);
} }
break;
case LOGIN_SCREEN:
// Avoid drawing the last frame's buffer during LOADING after LOGIN_SCREEN
targetBufferOffset = 0;
}
}
private void uploadScene() private void uploadScene()
{ {