Flutter Engine
vulkan::VulkanProcTable Class Reference

#include <vulkan_proc_table.h>

Inheritance diagram for vulkan::VulkanProcTable:
fml::RefCountedThreadSafe< VulkanProcTable > fml::internal::RefCountedThreadSafeBase

Classes

class  Proc
 

Public Member Functions

bool HasAcquiredMandatoryProcAddresses () const
 
bool IsValid () const
 
bool AreInstanceProcsSetup () const
 
bool AreDeviceProcsSetup () const
 
bool SetupInstanceProcAddresses (const VulkanHandle< VkInstance > &instance)
 
bool SetupDeviceProcAddresses (const VulkanHandle< VkDevice > &device)
 
GrVkGetProc CreateSkiaGetProc () const
 
 DEFINE_PROC (AcquireNextImageKHR)
 
 DEFINE_PROC (AllocateCommandBuffers)
 
 DEFINE_PROC (AllocateMemory)
 
 DEFINE_PROC (BeginCommandBuffer)
 
 DEFINE_PROC (BindImageMemory)
 
 DEFINE_PROC (CmdPipelineBarrier)
 
 DEFINE_PROC (CreateCommandPool)
 
 DEFINE_PROC (CreateDebugReportCallbackEXT)
 
 DEFINE_PROC (CreateDevice)
 
 DEFINE_PROC (CreateFence)
 
 DEFINE_PROC (CreateImage)
 
 DEFINE_PROC (CreateInstance)
 
 DEFINE_PROC (CreateSemaphore)
 
 DEFINE_PROC (CreateSwapchainKHR)
 
 DEFINE_PROC (DestroyCommandPool)
 
 DEFINE_PROC (DestroyDebugReportCallbackEXT)
 
 DEFINE_PROC (DestroyDevice)
 
 DEFINE_PROC (DestroyFence)
 
 DEFINE_PROC (DestroyImage)
 
 DEFINE_PROC (DestroyInstance)
 
 DEFINE_PROC (DestroySemaphore)
 
 DEFINE_PROC (DestroySurfaceKHR)
 
 DEFINE_PROC (DestroySwapchainKHR)
 
 DEFINE_PROC (DeviceWaitIdle)
 
 DEFINE_PROC (EndCommandBuffer)
 
 DEFINE_PROC (EnumerateDeviceLayerProperties)
 
 DEFINE_PROC (EnumerateInstanceExtensionProperties)
 
 DEFINE_PROC (EnumerateInstanceLayerProperties)
 
 DEFINE_PROC (EnumeratePhysicalDevices)
 
 DEFINE_PROC (FreeCommandBuffers)
 
 DEFINE_PROC (FreeMemory)
 
 DEFINE_PROC (GetDeviceProcAddr)
 
 DEFINE_PROC (GetDeviceQueue)
 
 DEFINE_PROC (GetImageMemoryRequirements)
 
 DEFINE_PROC (GetInstanceProcAddr)
 
 DEFINE_PROC (GetPhysicalDeviceFeatures)
 
 DEFINE_PROC (GetPhysicalDeviceQueueFamilyProperties)
 
 DEFINE_PROC (QueueSubmit)
 
 DEFINE_PROC (QueueWaitIdle)
 
 DEFINE_PROC (ResetCommandBuffer)
 
 DEFINE_PROC (ResetFences)
 
 DEFINE_PROC (WaitForFences)
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< VulkanProcTable >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 

Additional Inherited Members

- Protected Member Functions inherited from fml::RefCountedThreadSafe< VulkanProcTable >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 

Detailed Description

Definition at line 18 of file vulkan_proc_table.h.

Member Function Documentation

◆ AreDeviceProcsSetup()

bool vulkan::VulkanProcTable::AreDeviceProcsSetup ( ) const

Definition at line 41 of file vulkan_proc_table.cc.

References ACQUIRE_PROC, and FML_DLOG.

Referenced by vulkan::VulkanProcTable::Proc< T >::operator T().

41  {
42  return device_;
43 }

