Transition render target images before submit.
Required by the spec; see '6.7.4. Queue Family Ownership Transfer' of Vulkan 1.0.66. Transitioning the image layout also fixes an image resolve failure issue introduced by optimizations present in the intel mesa vulkan driver v17.2.
This commit is contained in:
25
engine/src/flutter/vulkan/vulkan_provider.cc
Normal file
25
engine/src/flutter/vulkan/vulkan_provider.cc
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "flutter/vulkan/vulkan_provider.h"
|
||||
|
||||
namespace vulkan {
|
||||
|
||||
vulkan::VulkanHandle<VkFence> VulkanProvider::CreateFence() {
|
||||
const VkFenceCreateInfo create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
};
|
||||
VkFence fence;
|
||||
if (VK_CALL_LOG_ERROR(vk().CreateFence(vk_device(), &create_info, nullptr,
|
||||
&fence)) != VK_SUCCESS)
|
||||
return vulkan::VulkanHandle<VkFence>();
|
||||
|
||||
return {fence, [this](VkFence fence) {
|
||||
vk().DestroyFence(vk_device(), fence, nullptr);
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace vulkan
|
||||
@@ -13,6 +13,22 @@ class VulkanProvider {
|
||||
public:
|
||||
virtual const vulkan::VulkanProcTable& vk() = 0;
|
||||
virtual const vulkan::VulkanHandle<VkDevice>& vk_device() = 0;
|
||||
|
||||
vulkan::VulkanHandle<VkFence> CreateFence() {
|
||||
const VkFenceCreateInfo create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
};
|
||||
VkFence fence;
|
||||
if (VK_CALL_LOG_ERROR(vk().CreateFence(vk_device(), &create_info, nullptr,
|
||||
&fence)) != VK_SUCCESS)
|
||||
return vulkan::VulkanHandle<VkFence>();
|
||||
|
||||
return {fence, [this](VkFence fence) {
|
||||
vk().DestroyFence(vk_device(), fence, nullptr);
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace vulkan
|
||||
|
||||
Reference in New Issue
Block a user