Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 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 GrMtlGpu_DEFINED |
| 9 | #define GrMtlGpu_DEFINED |
| 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/gpu/GrRenderTarget.h" |
| 12 | #include "include/gpu/GrTexture.h" |
| 13 | #include "src/gpu/GrGpu.h" |
| 14 | #include "src/gpu/GrSemaphore.h" |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 15 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 16 | #include "src/gpu/mtl/GrMtlCaps.h" |
| 17 | #include "src/gpu/mtl/GrMtlCopyManager.h" |
| 18 | #include "src/gpu/mtl/GrMtlResourceProvider.h" |
| 19 | #include "src/gpu/mtl/GrMtlStencilAttachment.h" |
Greg Daniel | cebcb84 | 2017-07-31 10:45:52 -0400 | [diff] [blame] | 20 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 21 | #import <Metal/Metal.h> |
| 22 | |
Ethan Nicholas | 0106351 | 2018-10-08 16:58:25 -0400 | [diff] [blame] | 23 | class GrMtlGpuRTCommandBuffer; |
Timothy Liang | ff19c8f | 2018-07-11 13:27:21 -0400 | [diff] [blame] | 24 | class GrMtlTexture; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 25 | class GrSemaphore; |
Greg Daniel | b76a72a | 2017-07-13 15:07:54 -0400 | [diff] [blame] | 26 | struct GrMtlBackendContext; |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 27 | class GrMtlCommandBuffer; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 28 | |
Timothy Liang | e30739a | 2018-07-31 10:51:17 -0400 | [diff] [blame] | 29 | namespace SkSL { |
| 30 | class Compiler; |
| 31 | } |
| 32 | |
Jim Van Verth | 61610be | 2019-03-07 15:33:49 -0500 | [diff] [blame] | 33 | // Helper macros for autorelease pools |
| 34 | #define SK_BEGIN_AUTORELEASE_BLOCK @autoreleasepool { |
| 35 | #define SK_END_AUTORELEASE_BLOCK } |
| 36 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 37 | class GrMtlGpu : public GrGpu { |
| 38 | public: |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 39 | static sk_sp<GrGpu> Make(GrContext* context, const GrContextOptions& options, |
| 40 | id<MTLDevice> device, id<MTLCommandQueue> queue); |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 41 | ~GrMtlGpu() override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 42 | |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 43 | void disconnect(DisconnectType) override; |
Greg Daniel | 4a081e2 | 2017-08-04 09:34:44 -0400 | [diff] [blame] | 44 | |
Greg Daniel | cebcb84 | 2017-07-31 10:45:52 -0400 | [diff] [blame] | 45 | const GrMtlCaps& mtlCaps() const { return *fMtlCaps.get(); } |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 46 | |
Greg Daniel | 4a081e2 | 2017-08-04 09:34:44 -0400 | [diff] [blame] | 47 | id<MTLDevice> device() const { return fDevice; } |
| 48 | |
Timothy Liang | e30739a | 2018-07-31 10:51:17 -0400 | [diff] [blame] | 49 | GrMtlResourceProvider& resourceProvider() { return fResourceProvider; } |
| 50 | |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 51 | GrMtlCommandBuffer* commandBuffer(); |
Jim Van Verth | 568eb8d | 2019-04-04 14:30:42 -0400 | [diff] [blame] | 52 | |
Timothy Liang | ef21d7e | 2018-07-02 17:03:30 -0400 | [diff] [blame] | 53 | enum SyncQueue { |
| 54 | kForce_SyncQueue, |
| 55 | kSkip_SyncQueue |
| 56 | }; |
| 57 | |
Timothy Liang | 49528b6 | 2018-08-02 14:18:37 -0400 | [diff] [blame] | 58 | // Commits the current command buffer to the queue and then creates a new command buffer. If |
| 59 | // sync is set to kForce_SyncQueue, the function will wait for all work in the committed |
| 60 | // command buffer to finish before creating a new buffer and returning. |
| 61 | void submitCommandBuffer(SyncQueue sync); |
| 62 | |
Robert Phillips | 9dbcdcc | 2019-05-13 10:40:06 -0400 | [diff] [blame] | 63 | GrBackendTexture createTestingOnlyBackendTexture(int w, int h, |
| 64 | const GrBackendFormat& format, |
| 65 | GrMipMapped mipMapped, |
| 66 | GrRenderable renderable, |
| 67 | const void* pixels = nullptr, |
| 68 | size_t rowBytes = 0) override; |
Timothy Liang | 760dbc4 | 2018-07-17 13:28:20 -0400 | [diff] [blame] | 69 | |
Michael Ludwig | 8ad0cbd | 2019-05-15 19:32:01 +0000 | [diff] [blame] | 70 | void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override; |
| 71 | |
Robert Phillips | f0ced62 | 2019-05-16 09:06:25 -0400 | [diff] [blame^] | 72 | #if GR_TEST_UTILS |
| 73 | bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; |
Michael Ludwig | 8ad0cbd | 2019-05-15 19:32:01 +0000 | [diff] [blame] | 74 | |
Robert Phillips | f0ced62 | 2019-05-16 09:06:25 -0400 | [diff] [blame^] | 75 | GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType) override; |
Timothy Liang | 760dbc4 | 2018-07-17 13:28:20 -0400 | [diff] [blame] | 76 | void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) override; |
| 77 | |
| 78 | void testingOnly_flushGpuAndSync() override; |
| 79 | #endif |
| 80 | |
Timothy Liang | e35055f | 2018-07-20 16:53:00 -0400 | [diff] [blame] | 81 | bool copySurfaceAsBlit(GrSurface* dst, GrSurfaceOrigin dstOrigin, |
| 82 | GrSurface* src, GrSurfaceOrigin srcOrigin, |
| 83 | const SkIRect& srcRect, const SkIPoint& dstPoint); |
| 84 | |
Timothy Liang | 70c787a | 2018-08-01 09:56:25 -0400 | [diff] [blame] | 85 | // This function is needed when we want to copy between two surfaces with different origins and |
| 86 | // the destination surface is not a render target. We will first draw to a temporary render |
| 87 | // target to adjust for the different origins and then blit from there to the destination. |
| 88 | bool copySurfaceAsDrawThenBlit(GrSurface* dst, GrSurfaceOrigin dstOrigin, |
| 89 | GrSurface* src, GrSurfaceOrigin srcOrigin, |
| 90 | const SkIRect& srcRect, const SkIPoint& dstPoint); |
| 91 | |
Robert Phillips | b0e93a2 | 2017-08-29 08:26:54 -0400 | [diff] [blame] | 92 | bool onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin, |
| 93 | GrSurface* src, GrSurfaceOrigin srcOrigin, |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 94 | const SkIRect& srcRect, |
Greg Daniel | 55fa647 | 2018-03-16 16:13:10 -0400 | [diff] [blame] | 95 | const SkIPoint& dstPoint, |
Timothy Liang | e35055f | 2018-07-20 16:53:00 -0400 | [diff] [blame] | 96 | bool canDiscardOutsideDstRect) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 97 | |
Robert Phillips | 5b5d84c | 2018-08-09 15:12:18 -0400 | [diff] [blame] | 98 | GrGpuRTCommandBuffer* getCommandBuffer( |
Ethan Nicholas | 56d19a5 | 2018-10-15 11:26:20 -0400 | [diff] [blame] | 99 | GrRenderTarget*, GrSurfaceOrigin, const SkRect& bounds, |
Greg Daniel | 6682ff2 | 2017-08-24 17:10:47 -0400 | [diff] [blame] | 100 | const GrGpuRTCommandBuffer::LoadAndStoreInfo&, |
Timothy Liang | e70604e | 2018-07-19 09:49:46 -0400 | [diff] [blame] | 101 | const GrGpuRTCommandBuffer::StencilLoadAndStoreInfo&) override; |
Greg Daniel | 6682ff2 | 2017-08-24 17:10:47 -0400 | [diff] [blame] | 102 | |
Robert Phillips | 5b5d84c | 2018-08-09 15:12:18 -0400 | [diff] [blame] | 103 | GrGpuTextureCommandBuffer* getCommandBuffer(GrTexture*, GrSurfaceOrigin) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 104 | |
Timothy Liang | e30739a | 2018-07-31 10:51:17 -0400 | [diff] [blame] | 105 | SkSL::Compiler* shaderCompiler() const { return fCompiler.get(); } |
| 106 | |
Robert Phillips | 5b5d84c | 2018-08-09 15:12:18 -0400 | [diff] [blame] | 107 | void submit(GrGpuCommandBuffer* buffer) override; |
| 108 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 109 | GrFence SK_WARN_UNUSED_RESULT insertFence() override { return 0; } |
| 110 | bool waitFence(GrFence, uint64_t) override { return true; } |
| 111 | void deleteFence(GrFence) const override {} |
| 112 | |
| 113 | sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT makeSemaphore(bool isOwned) override { |
| 114 | return nullptr; |
| 115 | } |
Greg Daniel | 48661b8 | 2018-01-22 16:11:35 -0500 | [diff] [blame] | 116 | sk_sp<GrSemaphore> wrapBackendSemaphore(const GrBackendSemaphore& semaphore, |
| 117 | GrResourceProvider::SemaphoreWrapType wrapType, |
| 118 | GrWrapOwnership ownership) override { return nullptr; } |
Greg Daniel | 858e12c | 2018-12-06 11:11:37 -0500 | [diff] [blame] | 119 | void insertSemaphore(sk_sp<GrSemaphore> semaphore) override {} |
Greg Daniel | 48661b8 | 2018-01-22 16:11:35 -0500 | [diff] [blame] | 120 | void waitSemaphore(sk_sp<GrSemaphore> semaphore) override {} |
Brian Salomon | b0d8b76 | 2019-05-06 16:58:22 -0400 | [diff] [blame] | 121 | // We currently call finish procs immediately in onFinishFlush(). |
| 122 | void checkFinishProcs() override {} |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 123 | sk_sp<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override { return nullptr; } |
| 124 | |
Timothy Liang | 5422f9a | 2018-08-10 10:57:55 -0400 | [diff] [blame] | 125 | // When the Metal backend actually uses indirect command buffers, this function will actually do |
| 126 | // what it says. For now, every command is encoded directly into the primary command buffer, so |
| 127 | // this function is pretty useless, except for indicating that a render target has been drawn |
| 128 | // to. |
| 129 | void submitIndirectCommandBuffer(GrSurface* surface, GrSurfaceOrigin origin, |
| 130 | const SkIRect* bounds) { |
| 131 | this->didWriteToSurface(surface, origin, bounds); |
| 132 | } |
| 133 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 134 | private: |
Greg Daniel | b76a72a | 2017-07-13 15:07:54 -0400 | [diff] [blame] | 135 | GrMtlGpu(GrContext* context, const GrContextOptions& options, |
Greg Daniel | cebcb84 | 2017-07-31 10:45:52 -0400 | [diff] [blame] | 136 | id<MTLDevice> device, id<MTLCommandQueue> queue, MTLFeatureSet featureSet); |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 137 | |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 138 | void destroyResources(); |
| 139 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 140 | void onResetContext(uint32_t resetBits) override {} |
| 141 | |
Chris Dalton | 8c4cafd | 2019-04-15 19:14:36 -0600 | [diff] [blame] | 142 | void querySampleLocations(GrRenderTarget*, SkTArray<SkPoint>*) override { |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 143 | SkASSERT(!this->caps()->sampleLocationsSupport()); |
| 144 | SK_ABORT("Sample locations not yet implemented for Metal."); |
| 145 | } |
| 146 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 147 | void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} |
| 148 | |
| 149 | sk_sp<GrTexture> onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
Brian Salomon | 58389b9 | 2018-03-07 13:01:25 -0500 | [diff] [blame] | 150 | const GrMipLevel texels[], int mipLevelCount) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 151 | |
Brian Salomon | fa2ebea | 2019-01-24 15:58:58 -0500 | [diff] [blame] | 152 | sk_sp<GrTexture> onWrapBackendTexture(const GrBackendTexture&, GrWrapOwnership, GrWrapCacheable, |
| 153 | GrIOType) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 154 | |
Brian Salomon | aa6ca0a | 2019-01-24 16:03:07 -0500 | [diff] [blame] | 155 | sk_sp<GrTexture> onWrapRenderableBackendTexture(const GrBackendTexture&, int sampleCnt, |
| 156 | GrWrapOwnership, GrWrapCacheable) override; |
Brian Salomon | d17f658 | 2017-07-19 18:28:58 -0400 | [diff] [blame] | 157 | |
Timothy Liang | e886e80 | 2018-07-02 16:03:28 -0400 | [diff] [blame] | 158 | sk_sp<GrRenderTarget> onWrapBackendRenderTarget(const GrBackendRenderTarget&) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 159 | |
| 160 | sk_sp<GrRenderTarget> onWrapBackendTextureAsRenderTarget(const GrBackendTexture&, |
Timothy Liang | e886e80 | 2018-07-02 16:03:28 -0400 | [diff] [blame] | 161 | int sampleCnt) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 162 | |
Brian Salomon | dbf7072 | 2019-02-07 11:31:24 -0500 | [diff] [blame] | 163 | sk_sp<GrGpuBuffer> onCreateBuffer(size_t, GrGpuBufferType, GrAccessPattern, |
| 164 | const void*) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 165 | |
Brian Salomon | a694870 | 2018-06-01 15:33:20 -0400 | [diff] [blame] | 166 | bool onReadPixels(GrSurface* surface, int left, int top, int width, int height, GrColorType, |
Timothy Liang | ef21d7e | 2018-07-02 17:03:30 -0400 | [diff] [blame] | 167 | void* buffer, size_t rowBytes) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 168 | |
Brian Salomon | a9b04b9 | 2018-06-01 15:04:28 -0400 | [diff] [blame] | 169 | bool onWritePixels(GrSurface*, int left, int top, int width, int height, GrColorType, |
Timothy Liang | a8046af | 2018-07-19 09:58:00 -0400 | [diff] [blame] | 170 | const GrMipLevel[], int mipLevelCount) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 171 | |
Brian Salomon | e05ba5a | 2019-04-08 11:59:07 -0400 | [diff] [blame] | 172 | bool onTransferPixelsTo(GrTexture*, |
| 173 | int left, int top, int width, int height, |
| 174 | GrColorType, GrGpuBuffer*, |
| 175 | size_t offset, size_t rowBytes) override { |
Jim Van Verth | 686046b | 2019-03-18 15:39:22 -0400 | [diff] [blame] | 176 | // TODO: not sure this is worth the work since nobody uses it |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 177 | return false; |
| 178 | } |
Brian Salomon | 26de56e | 2019-04-10 12:14:26 -0400 | [diff] [blame] | 179 | bool onTransferPixelsFrom(GrSurface*, int left, int top, int width, int height, GrColorType, |
| 180 | GrGpuBuffer*, size_t offset) override { |
Brian Salomon | e05ba5a | 2019-04-08 11:59:07 -0400 | [diff] [blame] | 181 | // TODO: Will need to implement this to support async read backs. |
Brian Salomon | 26de56e | 2019-04-10 12:14:26 -0400 | [diff] [blame] | 182 | return false; |
Brian Salomon | e05ba5a | 2019-04-08 11:59:07 -0400 | [diff] [blame] | 183 | } |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 184 | |
Jim Van Verth | 686046b | 2019-03-18 15:39:22 -0400 | [diff] [blame] | 185 | bool onRegenerateMipMapLevels(GrTexture*) override; |
Brian Salomon | 930f939 | 2018-06-20 16:25:26 -0400 | [diff] [blame] | 186 | |
Brian Salomon | 1fabd51 | 2018-02-09 09:54:25 -0500 | [diff] [blame] | 187 | void onResolveRenderTarget(GrRenderTarget* target) override { return; } |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 188 | |
Brian Salomon | f9a1fdf | 2019-05-09 10:30:12 -0400 | [diff] [blame] | 189 | void onFinishFlush(GrSurfaceProxy*[], int n, SkSurface::BackendSurfaceAccess access, |
Greg Daniel | 797efca | 2019-05-09 14:04:20 -0400 | [diff] [blame] | 190 | const GrFlushInfo& info, const GrPrepareForExternalIORequests&) override { |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 191 | if (info.fFlags & kSyncCpu_GrFlushFlag) { |
Greg Daniel | bae7121 | 2019-03-01 15:24:35 -0500 | [diff] [blame] | 192 | this->submitCommandBuffer(kForce_SyncQueue); |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 193 | if (info.fFinishedProc) { |
| 194 | info.fFinishedProc(info.fFinishedContext); |
Greg Daniel | a3aa75a | 2019-04-12 14:24:55 -0400 | [diff] [blame] | 195 | } |
Greg Daniel | bae7121 | 2019-03-01 15:24:35 -0500 | [diff] [blame] | 196 | } else { |
| 197 | this->submitCommandBuffer(kSkip_SyncQueue); |
Greg Daniel | a3aa75a | 2019-04-12 14:24:55 -0400 | [diff] [blame] | 198 | // TODO: support finishedProc to actually be called when the GPU is done with the work |
| 199 | // and not immediately. |
Greg Daniel | e6bfb7d | 2019-04-17 15:26:11 -0400 | [diff] [blame] | 200 | if (info.fFinishedProc) { |
| 201 | info.fFinishedProc(info.fFinishedContext); |
Greg Daniel | a3aa75a | 2019-04-12 14:24:55 -0400 | [diff] [blame] | 202 | } |
Greg Daniel | bae7121 | 2019-03-01 15:24:35 -0500 | [diff] [blame] | 203 | } |
Timothy Liang | 5422f9a | 2018-08-10 10:57:55 -0400 | [diff] [blame] | 204 | } |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 205 | |
Timothy Liang | ff19c8f | 2018-07-11 13:27:21 -0400 | [diff] [blame] | 206 | // Function that uploads data onto textures with private storage mode (GPU access only). |
| 207 | bool uploadToTexture(GrMtlTexture* tex, int left, int top, int width, int height, |
| 208 | GrColorType dataColorType, const GrMipLevel texels[], int mipLevels); |
Jim Van Verth | 686046b | 2019-03-18 15:39:22 -0400 | [diff] [blame] | 209 | // Function that fills texture with transparent black |
| 210 | bool clearTexture(GrMtlTexture*, GrColorType); |
Timothy Liang | ff19c8f | 2018-07-11 13:27:21 -0400 | [diff] [blame] | 211 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 212 | GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTarget*, |
| 213 | int width, |
Ethan Nicholas | 0106351 | 2018-10-08 16:58:25 -0400 | [diff] [blame] | 214 | int height) override; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 215 | |
Robert Phillips | 9dbcdcc | 2019-05-13 10:40:06 -0400 | [diff] [blame] | 216 | bool createTestingOnlyMtlTextureInfo(GrPixelConfig, MTLPixelFormat, |
| 217 | int w, int h, bool texturable, |
Timothy Liang | 760dbc4 | 2018-07-17 13:28:20 -0400 | [diff] [blame] | 218 | bool renderable, GrMipMapped mipMapped, |
Robert Phillips | 646f637 | 2018-09-25 09:31:10 -0400 | [diff] [blame] | 219 | const void* srcData, size_t rowBytes, |
| 220 | GrMtlTextureInfo* info); |
Greg Daniel | 26b50a4 | 2018-03-08 09:49:58 -0500 | [diff] [blame] | 221 | |
Greg Daniel | cebcb84 | 2017-07-31 10:45:52 -0400 | [diff] [blame] | 222 | sk_sp<GrMtlCaps> fMtlCaps; |
| 223 | |
Greg Daniel | b76a72a | 2017-07-13 15:07:54 -0400 | [diff] [blame] | 224 | id<MTLDevice> fDevice; |
| 225 | id<MTLCommandQueue> fQueue; |
| 226 | |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 227 | GrMtlCommandBuffer* fCmdBuffer; |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 228 | |
Timothy Liang | e30739a | 2018-07-31 10:51:17 -0400 | [diff] [blame] | 229 | std::unique_ptr<SkSL::Compiler> fCompiler; |
Jim Van Verth | 75c5326 | 2019-04-26 12:23:51 -0400 | [diff] [blame] | 230 | |
| 231 | GrMtlCopyManager fCopyManager; |
Timothy Liang | e30739a | 2018-07-31 10:51:17 -0400 | [diff] [blame] | 232 | GrMtlResourceProvider fResourceProvider; |
| 233 | |
Jim Van Verth | 75c3ae4 | 2019-04-22 17:07:53 -0400 | [diff] [blame] | 234 | bool fDisconnected; |
| 235 | |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 236 | typedef GrGpu INHERITED; |
| 237 | }; |
| 238 | |
| 239 | #endif |
| 240 | |