• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/vulkan/vulkan_provider.h"
6 
7 namespace vulkan {
8 
CreateFence()9 vulkan::VulkanHandle<VkFence> VulkanProvider::CreateFence() {
10   const VkFenceCreateInfo create_info = {
11       .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
12       .pNext = nullptr,
13       .flags = 0,
14   };
15   VkFence fence;
16   if (VK_CALL_LOG_ERROR(vk().CreateFence(vk_device(), &create_info, nullptr,
17                                          &fence)) != VK_SUCCESS)
18     return vulkan::VulkanHandle<VkFence>();
19 
20   return {fence, [this](VkFence fence) {
21             vk().DestroyFence(vk_device(), fence, nullptr);
22           }};
23 }
24 
25 }  // namespace vulkan
26