Flutter Engine
The Flutter Engine
vulkan_provider.h
Go to the documentation of this file.
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#ifndef FLUTTER_VULKAN_VULKAN_PROVIDER_H_
6#define FLUTTER_VULKAN_VULKAN_PROVIDER_H_
7
8#include "flutter/vulkan/procs/vulkan_handle.h"
9#include "flutter/vulkan/procs/vulkan_proc_table.h"
10
11namespace vulkan {
12
14 public:
15 virtual const vulkan::VulkanProcTable& vk() = 0;
17
19 const VkFenceCreateInfo create_info = {
21 .pNext = nullptr,
22 .flags = 0,
23 };
24 VkFence fence;
25 if (VK_CALL_LOG_ERROR(vk().CreateFence(vk_device(), &create_info, nullptr,
26 &fence)) != VK_SUCCESS)
28
29 return VulkanHandle<VkFence>{fence, [this](VkFence fence) {
30 vk().DestroyFence(vk_device(), fence,
31 nullptr);
32 }};
33 }
34};
35
36} // namespace vulkan
37
38#endif // FLUTTER_VULKAN_VULKAN_PROVIDER_H_
vulkan::VulkanHandle< VkFence > CreateFence()
virtual const vulkan::VulkanProcTable & vk()=0
virtual const vulkan::VulkanHandle< VkDevice > & vk_device()=0
VkStructureType sType
Definition: vulkan_core.h:3386
@ VK_SUCCESS
Definition: vulkan_core.h:141
@ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
Definition: vulkan_core.h:210
#define VK_CALL_LOG_ERROR(expression)