소스 검색

Recreate the Vulkan GPU swap chain when resuming on Android

Fixes https://github.com/libsdl-org/SDL/issues/12957

(cherry picked from commit 2a92a3c9c551de1f77084ce409d345f6da01ee05)
Sam Lantinga 6 달 전
부모
커밋
78756540cb
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/gpu/vulkan/SDL_gpu_vulkan.c

+ 7 - 0
src/gpu/vulkan/SDL_gpu_vulkan.c

@@ -9685,6 +9685,13 @@ static bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e)
         data->swapchainCreateHeight = e->window.data2;
     }
 
+#ifdef SDL_PLATFORM_ANDROID
+    if (e->type == SDL_EVENT_DID_ENTER_BACKGROUND) {
+        data = VULKAN_INTERNAL_FetchWindowData(w);
+        data->needsSwapchainRecreate = true;
+    }
+#endif
+
     return true;
 }