aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_app/VulkanWindowContext.h
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-07-12 10:02:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-12 14:35:08 +0000
commitc8cd45aaf43c5d044d8433d38c8332b1679eeadb (patch)
tree065475875fe983972a8a704ae340aa45bbe0150c /tools/sk_app/VulkanWindowContext.h
parent77c138f2cd41cbb0e43985bb458f21455fead646 (diff)
Generate GrVkInterface when we make the GrVkGpu.
Also add a GetProc function to the GrVkBackendContext which will be used to create the GrVkInterface. This change (and updating clients to use it), will allow us to move GrVkInterface out of public which is needed to fix vulkan header issues. Bug: skia: Change-Id: Id8067943ae27cec8cad29fd31b05f0b8387412d4 Reviewed-on: https://skia-review.googlesource.com/140783 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/sk_app/VulkanWindowContext.h')
-rw-r--r--tools/sk_app/VulkanWindowContext.h48
1 files changed, 19 insertions, 29 deletions
diff --git a/tools/sk_app/VulkanWindowContext.h b/tools/sk_app/VulkanWindowContext.h
index 3d9687b674..2e01e291b7 100644
--- a/tools/sk_app/VulkanWindowContext.h
+++ b/tools/sk_app/VulkanWindowContext.h
@@ -70,42 +70,32 @@ private:
VkDevice fDevice = VK_NULL_HANDLE;
VkDebugReportCallbackEXT fDebugCallback = VK_NULL_HANDLE;
- // simple wrapper class that exists only to initialize a pointer to NULL
- template <typename FNPTR_TYPE> class VkPtr {
- public:
- VkPtr() : fPtr(NULL) {}
- VkPtr operator=(FNPTR_TYPE ptr) { fPtr = ptr; return *this; }
- operator FNPTR_TYPE() const { return fPtr; }
- private:
- FNPTR_TYPE fPtr;
- };
-
// Create functions
CreateVkSurfaceFn fCreateVkSurfaceFn;
CanPresentFn fCanPresentFn;
// Vulkan GetProcAddr functions
- VkPtr<PFN_vkGetInstanceProcAddr> fGetInstanceProcAddr;
- VkPtr<PFN_vkGetDeviceProcAddr> fGetDeviceProcAddr;
+ PFN_vkGetInstanceProcAddr fGetInstanceProcAddr = nullptr;
+ PFN_vkGetDeviceProcAddr fGetDeviceProcAddr = nullptr;
// WSI interface functions
- VkPtr<PFN_vkDestroySurfaceKHR> fDestroySurfaceKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfaceSupportKHR> fGetPhysicalDeviceSurfaceSupportKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR> fGetPhysicalDeviceSurfaceCapabilitiesKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR> fGetPhysicalDeviceSurfaceFormatsKHR;
- VkPtr<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR> fGetPhysicalDeviceSurfacePresentModesKHR;
-
- VkPtr<PFN_vkCreateSwapchainKHR> fCreateSwapchainKHR;
- VkPtr<PFN_vkDestroySwapchainKHR> fDestroySwapchainKHR;
- VkPtr<PFN_vkGetSwapchainImagesKHR> fGetSwapchainImagesKHR;
- VkPtr<PFN_vkAcquireNextImageKHR> fAcquireNextImageKHR;
- VkPtr<PFN_vkQueuePresentKHR> fQueuePresentKHR;
-
- VkPtr<PFN_vkDestroyInstance> fDestroyInstance;
- VkPtr<PFN_vkDeviceWaitIdle> fDeviceWaitIdle;
- VkPtr<PFN_vkQueueWaitIdle> fQueueWaitIdle;
- VkPtr<PFN_vkDestroyDevice> fDestroyDevice;
- VkPtr<PFN_vkGetDeviceQueue> fGetDeviceQueue;
+ PFN_vkDestroySurfaceKHR fDestroySurfaceKHR = nullptr;
+ PFN_vkGetPhysicalDeviceSurfaceSupportKHR fGetPhysicalDeviceSurfaceSupportKHR = nullptr;
+ PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR fGetPhysicalDeviceSurfaceCapabilitiesKHR =nullptr;
+ PFN_vkGetPhysicalDeviceSurfaceFormatsKHR fGetPhysicalDeviceSurfaceFormatsKHR = nullptr;
+ PFN_vkGetPhysicalDeviceSurfacePresentModesKHR fGetPhysicalDeviceSurfacePresentModesKHR =nullptr;
+
+ PFN_vkCreateSwapchainKHR fCreateSwapchainKHR = nullptr;
+ PFN_vkDestroySwapchainKHR fDestroySwapchainKHR = nullptr;
+ PFN_vkGetSwapchainImagesKHR fGetSwapchainImagesKHR = nullptr;
+ PFN_vkAcquireNextImageKHR fAcquireNextImageKHR = nullptr;
+ PFN_vkQueuePresentKHR fQueuePresentKHR = nullptr;
+
+ PFN_vkDestroyInstance fDestroyInstance = nullptr;
+ PFN_vkDeviceWaitIdle fDeviceWaitIdle = nullptr;
+ PFN_vkQueueWaitIdle fQueueWaitIdle = nullptr;
+ PFN_vkDestroyDevice fDestroyDevice = nullptr;
+ PFN_vkGetDeviceQueue fGetDeviceQueue = nullptr;
sk_sp<const GrVkInterface> fInterface;