Index: src/gpu/vk/GrVkExtensions.h |
diff --git a/src/gpu/vk/GrVkExtensions.h b/src/gpu/vk/GrVkExtensions.h |
index a165730444bec63a5148c09456558a5eb0f49016..cc56076a7d8a60679265eece955056324db059e3 100644 |
--- a/src/gpu/vk/GrVkExtensions.h |
+++ b/src/gpu/vk/GrVkExtensions.h |
@@ -13,77 +13,30 @@ |
#include "vulkan/vulkan.h" |
/** |
- * This helper queries the current Vulkan context for its extensions and layers, remembers them, |
+ * This helper queries the Vulkan driver for available extensions and layers, remembers them, |
* and can be queried. It supports queries for both instance and device extensions and layers. |
*/ |
class SK_API GrVkExtensions { |
public: |
- GrVkExtensions() : fInitialized(false) |
- , fInstanceExtensionStrings(new SkTArray<SkString>) |
+ GrVkExtensions() : fInstanceExtensionStrings(new SkTArray<SkString>) |
, fDeviceExtensionStrings(new SkTArray<SkString>) |
, fInstanceLayerStrings(new SkTArray<SkString>) |
, fDeviceLayerStrings(new SkTArray<SkString>) {} |
- |
- GrVkExtensions(const GrVkExtensions&); |
- |
- GrVkExtensions& operator=(const GrVkExtensions&); |
- |
- void swap(GrVkExtensions* that) { |
- fInstanceExtensionStrings.swap(that->fInstanceExtensionStrings); |
- fDeviceExtensionStrings.swap(that->fDeviceExtensionStrings); |
- fInstanceLayerStrings.swap(that->fInstanceLayerStrings); |
- fDeviceLayerStrings.swap(that->fDeviceLayerStrings); |
- |
- SkTSwap(fInitialized, that->fInitialized); |
- } |
- |
- /** |
- * We sometimes need to use this class without having yet created a GrVkInterface. |
- */ |
- bool init(uint32_t specVersion, |
- VkPhysicalDevice physDev, |
- PFN_vkEnumerateInstanceExtensionProperties enumerateInstanceExtensionProperties, |
- PFN_vkEnumerateDeviceExtensionProperties enumerateDeviceExtensionProperties, |
- PFN_vkEnumerateInstanceLayerProperties enumerateInstanceLayerProperties, |
- PFN_vkEnumerateDeviceLayerProperties enumerateDeviceLayerProperties); |
- |
- bool isInitialized() const { return fInitialized; } |
+ |
+ bool initInstance(uint32_t specVersion); |
+ bool initDevice(uint32_t specVersion, VkInstance, VkPhysicalDevice); |
/** |
- * Queries whether an extension or layer is present. Will fail if init() has not been called. |
+ * Queries whether an extension or layer is present. Will fail if not initialized. |
*/ |
bool hasInstanceExtension(const char[]) const; |
bool hasDeviceExtension(const char[]) const; |
bool hasInstanceLayer(const char[]) const; |
bool hasDeviceLayer(const char[]) const; |
- /** |
- * Removes an extension or layer if present. Returns true if it was present before the call. |
- */ |
- bool removeInstanceExtension(const char[]); |
- bool removeDeviceExtension(const char[]); |
- bool removeInstanceLayer(const char[]); |
- bool removeDeviceLayer(const char[]); |
- |
- /** |
- * Adds an extension or layer to list |
- */ |
- void addInstanceExtension(const char[]); |
- void addDeviceExtension(const char[]); |
- void addInstanceLayer(const char[]); |
- void addDeviceLayer(const char[]); |
- |
- void reset() { |
- fInstanceExtensionStrings->reset(); |
- fDeviceExtensionStrings->reset(); |
- fInstanceLayerStrings->reset(); |
- fDeviceLayerStrings->reset(); |
- } |
- |
void print(const char* sep = "\n") const; |
private: |
- bool fInitialized; |
SkAutoTDelete<SkTArray<SkString> > fInstanceExtensionStrings; |
SkAutoTDelete<SkTArray<SkString> > fDeviceExtensionStrings; |
SkAutoTDelete<SkTArray<SkString> > fInstanceLayerStrings; |