From c8cd45aaf43c5d044d8433d38c8332b1679eeadb Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Thu, 12 Jul 2018 10:02:37 -0400 Subject: 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 Reviewed-by: Brian Salomon --- include/gpu/vk/GrVkBackendContext.h | 7 +++++++ include/gpu/vk/GrVkInterface.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/gpu/vk/GrVkBackendContext.h b/include/gpu/vk/GrVkBackendContext.h index fe018e494f..d8006df20e 100644 --- a/include/gpu/vk/GrVkBackendContext.h +++ b/include/gpu/vk/GrVkBackendContext.h @@ -30,6 +30,12 @@ enum GrVkFeatureFlags { kSampleRateShading_GrVkFeatureFlag = 0x0004, }; +using GrVkGetProc = std::function; + // 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. @@ -49,6 +55,7 @@ struct SK_API GrVkBackendContext { uint32_t fFeatures; sk_sp fInterface; sk_sp fMemoryAllocator; + GrVkGetProc fGetProc = nullptr; // This is deprecated and should be set to false. The client is responsible for managing the // lifetime of the VkInstance and VkDevice objects. diff --git a/include/gpu/vk/GrVkInterface.h b/include/gpu/vk/GrVkInterface.h index 05ce561829..978eeebbea 100644 --- a/include/gpu/vk/GrVkInterface.h +++ b/include/gpu/vk/GrVkInterface.h @@ -35,6 +35,8 @@ private: typedef SkRefCnt INHERITED; public: + // TODO: This matches the definition of GrVkGetProc in GrVkTypes. Once we switch clients to + // using that and make GrVkInterface private, we can remove this GetProc. using GetProc = std::function