diff options
author | Greg Daniel <egdaniel@google.com> | 2018-06-22 16:50:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-25 13:37:45 +0000 |
commit | 93ae2337732bf206e6ef4faecc6b30c3881e8359 (patch) | |
tree | d5de62a3e27b28b930c229586318700c8af14fbe /src/gpu/vk/GrVkGpu.h | |
parent | c050a1a185bf13ec19eb8bf62ccf3f73a85a39b2 (diff) |
Make GrVkBackendContext no longer derive from SkRefCnt.
Also moves the helper Create functions to VkTestUtils since no clients
are using them anymore.
Bug: skia:
Change-Id: I7e8e4912e7ef6fb00a7e2a00407aed5e83211799
Reviewed-on: https://skia-review.googlesource.com/135323
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkGpu.h')
-rw-r--r-- | src/gpu/vk/GrVkGpu.h | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 052476098d..f506d28b0e 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -38,13 +38,13 @@ namespace SkSL { class GrVkGpu : public GrGpu { public: - static sk_sp<GrGpu> Make(sk_sp<const GrVkBackendContext>, const GrContextOptions&, GrContext*); + static sk_sp<GrGpu> Make(const GrVkBackendContext&, const GrContextOptions&, GrContext*); ~GrVkGpu() override; void disconnect(DisconnectType) override; - const GrVkInterface* vkInterface() const { return fBackendContext->fInterface.get(); } + const GrVkInterface* vkInterface() const { return fInterface.get(); } const GrVkCaps& vkCaps() const { return *fVkCaps; } GrVkMemoryAllocator* memoryAllocator() const { return fMemoryAllocator.get(); } @@ -144,7 +144,7 @@ public: bool updateBuffer(GrVkBuffer* buffer, const void* src, VkDeviceSize offset, VkDeviceSize size); private: - GrVkGpu(GrContext*, const GrContextOptions&, sk_sp<const GrVkBackendContext> backendContext); + GrVkGpu(GrContext*, const GrContextOptions&, const GrVkBackendContext& backendContext); void onResetContext(uint32_t resetBits) override {} @@ -222,28 +222,27 @@ private: GrVkImageInfo* info); #endif - sk_sp<const GrVkBackendContext> fBackendContext; - sk_sp<GrVkMemoryAllocator> fMemoryAllocator; - sk_sp<GrVkCaps> fVkCaps; + sk_sp<const GrVkInterface> fInterface; + sk_sp<GrVkMemoryAllocator> fMemoryAllocator; + sk_sp<GrVkCaps> fVkCaps; - // These Vulkan objects are provided by the client, and also stored in fBackendContext. - // They're copied here for convenient access. - VkDevice fDevice; - VkQueue fQueue; // Must be Graphics queue + VkInstance fInstance; + VkDevice fDevice; + VkQueue fQueue; // Must be Graphics queue // Created by GrVkGpu - GrVkResourceProvider fResourceProvider; - VkCommandPool fCmdPool; + GrVkResourceProvider fResourceProvider; + VkCommandPool fCmdPool; - GrVkPrimaryCommandBuffer* fCurrentCmdBuffer; + GrVkPrimaryCommandBuffer* fCurrentCmdBuffer; - SkSTArray<1, GrVkSemaphore::Resource*> fSemaphoresToWaitOn; - SkSTArray<1, GrVkSemaphore::Resource*> fSemaphoresToSignal; + SkSTArray<1, GrVkSemaphore::Resource*> fSemaphoresToWaitOn; + SkSTArray<1, GrVkSemaphore::Resource*> fSemaphoresToSignal; - VkPhysicalDeviceProperties fPhysDevProps; - VkPhysicalDeviceMemoryProperties fPhysDevMemProps; + VkPhysicalDeviceProperties fPhysDevProps; + VkPhysicalDeviceMemoryProperties fPhysDevMemProps; - GrVkCopyManager fCopyManager; + GrVkCopyManager fCopyManager; #ifdef SK_ENABLE_VK_LAYERS // For reporting validation layer errors @@ -252,11 +251,11 @@ private: // compiler used for compiling sksl into spirv. We only want to create the compiler once since // there is significant overhead to the first compile of any compiler. - SkSL::Compiler* fCompiler; + SkSL::Compiler* fCompiler; // We need a bool to track whether or not we've already disconnected all the gpu resources from // vulkan context. - bool fDisconnected; + bool fDisconnected; typedef GrGpu INHERITED; }; |