Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: src/gpu/vk/GrVkExtensions.h

Issue 1832613003: Revise layer, extension and feature setup for Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove extra def of ENABLE_VK_LAYERS Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkCaps.cpp ('k') | src/gpu/vk/GrVkExtensions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/vk/GrVkCaps.cpp ('k') | src/gpu/vk/GrVkExtensions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698