blob: 963016ff1d7ccf836629205ab74a61b15a0bef00 [file] [log] [blame]
Greg Daniel164a9f02016-02-22 09:56:40 -05001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrVkGpu_DEFINED
9#define GrVkGpu_DEFINED
10
11#include "GrGpu.h"
Greg Daniel164a9f02016-02-22 09:56:40 -050012#include "GrVkCaps.h"
egdanielbc9b2962016-09-27 08:00:53 -070013#include "GrVkCopyManager.h"
Greg Daniel164a9f02016-02-22 09:56:40 -050014#include "GrVkIndexBuffer.h"
jvanverth6b6ffc42016-06-13 14:28:07 -070015#include "GrVkMemory.h"
Greg Daniel164a9f02016-02-22 09:56:40 -050016#include "GrVkResourceProvider.h"
Greg Daniel6be35232017-03-01 17:01:09 -050017#include "GrVkSemaphore.h"
Greg Daniel164a9f02016-02-22 09:56:40 -050018#include "GrVkVertexBuffer.h"
19#include "GrVkUtil.h"
Greg Daniel487132b2018-12-20 14:09:36 -050020#include "vk/GrVkBackendContext.h"
21#include "vk/GrVkTypes.h"
Greg Daniel164a9f02016-02-22 09:56:40 -050022
23class GrPipeline;
Greg Daniel164a9f02016-02-22 09:56:40 -050024
25class GrVkBufferImpl;
Ethan Nicholas8e265a72018-12-12 16:22:40 -050026class GrVkCommandPool;
Robert Phillips5b5d84c2018-08-09 15:12:18 -040027class GrVkGpuRTCommandBuffer;
28class GrVkGpuTextureCommandBuffer;
Greg Daniel81df0412018-05-31 13:13:33 -040029class GrVkMemoryAllocator;
Greg Daniel164a9f02016-02-22 09:56:40 -050030class GrVkPipeline;
egdaniel22281c12016-03-23 13:49:40 -070031class GrVkPipelineState;
egdaniel066df7c2016-06-08 14:02:27 -070032class GrVkPrimaryCommandBuffer;
Greg Daniel164a9f02016-02-22 09:56:40 -050033class GrVkRenderPass;
egdaniel066df7c2016-06-08 14:02:27 -070034class GrVkSecondaryCommandBuffer;
Greg Daniel164a9f02016-02-22 09:56:40 -050035class GrVkTexture;
36struct GrVkInterface;
37
Ethan Nicholas941e7e22016-12-12 15:33:30 -050038namespace SkSL {
39 class Compiler;
40}
41
Greg Daniel164a9f02016-02-22 09:56:40 -050042class GrVkGpu : public GrGpu {
43public:
Greg Danielf730c182018-07-02 20:15:37 +000044 static sk_sp<GrGpu> Make(const GrVkBackendContext&, const GrContextOptions&, GrContext*);
jvanverth633b3562016-03-23 11:01:22 -070045
Greg Daniel164a9f02016-02-22 09:56:40 -050046 ~GrVkGpu() override;
47
Greg Daniel8606cf82017-05-08 16:17:53 -040048 void disconnect(DisconnectType) override;
49
Greg Danielf730c182018-07-02 20:15:37 +000050 const GrVkInterface* vkInterface() const { return fInterface.get(); }
Greg Daniel164a9f02016-02-22 09:56:40 -050051 const GrVkCaps& vkCaps() const { return *fVkCaps; }
52
Greg Daniel81df0412018-05-31 13:13:33 -040053 GrVkMemoryAllocator* memoryAllocator() const { return fMemoryAllocator.get(); }
54
Greg Daniel637c06a2018-09-12 09:44:25 -040055 VkPhysicalDevice physicalDevice() const { return fPhysicalDevice; }
Greg Daniel164a9f02016-02-22 09:56:40 -050056 VkDevice device() const { return fDevice; }
57 VkQueue queue() const { return fQueue; }
Greg Danielecddbc02018-08-30 16:39:34 -040058 uint32_t queueIndex() const { return fQueueIndex; }
Ethan Nicholas8e265a72018-12-12 16:22:40 -050059 GrVkCommandPool* cmdPool() const { return fCmdPool; }
Greg Daniela870b462019-01-08 15:49:46 -050060 const VkPhysicalDeviceProperties& physicalDeviceProperties() const {
Greg Daniel8385a8a2018-02-26 13:29:37 -050061 return fPhysDevProps;
62 }
Greg Daniela870b462019-01-08 15:49:46 -050063 const VkPhysicalDeviceMemoryProperties& physicalDeviceMemoryProperties() const {
Greg Daniel164a9f02016-02-22 09:56:40 -050064 return fPhysDevMemProps;
65 }
66
egdanielbc9b2962016-09-27 08:00:53 -070067 GrVkResourceProvider& resourceProvider() { return fResourceProvider; }
68
69 GrVkPrimaryCommandBuffer* currentCommandBuffer() { return fCurrentCmdBuffer; }
Greg Daniel164a9f02016-02-22 09:56:40 -050070
71 enum SyncQueue {
72 kForce_SyncQueue,
73 kSkip_SyncQueue
74 };
75
Chris Daltond7291ba2019-03-07 14:17:03 -070076 void querySampleLocations(
77 GrRenderTarget*, const GrStencilSettings&, SkTArray<SkPoint>*) override {
78 SkASSERT(!this->caps()->sampleLocationsSupport());
79 SK_ABORT("Sample locations not yet implemented for Vulkan.");
80 }
81
Greg Daniel164a9f02016-02-22 09:56:40 -050082 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {}
83
Brian Salomonf865b052018-03-09 09:01:53 -050084#if GR_TEST_UTILS
Brian Salomon52e943a2018-03-13 09:32:39 -040085 GrBackendTexture createTestingOnlyBackendTexture(const void* pixels, int w, int h,
Robert Phillips646f6372018-09-25 09:31:10 -040086 GrColorType colorType, bool isRenderTarget,
87 GrMipMapped, size_t rowBytes = 0) override;
Robert Phillipsd21b2a52017-12-12 13:01:25 -050088 bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
Brian Salomon26102cb2018-03-09 09:33:19 -050089 void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
Greg Daniel164a9f02016-02-22 09:56:40 -050090
Brian Osman2d010b62018-08-09 10:55:09 -040091 GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType) override;
Brian Salomonf865b052018-03-09 09:01:53 -050092 void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) override;
93
Greg Daniel26b50a42018-03-08 09:49:58 -050094 void testingOnly_flushGpuAndSync() override;
Brian Salomonf865b052018-03-09 09:01:53 -050095#endif
Greg Daniel26b50a42018-03-08 09:49:58 -050096
Greg Daniel164a9f02016-02-22 09:56:40 -050097 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTarget*,
98 int width,
99 int height) override;
100
Robert Phillips5b5d84c2018-08-09 15:12:18 -0400101 GrGpuRTCommandBuffer* getCommandBuffer(
Ethan Nicholas56d19a52018-10-15 11:26:20 -0400102 GrRenderTarget*, GrSurfaceOrigin, const SkRect&,
Greg Daniel500d58b2017-08-24 15:59:33 -0400103 const GrGpuRTCommandBuffer::LoadAndStoreInfo&,
104 const GrGpuRTCommandBuffer::StencilLoadAndStoreInfo&) override;
105
Robert Phillips5b5d84c2018-08-09 15:12:18 -0400106 GrGpuTextureCommandBuffer* getCommandBuffer(GrTexture*, GrSurfaceOrigin) override;
107
egdaniel066df7c2016-06-08 14:02:27 -0700108
Greg Daniel59dc1482019-02-22 10:46:38 -0500109 void addBufferMemoryBarrier(const GrVkResource*,
110 VkPipelineStageFlags srcStageMask,
Greg Daniel164a9f02016-02-22 09:56:40 -0500111 VkPipelineStageFlags dstStageMask,
112 bool byRegion,
113 VkBufferMemoryBarrier* barrier) const;
Greg Daniel59dc1482019-02-22 10:46:38 -0500114 void addImageMemoryBarrier(const GrVkResource*,
115 VkPipelineStageFlags srcStageMask,
Greg Daniel164a9f02016-02-22 09:56:40 -0500116 VkPipelineStageFlags dstStageMask,
117 bool byRegion,
118 VkImageMemoryBarrier* barrier) const;
halcanary9d524f22016-03-29 09:03:52 -0700119
ethannicholasb3058bd2016-07-01 08:22:01 -0700120 SkSL::Compiler* shaderCompiler() const {
121 return fCompiler;
122 }
Greg Daniel164a9f02016-02-22 09:56:40 -0500123
Brian Salomon930f9392018-06-20 16:25:26 -0400124 bool onRegenerateMipMapLevels(GrTexture* tex) override;
125
Greg Daniel0a77f432018-12-06 11:23:32 -0500126 void resolveRenderTargetNoFlush(GrRenderTarget* target) {
127 this->internalResolveRenderTarget(target, false);
128 }
129
Brian Salomon1fabd512018-02-09 09:54:25 -0500130 void onResolveRenderTarget(GrRenderTarget* target) override {
Greg Daniel0a77f432018-12-06 11:23:32 -0500131 // This resolve is called when we are preparing an msaa surface for external I/O. It is
132 // called after flushing, so we need to make sure we submit the command buffer after doing
133 // the resolve so that the resolve actually happens.
Brian Salomon1fabd512018-02-09 09:54:25 -0500134 this->internalResolveRenderTarget(target, true);
Greg Daniel69d49922017-02-23 09:44:02 -0500135 }
egdaniel66933552016-08-24 07:22:19 -0700136
Greg Daniel22bc8652017-03-22 15:45:43 -0400137 void submitSecondaryCommandBuffer(const SkTArray<GrVkSecondaryCommandBuffer*>&,
egdaniel9cb63402016-06-23 08:37:05 -0700138 const GrVkRenderPass*,
Robert Phillips8c326e92017-08-10 13:50:17 -0400139 const VkClearValue* colorClear,
Robert Phillipsb0e93a22017-08-29 08:26:54 -0400140 GrVkRenderTarget*, GrSurfaceOrigin,
egdaniel9cb63402016-06-23 08:37:05 -0700141 const SkIRect& bounds);
egdaniel066df7c2016-06-08 14:02:27 -0700142
Robert Phillips5b5d84c2018-08-09 15:12:18 -0400143 void submit(GrGpuCommandBuffer*) override;
144
Greg Daniel6be35232017-03-01 17:01:09 -0500145 GrFence SK_WARN_UNUSED_RESULT insertFence() override;
146 bool waitFence(GrFence, uint64_t timeout) override;
jvanverth84741b32016-09-30 08:39:02 -0700147 void deleteFence(GrFence) const override;
148
Greg Daniela5cb7812017-06-16 09:45:32 -0400149 sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT makeSemaphore(bool isOwned) override;
Greg Daniel48661b82018-01-22 16:11:35 -0500150 sk_sp<GrSemaphore> wrapBackendSemaphore(const GrBackendSemaphore& semaphore,
151 GrResourceProvider::SemaphoreWrapType wrapType,
152 GrWrapOwnership ownership) override;
Greg Daniel858e12c2018-12-06 11:11:37 -0500153 void insertSemaphore(sk_sp<GrSemaphore> semaphore) override;
Greg Daniel48661b82018-01-22 16:11:35 -0500154 void waitSemaphore(sk_sp<GrSemaphore> semaphore) override;
155
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400156 // These match the definitions in SkDrawable, from whence they came
157 typedef void* SubmitContext;
158 typedef void (*SubmitProc)(SubmitContext submitContext);
159
160 // Adds an SkDrawable::GpuDrawHandler that we will delete the next time we submit the primary
161 // command buffer to the gpu.
162 void addDrawable(std::unique_ptr<SkDrawable::GpuDrawHandler> drawable);
163
Brian Osman13dddce2017-05-09 13:19:50 -0400164 sk_sp<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override;
165
Greg Daniel6888c0d2017-08-25 11:55:50 -0400166 void copyBuffer(GrVkBuffer* srcBuffer, GrVkBuffer* dstBuffer, VkDeviceSize srcOffset,
167 VkDeviceSize dstOffset, VkDeviceSize size);
jvanverthdb379092016-07-07 11:18:46 -0700168 bool updateBuffer(GrVkBuffer* buffer, const void* src, VkDeviceSize offset, VkDeviceSize size);
jvanvertha584de92016-06-30 09:10:52 -0700169
Greg Daniel7a82edf2018-12-04 10:54:34 -0500170 uint32_t getExtraSamplerKeyForProgram(const GrSamplerState&,
171 const GrBackendFormat& format) override;
172
Greg Daniela870b462019-01-08 15:49:46 -0500173 enum PersistentCacheKeyType : uint32_t {
174 kShader_PersistentCacheKeyType = 0,
175 kPipelineCache_PersistentCacheKeyType = 1,
176 };
177
178 void storeVkPipelineCacheData() override;
179
Greg Daniel164a9f02016-02-22 09:56:40 -0500180private:
Greg Daniel98bffae2018-08-01 13:25:41 -0400181 GrVkGpu(GrContext*, const GrContextOptions&, const GrVkBackendContext&,
Greg Daniel41f0e282019-01-28 13:15:05 -0500182 sk_sp<const GrVkInterface>, uint32_t instanceVersion, uint32_t physicalDeviceVersion);
jvanverth633b3562016-03-23 11:01:22 -0700183
egdanielcfcd1812016-03-22 07:16:10 -0700184 void onResetContext(uint32_t resetBits) override {}
Greg Daniel164a9f02016-02-22 09:56:40 -0500185
Greg Daniel8606cf82017-05-08 16:17:53 -0400186 void destroyResources();
187
Brian Salomon58389b92018-03-07 13:01:25 -0500188 sk_sp<GrTexture> onCreateTexture(const GrSurfaceDesc&, SkBudgeted, const GrMipLevel[],
Brian Salomon2a4f9832018-03-03 22:43:43 -0500189 int mipLevelCount) override;
Greg Daniel164a9f02016-02-22 09:56:40 -0500190
Brian Salomonfa2ebea2019-01-24 15:58:58 -0500191 sk_sp<GrTexture> onWrapBackendTexture(const GrBackendTexture&, GrWrapOwnership, GrWrapCacheable,
192 GrIOType) override;
Brian Salomond17f6582017-07-19 18:28:58 -0400193 sk_sp<GrTexture> onWrapRenderableBackendTexture(const GrBackendTexture&,
Brian Salomond17f6582017-07-19 18:28:58 -0400194 int sampleCnt,
Brian Salomonaa6ca0a2019-01-24 16:03:07 -0500195 GrWrapOwnership,
196 GrWrapCacheable) override;
Robert Phillipsb0e93a22017-08-29 08:26:54 -0400197 sk_sp<GrRenderTarget> onWrapBackendRenderTarget(const GrBackendRenderTarget&) override;
Greg Daniel7ef28f32017-04-20 16:41:55 +0000198
199 sk_sp<GrRenderTarget> onWrapBackendTextureAsRenderTarget(const GrBackendTexture&,
Greg Daniel7ef28f32017-04-20 16:41:55 +0000200 int sampleCnt) override;
Greg Daniel164a9f02016-02-22 09:56:40 -0500201
Greg Danielb46add82019-01-02 14:51:29 -0500202 sk_sp<GrRenderTarget> onWrapVulkanSecondaryCBAsRenderTarget(const SkImageInfo&,
203 const GrVkDrawableInfo&) override;
204
Brian Salomondbf70722019-02-07 11:31:24 -0500205 sk_sp<GrGpuBuffer> onCreateBuffer(size_t size, GrGpuBufferType type, GrAccessPattern,
206 const void* data) override;
Greg Daniel164a9f02016-02-22 09:56:40 -0500207
Brian Salomona6948702018-06-01 15:33:20 -0400208 bool onReadPixels(GrSurface* surface, int left, int top, int width, int height, GrColorType,
209 void* buffer, size_t rowBytes) override;
Greg Daniel164a9f02016-02-22 09:56:40 -0500210
Brian Salomona9b04b92018-06-01 15:04:28 -0400211 bool onWritePixels(GrSurface* surface, int left, int top, int width, int height, GrColorType,
212 const GrMipLevel texels[], int mipLevelCount) override;
Greg Daniel164a9f02016-02-22 09:56:40 -0500213
Brian Salomone05ba5a2019-04-08 11:59:07 -0400214 bool onTransferPixelsTo(GrTexture*, int left, int top, int width, int height, GrColorType,
215 GrGpuBuffer* transferBuffer, size_t offset, size_t rowBytes) override;
Brian Salomone05ba5a2019-04-08 11:59:07 -0400216 size_t onTransferPixelsFrom(GrSurface* surface, int left, int top, int width, int height,
Brian Salomona585fe92019-04-09 14:57:00 -0400217 GrColorType, GrGpuBuffer* transferBuffer, size_t offset) override;
Greg Daniel164a9f02016-02-22 09:56:40 -0500218
Brian Salomon9b009bb2018-02-14 13:53:55 -0500219 bool onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin, GrSurface* src,
220 GrSurfaceOrigin srcOrigin, const SkIRect& srcRect,
Greg Daniel55fa6472018-03-16 16:13:10 -0400221 const SkIPoint& dstPoint, bool canDiscardOutsideDstRect) override;
Brian Salomon9b009bb2018-02-14 13:53:55 -0500222
Greg Danielb9990e42019-04-10 16:28:52 -0400223 void onFinishFlush(GrSurfaceProxy*, SkSurface::BackendSurfaceAccess access, GrFlushFlags flags,
224 bool insertedSemaphores) override;
Greg Daniel51316782017-08-02 15:10:09 +0000225
Greg Daniel164a9f02016-02-22 09:56:40 -0500226 // Ends and submits the current command buffer to the queue and then creates a new command
halcanary9d524f22016-03-29 09:03:52 -0700227 // buffer and begins it. If sync is set to kForce_SyncQueue, the function will wait for all
Greg Daniela5cb7812017-06-16 09:45:32 -0400228 // work in the queue to finish before returning. If this GrVkGpu object has any semaphores in
229 // fSemaphoreToSignal, we will add those signal semaphores to the submission of this command
230 // buffer. If this GrVkGpu object has any semaphores in fSemaphoresToWaitOn, we will add those
231 // wait semaphores to the submission of this command buffer.
232 void submitCommandBuffer(SyncQueue sync);
Greg Daniel164a9f02016-02-22 09:56:40 -0500233
Brian Salomon1fabd512018-02-09 09:54:25 -0500234 void internalResolveRenderTarget(GrRenderTarget*, bool requiresSubmit);
Greg Daniel69d49922017-02-23 09:44:02 -0500235
Robert Phillipsb0e93a22017-08-29 08:26:54 -0400236 void copySurfaceAsCopyImage(GrSurface* dst, GrSurfaceOrigin dstOrigin,
237 GrSurface* src, GrSurfaceOrigin srcOrigin,
238 GrVkImage* dstImage, GrVkImage* srcImage,
Greg Daniel164a9f02016-02-22 09:56:40 -0500239 const SkIRect& srcRect,
240 const SkIPoint& dstPoint);
241
Robert Phillipsb0e93a22017-08-29 08:26:54 -0400242 void copySurfaceAsBlit(GrSurface* dst, GrSurfaceOrigin dstOrigin,
243 GrSurface* src, GrSurfaceOrigin srcOrigin,
244 GrVkImage* dstImage, GrVkImage* srcImage,
egdaniel17b89252016-04-05 07:23:38 -0700245 const SkIRect& srcRect,
246 const SkIPoint& dstPoint);
247
Robert Phillipsb0e93a22017-08-29 08:26:54 -0400248 void copySurfaceAsResolve(GrSurface* dst, GrSurfaceOrigin dstOrigin,
249 GrSurface* src, GrSurfaceOrigin srcOrigin,
egdaniel4bcd62e2016-08-31 07:37:31 -0700250 const SkIRect& srcRect,
251 const SkIPoint& dstPoint);
252
jvanverth900bd4a2016-04-29 13:53:12 -0700253 // helpers for onCreateTexture and writeTexturePixels
Brian Salomona9b04b92018-06-01 15:04:28 -0400254 bool uploadTexDataLinear(GrVkTexture* tex, int left, int top, int width, int height,
255 GrColorType colorType, const void* data, size_t rowBytes);
256 bool uploadTexDataOptimal(GrVkTexture* tex, int left, int top, int width, int height,
257 GrColorType colorType, const GrMipLevel texels[], int mipLevelCount);
Jim Van Verth1676cb92019-01-15 13:24:45 -0500258 bool uploadTexDataCompressed(GrVkTexture* tex, int left, int top, int width, int height,
259 GrColorType dataColorType, const GrMipLevel texels[],
260 int mipLevelCount);
Brian Salomon1fabd512018-02-09 09:54:25 -0500261 void resolveImage(GrSurface* dst, GrVkRenderTarget* src, const SkIRect& srcRect,
262 const SkIPoint& dstPoint);
egdaniel4bcd62e2016-08-31 07:37:31 -0700263
Brian Salomon52e943a2018-03-13 09:32:39 -0400264#if GR_TEST_UTILS
265 bool createTestingOnlyVkImage(GrPixelConfig config, int w, int h, bool texturable,
266 bool renderable, GrMipMapped mipMapped, const void* srcData,
Robert Phillips646f6372018-09-25 09:31:10 -0400267 size_t srcRowBytes, GrVkImageInfo* info);
Brian Salomon52e943a2018-03-13 09:32:39 -0400268#endif
269
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400270 sk_sp<const GrVkInterface> fInterface;
271 sk_sp<GrVkMemoryAllocator> fMemoryAllocator;
272 sk_sp<GrVkCaps> fVkCaps;
jvanverth633b3562016-03-23 11:01:22 -0700273
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400274 VkInstance fInstance;
275 VkPhysicalDevice fPhysicalDevice;
276 VkDevice fDevice;
277 VkQueue fQueue; // Must be Graphics queue
278 uint32_t fQueueIndex;
jvanverth633b3562016-03-23 11:01:22 -0700279
280 // Created by GrVkGpu
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400281 GrVkResourceProvider fResourceProvider;
Greg Daniel164a9f02016-02-22 09:56:40 -0500282
Ethan Nicholas8e265a72018-12-12 16:22:40 -0500283 GrVkCommandPool* fCmdPool;
284
285 // just a raw pointer; object's lifespan is managed by fCmdPool
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400286 GrVkPrimaryCommandBuffer* fCurrentCmdBuffer;
jvanverth6b6ffc42016-06-13 14:28:07 -0700287
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400288 SkSTArray<1, GrVkSemaphore::Resource*> fSemaphoresToWaitOn;
289 SkSTArray<1, GrVkSemaphore::Resource*> fSemaphoresToSignal;
Greg Daniel6be35232017-03-01 17:01:09 -0500290
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400291 SkTArray<std::unique_ptr<SkDrawable::GpuDrawHandler>> fDrawables;
Greg Daniel6be35232017-03-01 17:01:09 -0500292
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400293 VkPhysicalDeviceProperties fPhysDevProps;
294 VkPhysicalDeviceMemoryProperties fPhysDevMemProps;
295
296 GrVkCopyManager fCopyManager;
egdanielbc9b2962016-09-27 08:00:53 -0700297
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500298 // compiler used for compiling sksl into spirv. We only want to create the compiler once since
299 // there is significant overhead to the first compile of any compiler.
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400300 SkSL::Compiler* fCompiler;
Greg Daniel164a9f02016-02-22 09:56:40 -0500301
Greg Daniel8606cf82017-05-08 16:17:53 -0400302 // We need a bool to track whether or not we've already disconnected all the gpu resources from
303 // vulkan context.
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400304 bool fDisconnected;
Greg Daniel8606cf82017-05-08 16:17:53 -0400305
Greg Daniel64cc9aa2018-10-19 13:54:56 -0400306 std::unique_ptr<GrVkGpuRTCommandBuffer> fCachedRTCommandBuffer;
307 std::unique_ptr<GrVkGpuTextureCommandBuffer> fCachedTexCommandBuffer;
Robert Phillips5b5d84c2018-08-09 15:12:18 -0400308
Greg Daniel164a9f02016-02-22 09:56:40 -0500309 typedef GrGpu INHERITED;
310};
311
312#endif