Skip to content

Commit

Permalink
[CP][Android] Disable SurfaceControl based swapchains.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahwilliams committed Dec 12, 2024
1 parent 83bacfc commit dd600c0
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions impeller/renderer/backend/vulkan/swapchain/swapchain_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,6 @@ std::shared_ptr<SwapchainVK> SwapchainVK::Create(
return nullptr;
}

// TODO(147533): AHB swapchains on emulators are not functional.
auto& context_vk = ContextVK::Cast(*context);
const auto emulator = context_vk.GetDriverInfo()->IsEmulator();
const auto should_disable_sc =
context_vk.GetShouldDisableSurfaceControlSwapchain();

// Try AHB swapchains first.
if (!emulator && AHBSwapchainVK::IsAvailableOnPlatform() &&
!android::ShadowRealm::ShouldDisableAHB() && !should_disable_sc) {
auto ahb_swapchain = std::shared_ptr<AHBSwapchainVK>(new AHBSwapchainVK(
context, //
window.GetHandle(), //
surface, //
window.GetSize(), //
enable_msaa //
));

if (ahb_swapchain->IsValid()) {
return ahb_swapchain;
} else {
VALIDATION_LOG
<< "Could not create AHB swapchain. Falling back to KHR variant.";
}
}

// Fallback to KHR swapchains if AHB swapchains aren't available.
return Create(context, std::move(surface), window.GetSize(), enable_msaa);
}
#endif // FML_OS_ANDROID
Expand Down

0 comments on commit dd600c0

Please sign in to comment.