◆ AreInstanceProcsSetup()

bool vulkan::VulkanProcTable::AreInstanceProcsSetup ( ) const

Definition at line 37 of file vulkan_proc_table.cc.

Referenced by vulkan::VulkanProcTable::Proc< T >::operator T(), and vulkan::VulkanDevice::VulkanDevice().

37  {
38  return instance_;
39 }

◆ CreateSkiaGetProc()

GrVkGetProc vulkan::VulkanProcTable::CreateSkiaGetProc ( ) const

Definition at line 202 of file vulkan_proc_table.cc.

References IsValid().

Referenced by vulkan::VulkanProcTable::Proc< T >::operator T().

202  {
203  if (!IsValid()) {
204  return nullptr;
205  }
206 
207  return [this](const char* proc_name, VkInstance instance, VkDevice device) {
208  if (device != VK_NULL_HANDLE) {
209  auto result = AcquireProc(proc_name, {device, nullptr});
210  if (result != nullptr) {
211  return result;
212  }
213  }
214 
215  return AcquireProc(proc_name, {instance, nullptr});
216  };
217 }

◆ DEFINE_PROC() [1/42]

vulkan::VulkanProcTable::DEFINE_PROC ( AcquireNextImageKHR  )

◆ DEFINE_PROC() [2/42]

vulkan::VulkanProcTable::DEFINE_PROC ( AllocateCommandBuffers  )

◆ DEFINE_PROC() [3/42]

vulkan::VulkanProcTable::DEFINE_PROC ( AllocateMemory  )

◆ DEFINE_PROC() [4/42]

vulkan::VulkanProcTable::DEFINE_PROC ( BeginCommandBuffer  )

◆ DEFINE_PROC() [5/42]

vulkan::VulkanProcTable::DEFINE_PROC ( BindImageMemory  )

◆ DEFINE_PROC() [6/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CmdPipelineBarrier  )

◆ DEFINE_PROC() [7/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateCommandPool  )

◆ DEFINE_PROC() [8/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateDebugReportCallbackEXT  )

◆ DEFINE_PROC() [9/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateDevice  )

◆ DEFINE_PROC() [10/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateFence  )

◆ DEFINE_PROC() [11/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateImage  )

◆ DEFINE_PROC() [12/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateInstance  )

◆ DEFINE_PROC() [13/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateSemaphore  )

◆ DEFINE_PROC() [14/42]

vulkan::VulkanProcTable::DEFINE_PROC ( CreateSwapchainKHR  )

◆ DEFINE_PROC() [15/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroyCommandPool  )

◆ DEFINE_PROC() [16/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroyDebugReportCallbackEXT  )

◆ DEFINE_PROC() [17/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroyDevice  )

◆ DEFINE_PROC() [18/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroyFence  )

◆ DEFINE_PROC() [19/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroyImage  )

◆ DEFINE_PROC() [20/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroyInstance  )

◆ DEFINE_PROC() [21/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroySemaphore  )

◆ DEFINE_PROC() [22/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroySurfaceKHR  )

◆ DEFINE_PROC() [23/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DestroySwapchainKHR  )

◆ DEFINE_PROC() [24/42]

vulkan::VulkanProcTable::DEFINE_PROC ( DeviceWaitIdle  )

◆ DEFINE_PROC() [25/42]

vulkan::VulkanProcTable::DEFINE_PROC ( EndCommandBuffer  )

◆ DEFINE_PROC() [26/42]

vulkan::VulkanProcTable::DEFINE_PROC ( EnumerateDeviceLayerProperties  )

◆ DEFINE_PROC() [27/42]

vulkan::VulkanProcTable::DEFINE_PROC ( EnumerateInstanceExtensionProperties  )

◆ DEFINE_PROC() [28/42]

vulkan::VulkanProcTable::DEFINE_PROC ( EnumerateInstanceLayerProperties  )

◆ DEFINE_PROC() [29/42]

vulkan::VulkanProcTable::DEFINE_PROC ( EnumeratePhysicalDevices  )

