Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
skgpu::VulkanExtensions Class Reference

#include <VulkanExtensions.h>

Classes

struct  Info
 

Public Member Functions

 VulkanExtensions ()
 
void init (VulkanGetProc, VkInstance, VkPhysicalDevice, uint32_t instanceExtensionCount, const char *const *instanceExtensions, uint32_t deviceExtensionCount, const char *const *deviceExtensions)
 
bool hasExtension (const char[], uint32_t minVersion) const
 

Detailed Description

Helper class that eats in an array of extensions strings for instance and device and allows for quicker querying if an extension is present.

Definition at line 27 of file VulkanExtensions.h.

Constructor & Destructor Documentation

◆ VulkanExtensions()

skgpu::VulkanExtensions::VulkanExtensions ( )
inline

Definition at line 29 of file VulkanExtensions.h.

29{}

Member Function Documentation

◆ hasExtension()

bool skgpu::VulkanExtensions::hasExtension ( const char  ext[],
uint32_t  minVersion 
) const

Definition at line 130 of file VulkanExtensions.cpp.

130 {
131 int idx = find_info(fExtensions, ext);
132 return idx >= 0 && fExtensions[idx].fSpecVersion >= minVersion;
133}
static int find_info(const TArray< VulkanExtensions::Info > &infos, const char ext[])

◆ init()

void skgpu::VulkanExtensions::init ( VulkanGetProc  getProc,
VkInstance  instance,
VkPhysicalDevice  physDev,
uint32_t  instanceExtensionCount,
const char *const *  instanceExtensions,
uint32_t  deviceExtensionCount,
const char *const *  deviceExtensions 
)

Definition at line 39 of file VulkanExtensions.cpp.

45 {
46 for (uint32_t i = 0; i < instanceExtensionCount; ++i) {
47 const char* extension = instanceExtensions[i];
48 // if not already in the list, add it
49 if (find_info(fExtensions, extension) < 0) {
50 fExtensions.push_back() = Info(extension);
51 SkTQSort(fExtensions.begin(), fExtensions.end(), extension_compare);
52 }
53 }
54 for (uint32_t i = 0; i < deviceExtensionCount; ++i) {
55 const char* extension = deviceExtensions[i];
56 // if not already in the list, add it
57 if (find_info(fExtensions, extension) < 0) {
58 fExtensions.push_back() = Info(extension);
59 SkTQSort(fExtensions.begin(), fExtensions.end(), extension_compare);
60 }
61 }
62 this->getSpecVersions(std::move(getProc), instance, physDev);
63}
void SkTQSort(T *begin, T *end, const C &lessThan)
Definition: SkTSort.h:194
VkInstance instance
Definition: main.cc:48
Definition: 3d.cpp:16

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