Set the max Vulkan API version when creating the GrContext (flutter/engine#18007)

This commit is contained in:
George Wright
2020-04-28 14:15:56 -07:00
committed by GitHub
parent c9b3285fa2
commit be852ec9a1

View File

@@ -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);