From be852ec9a12d53015c0e91651f7fb2c4e05c57ee Mon Sep 17 00:00:00 2001 From: George Wright Date: Tue, 28 Apr 2020 14:15:56 -0700 Subject: [PATCH] Set the max Vulkan API version when creating the GrContext (flutter/engine#18007) --- .../platform/fuchsia/flutter/vulkan_surface_producer.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc index c69bfad6d3..a32d50e360 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc @@ -118,12 +118,18 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) { backend_context.fGraphicsQueueIndex = logical_device_->GetGraphicsQueueIndex(); backend_context.fMinAPIVersion = application_->GetAPIVersion(); + backend_context.fMaxAPIVersion = application_->GetAPIVersion(); backend_context.fFeatures = skia_features; backend_context.fGetProc = std::move(getProc); backend_context.fOwnsInstanceAndDevice = false; context_ = GrContext::MakeVulkan(backend_context); + if (context_ == nullptr) { + FML_LOG(ERROR) << "Failed to create GrContext."; + return false; + } + // Use local limits specified in this file above instead of flutter defaults. context_->setResourceCacheLimits(kGrCacheMaxCount, kGrCacheMaxByteSize);