aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-03-25 06:29:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-25 06:29:52 -0700
commitfd7bd45ac2178ce6b4a390f517f605750aaef6c8 (patch)
treedd69d7228d7d4b4834035b4c141add63adb5f6ea /include/gpu
parent64d094d7756534a9b9b0997aab225d9ceba098b6 (diff)
Revise layer, extension and feature setup for Vulkan
Moves all the extension setup logic into GrVkBackendContext, and pass extension and feature information to Skia via flags. Also adds version information to GrVkBackendContext. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1832613003 TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1832613003
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/vk/GrVkBackendContext.h14
-rw-r--r--include/gpu/vk/GrVkInterface.h21
2 files changed, 16 insertions, 19 deletions
diff --git a/include/gpu/vk/GrVkBackendContext.h b/include/gpu/vk/GrVkBackendContext.h
index 6d45a2045d..8f4ba04584 100644
--- a/include/gpu/vk/GrVkBackendContext.h
+++ b/include/gpu/vk/GrVkBackendContext.h
@@ -18,6 +18,17 @@
struct GrVkInterface;
+enum GrVkExtensionFlags {
+ kEXT_debug_report_GrVkExtensionFlag = 0x0001,
+ kNV_glsl_shader_GrVkExtensionFlag = 0x0002,
+};
+
+enum GrVkFeatureFlags {
+ kGeometryShader_GrVkFeatureFlag = 0x0001,
+ kDualSrcBlend_GrVkFeatureFlag = 0x0002,
+ kSampleRateShading_GrVkFeatureFlag = 0x0004,
+};
+
// The BackendContext contains all of the base Vulkan objects needed by the GrVkGpu. The assumption
// is that the client will set these up and pass them to the GrVkGpu constructor. The VkDevice
// created must support at least one graphics queue, which is passed in as well.
@@ -30,6 +41,9 @@ struct GrVkBackendContext : public SkRefCnt {
VkDevice fDevice;
VkQueue fQueue;
uint32_t fQueueFamilyIndex;
+ uint32_t fMinAPIVersion;
+ uint32_t fExtensions;
+ uint32_t fFeatures;
SkAutoTUnref<const GrVkInterface> fInterface;
// Helper function to create the default Vulkan objects needed by the GrVkGpu object
diff --git a/include/gpu/vk/GrVkInterface.h b/include/gpu/vk/GrVkInterface.h
index cfab979bd7..e36bfb1a02 100644
--- a/include/gpu/vk/GrVkInterface.h
+++ b/include/gpu/vk/GrVkInterface.h
@@ -10,8 +10,6 @@
#include "SkRefCnt.h"
-#include "GrVkExtensions.h"
-
#include "vulkan/vulkan.h"
////////////////////////////////////////////////////////////////////////////////
@@ -26,8 +24,8 @@ struct GrVkInterface;
/**
* Creates a GrVkInterface.
*/
-const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkPhysicalDevice physDev,
- VkDevice device);
+const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device,
+ uint32_t extensionFlags);
/**
@@ -57,21 +55,6 @@ public:
// function pointers have been initialized for Vulkan version.
bool validate() const;
- GrVkExtensions fExtensions;
-
- bool hasInstanceExtension(const char ext[]) const {
- return fExtensions.hasInstanceExtension(ext);
- }
- bool hasDeviceExtension(const char ext[]) const {
- return fExtensions.hasDeviceExtension(ext);
- }
- bool hasInstanceLayer(const char ext[]) const {
- return fExtensions.hasInstanceLayer(ext);
- }
- bool hasDeviceLayer(const char ext[]) const {
- return fExtensions.hasDeviceLayer(ext);
- }
-
/**
* The function pointers are in a struct so that we can have a compiler generated assignment
* operator.