diff options
| author | JosJuice <josjuice@gmail.com> | 2020-01-31 15:57:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-31 15:57:58 +0100 |
| commit | 534547ee8bad907a2fe94ff35688623840280b8b (patch) | |
| tree | dab4284922bb8b956c8bded02928749ee8abbd48 /Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp | |
| parent | 996ab90e3c1f59ec0f4b97da3b828379b3ca475e (diff) | |
| parent | 08cc73108a2b77c2918610b7e521d2deb847a2ba (diff) | |
Merge pull request #8595 from stenzek/android-10-vulkan-suboptimal
Vulkan: Treat VK_SUBOPTIMAL_KHR as VK_SUCCESS on Android
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp index 59382166a9..e51831455e 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp @@ -375,12 +375,21 @@ void CommandBufferManager::SubmitCommandBuffer(u32 command_buffer_index, if (m_last_present_result != VK_SUCCESS) { // VK_ERROR_OUT_OF_DATE_KHR is not fatal, just means we need to recreate our swap chain. - if (m_last_present_result != VK_ERROR_OUT_OF_DATE_KHR && res != VK_SUBOPTIMAL_KHR && + if (m_last_present_result != VK_ERROR_OUT_OF_DATE_KHR && + m_last_present_result != VK_SUBOPTIMAL_KHR && m_last_present_result != VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT) { LOG_VULKAN_ERROR(m_last_present_result, "vkQueuePresentKHR failed: "); } + + // Don't treat VK_SUBOPTIMAL_KHR as fatal on Android. Android 10+ requires prerotation. + // See https://twitter.com/Themaister/status/1207062674011574273 +#ifdef VK_USE_PLATFORM_ANDROID_KHR + if (m_last_present_result != VK_SUBOPTIMAL_KHR) + m_last_present_failed.Set(); +#else m_last_present_failed.Set(); +#endif } } |
