Permalink
Browse files

Avoid double-initializing the Vulkan backbuffer on startup.

  • Loading branch information...
hrydgard committed Nov 10, 2017
1 parent ee768ca commit 1c76d288431173460db7df5232cdf3ef7874d609
Showing with 14 additions and 2 deletions.
  1. +1 −1 Core/Core.cpp
  2. +11 −1 UI/NativeApp.cpp
  3. +2 −0 android/jni/app-android.cpp
View
@@ -172,7 +172,7 @@ bool UpdateScreenScale(int width, int height) {
dp_yres = new_dp_yres;
pixel_xres = width;
pixel_yres = height;
INFO_LOG(SYSTEM, "pixel_res: %dx%d", pixel_xres, pixel_yres);
INFO_LOG(SYSTEM, "pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres);
NativeResized();
return true;
}
View
@@ -127,6 +127,8 @@ std::unique_ptr<ManagedTexture> uiTexture;
ScreenManager *screenManager;
std::string config_filename;
bool g_graphicsInited;
#ifdef IOS
bool iosCanUseJit;
bool targetIsJailbroken;
@@ -675,10 +677,13 @@ void NativeInitGraphics(GraphicsContext *graphicsContext) {
#endif
g_gameInfoCache = new GameInfoCache();
g_graphicsInited = true;
ILOG("NativeInitGraphics completed");
}
void NativeShutdownGraphics() {
g_graphicsInited = false;
ILOG("NativeShutdownGraphics");
#ifdef _WIN32
@@ -817,6 +822,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
}
if (resized) {
ILOG("resized was set to true - resizing");
resized = false;
if (uiContext) {
@@ -1072,7 +1078,11 @@ void NativeMessageReceived(const char *message, const char *value) {
void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later.
resized = true;
if (g_graphicsInited) {
resized = true;
} else {
ILOG("NativeResized ignored, not initialized");
}
}
void NativeSetRestarting() {
@@ -773,6 +773,8 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv
if (new_size) {
ILOG("Size change detected (previously %d,%d) - calling NativeResized()", old_w, old_h);
NativeResized();
} else {
ILOG("Size didn't change.");
}
}

0 comments on commit 1c76d28

Please sign in to comment.