diff options
author | 2017-04-05 09:52:55 -0700 | |
---|---|---|
committer | 2017-04-05 17:32:09 +0000 | |
commit | 3251ed84052ced22d1e4c285524a835a82f7dd12 (patch) | |
tree | 47419c8941cdd4feed015bbb3bba7d4d36d24a63 /include/gpu/vk/GrVkInterface.h | |
parent | ea0765224a595ed42a9ad713a87db16b4211e5f0 (diff) |
Refactor Vulkan support to support Fuchsia
- Refactor runtime lookup of Vulkan functions
- Support Magma surfaces
- Add build flags to toggle Vulkan support
BUG=skia:
Change-Id: Ic71965c453507882521443006c4155c7481a9a3f
Reviewed-on: https://skia-review.googlesource.com/9342
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Jurka <mikejurka@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'include/gpu/vk/GrVkInterface.h')
-rw-r--r-- | include/gpu/vk/GrVkInterface.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/include/gpu/vk/GrVkInterface.h b/include/gpu/vk/GrVkInterface.h index 9dc033392c..dca47ffc4c 100644 --- a/include/gpu/vk/GrVkInterface.h +++ b/include/gpu/vk/GrVkInterface.h @@ -15,20 +15,6 @@ //////////////////////////////////////////////////////////////////////////////// /** - * The default interface is returned by GrVkCreateInterface. This function's - * implementation is platform-specific. - */ - -struct GrVkInterface; - -/** - * Creates a GrVkInterface. - */ -const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, - uint32_t extensionFlags); - - -/** * GrContext uses the following interface to make all calls into Vulkan. When a * GrContext is created it is given a GrVkInterface. All functions that should be * available based on the Vulkan's version must be non-NULL or GrContext creation @@ -49,7 +35,15 @@ private: typedef SkRefCnt INHERITED; public: - GrVkInterface(); + using GetProc = std::function<PFN_vkVoidFunction( + const char*, // function name + VkInstance, // instance or VK_NULL_HANDLE + VkDevice // device or VK_NULL_HANDLE + )>; + GrVkInterface(GetProc getProc, + VkInstance instance, + VkDevice device, + uint32_t extensionFlags); // Validates that the GrVkInterface supports its advertised standard. This means the necessary // function pointers have been initialized for Vulkan version. |