◆ DEFINE_PROC() [30/42]

vulkan::VulkanProcTable::DEFINE_PROC ( FreeCommandBuffers  )

◆ DEFINE_PROC() [31/42]

vulkan::VulkanProcTable::DEFINE_PROC ( FreeMemory  )

◆ DEFINE_PROC() [32/42]

vulkan::VulkanProcTable::DEFINE_PROC ( GetDeviceProcAddr  )

◆ DEFINE_PROC() [33/42]

vulkan::VulkanProcTable::DEFINE_PROC ( GetDeviceQueue  )

◆ DEFINE_PROC() [34/42]

vulkan::VulkanProcTable::DEFINE_PROC ( GetImageMemoryRequirements  )

◆ DEFINE_PROC() [35/42]

vulkan::VulkanProcTable::DEFINE_PROC ( GetInstanceProcAddr  )

◆ DEFINE_PROC() [36/42]

vulkan::VulkanProcTable::DEFINE_PROC ( GetPhysicalDeviceFeatures  )

◆ DEFINE_PROC() [37/42]

vulkan::VulkanProcTable::DEFINE_PROC ( GetPhysicalDeviceQueueFamilyProperties  )

◆ DEFINE_PROC() [38/42]

vulkan::VulkanProcTable::DEFINE_PROC ( QueueSubmit  )

◆ DEFINE_PROC() [39/42]

vulkan::VulkanProcTable::DEFINE_PROC ( QueueWaitIdle  )

◆ DEFINE_PROC() [40/42]

vulkan::VulkanProcTable::DEFINE_PROC ( ResetCommandBuffer  )

◆ DEFINE_PROC() [41/42]

vulkan::VulkanProcTable::DEFINE_PROC ( ResetFences  )

◆ DEFINE_PROC() [42/42]

vulkan::VulkanProcTable::DEFINE_PROC ( WaitForFences  )

◆ HasAcquiredMandatoryProcAddresses()

bool vulkan::VulkanProcTable::HasAcquiredMandatoryProcAddresses ( ) const

Definition at line 29 of file vulkan_proc_table.cc.

Referenced by flutter::AndroidSurfaceVulkan::IsValid(), and vulkan::VulkanProcTable::Proc< T >::operator T().

29  {
30  return acquired_mandatory_proc_addresses_;
31 }

◆ IsValid()

bool vulkan::VulkanProcTable::IsValid ( ) const

Definition at line 33 of file vulkan_proc_table.cc.

Referenced by CreateSkiaGetProc(), vulkan::VulkanNativeSurfaceAndroid::CreateSurfaceHandle(), and vulkan::VulkanProcTable::Proc< T >::operator T().

33  {
34  return instance_ && device_;
35 }

◆ SetupDeviceProcAddresses()

bool vulkan::VulkanProcTable::SetupDeviceProcAddresses ( const VulkanHandle< VkDevice > &  device)

Definition at line 106 of file vulkan_proc_table.cc.

References ACQUIRE_PROC, and FML_DLOG.

Referenced by vulkan::VulkanProcTable::Proc< T >::operator T(), and vulkan::VulkanDevice::VulkanDevice().

