提交 a26700ce 编写于 作者: F freiling 提交者: GitHub

[MA-216] fix vulkan teardown order (#3666)

上级 29531fb1
......@@ -393,6 +393,9 @@ bool VulkanRasterizer::VulkanSurfaceProducer::Initialize() {
backend_context_->fFeatures = skia_features;
backend_context_->fInterface.reset(interface.release());
logical_device_->ReleaseDeviceOwnership();
application_->ReleaseInstanceOwnership();
context_.reset(GrContext::Create(
kVulkan_GrBackend,
reinterpret_cast<GrBackendContext>(backend_context_.get())));
......
......@@ -96,10 +96,16 @@ class VulkanRasterizer : public Rasterizer {
static_cast<uint64_t>(height);
}
// Note: the order here is very important. The proctable bust be destroyed
// last because it contains the function pointers for VkDestroyDevice and
// VkDestroyInstance. The backend context owns the VkDevice and the
// VkInstance, so it must be destroyed after the logical device and the
// application, which own other vulkan objects associated with the device
// and instance
ftl::RefPtr<vulkan::VulkanProcTable> vk_;
std::unique_ptr<vulkan::VulkanApplication> application_;
std::unique_ptr<vulkan::VulkanDevice> logical_device_;
sk_sp<GrVkBackendContext> backend_context_;
std::unique_ptr<vulkan::VulkanDevice> logical_device_;
std::unique_ptr<vulkan::VulkanApplication> application_;
sk_sp<GrContext> context_;
// These three containers hold surfaces in various stages of recycling
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册