107  {
108  ACQUIRE_PROC(AllocateCommandBuffers, handle);
109  ACQUIRE_PROC(AllocateMemory, handle);
110  ACQUIRE_PROC(BeginCommandBuffer, handle);
111  ACQUIRE_PROC(BindImageMemory, handle);
112  ACQUIRE_PROC(CmdPipelineBarrier, handle);
113  ACQUIRE_PROC(CreateCommandPool, handle);
114  ACQUIRE_PROC(CreateFence, handle);
115  ACQUIRE_PROC(CreateImage, handle);
116  ACQUIRE_PROC(CreateSemaphore, handle);
117  ACQUIRE_PROC(DestroyCommandPool, handle);
118  ACQUIRE_PROC(DestroyFence, handle);
119  ACQUIRE_PROC(DestroyImage, handle);
120  ACQUIRE_PROC(DestroySemaphore, handle);
121  ACQUIRE_PROC(DeviceWaitIdle, handle);
122  ACQUIRE_PROC(EndCommandBuffer, handle);
123  ACQUIRE_PROC(FreeCommandBuffers, handle);
124  ACQUIRE_PROC(FreeMemory, handle);
125  ACQUIRE_PROC(GetDeviceQueue, handle);
126  ACQUIRE_PROC(GetImageMemoryRequirements, handle);
127  ACQUIRE_PROC(QueueSubmit, handle);
128  ACQUIRE_PROC(QueueWaitIdle, handle);
129  ACQUIRE_PROC(ResetCommandBuffer, handle);
130  ACQUIRE_PROC(ResetFences, handle);
131  ACQUIRE_PROC(WaitForFences, handle);
132 #if OS_ANDROID
133  ACQUIRE_PROC(AcquireNextImageKHR, handle);
134  ACQUIRE_PROC(CreateSwapchainKHR, handle);
135  ACQUIRE_PROC(DestroySwapchainKHR, handle);
136  ACQUIRE_PROC(GetSwapchainImagesKHR, handle);
137  ACQUIRE_PROC(QueuePresentKHR, handle);
138 #endif // OS_ANDROID
139 #if OS_FUCHSIA
140  ACQUIRE_PROC(GetMemoryZirconHandleFUCHSIA, handle);
141  ACQUIRE_PROC(ImportSemaphoreZirconHandleFUCHSIA, handle);
142 #endif // OS_FUCHSIA
143  device_ = {handle, nullptr};
144  return true;
145 }
#define ACQUIRE_PROC(name, context)

◆ SetupInstanceProcAddresses()

bool vulkan::VulkanProcTable::SetupInstanceProcAddresses ( const VulkanHandle< VkInstance > &  instance)

Definition at line 72 of file vulkan_proc_table.cc.

References ACQUIRE_PROC.

Referenced by vulkan::VulkanProcTable::Proc< T >::operator T(), and vulkan::VulkanApplication::VulkanApplication().

73  {
74  ACQUIRE_PROC(CreateDevice, handle);
75  ACQUIRE_PROC(DestroyDevice, handle);
76  ACQUIRE_PROC(DestroyInstance, handle);
77  ACQUIRE_PROC(EnumerateDeviceLayerProperties, handle);
78  ACQUIRE_PROC(EnumeratePhysicalDevices, handle);
79  ACQUIRE_PROC(GetDeviceProcAddr, handle);
80  ACQUIRE_PROC(GetPhysicalDeviceFeatures, handle);
81  ACQUIRE_PROC(GetPhysicalDeviceQueueFamilyProperties, handle);
82 #if OS_ANDROID
83  ACQUIRE_PROC(GetPhysicalDeviceSurfaceCapabilitiesKHR, handle);
84  ACQUIRE_PROC(GetPhysicalDeviceSurfaceFormatsKHR, handle);
85  ACQUIRE_PROC(GetPhysicalDeviceSurfacePresentModesKHR, handle);
86  ACQUIRE_PROC(GetPhysicalDeviceSurfaceSupportKHR, handle);
87  ACQUIRE_PROC(DestroySurfaceKHR, handle);
88  ACQUIRE_PROC(CreateAndroidSurfaceKHR, handle);
89 #endif // OS_ANDROID
90 
91  // The debug report functions are optional. We don't want proc acquisition to
92  // fail here because the optional methods were not present (since ACQUIRE_PROC
93  // returns false on failure). Wrap the optional proc acquisitions in an
94  // anonymous lambda and invoke it. We don't really care about the result since
95  // users of Debug reporting functions check for their presence explicitly.
96  [this, &handle]() -> bool {
97  ACQUIRE_PROC(CreateDebugReportCallbackEXT, handle);
98  ACQUIRE_PROC(DestroyDebugReportCallbackEXT, handle);
99  return true;
100  }();
101 
102  instance_ = {handle, nullptr};
103  return true;
104 }
#define ACQUIRE_PROC(name, context)

The documentation for this class was generated from the following files: