Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "src/gpu/vk/GrVkRenderTarget.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 9 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 10 | #include "include/gpu/GrBackendSurface.h" |
Greg Daniel | e2893f2 | 2020-10-13 10:20:06 -0400 | [diff] [blame] | 11 | #include "include/gpu/GrDirectContext.h" |
| 12 | #include "src/gpu/GrBackendSurfaceMutableStateImpl.h" |
Adlai Holler | a069304 | 2020-10-14 11:23:11 -0400 | [diff] [blame] | 13 | #include "src/gpu/GrDirectContextPriv.h" |
Greg Daniel | e2893f2 | 2020-10-13 10:20:06 -0400 | [diff] [blame] | 14 | #include "src/gpu/GrResourceProvider.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 15 | #include "src/gpu/vk/GrVkCommandBuffer.h" |
Greg Daniel | 37fd658 | 2020-09-14 12:36:09 -0400 | [diff] [blame] | 16 | #include "src/gpu/vk/GrVkDescriptorSet.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 17 | #include "src/gpu/vk/GrVkFramebuffer.h" |
| 18 | #include "src/gpu/vk/GrVkGpu.h" |
| 19 | #include "src/gpu/vk/GrVkImageView.h" |
| 20 | #include "src/gpu/vk/GrVkResourceProvider.h" |
| 21 | #include "src/gpu/vk/GrVkUtil.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 22 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 23 | #include "include/gpu/vk/GrVkTypes.h" |
jvanverth | fd359ca | 2016-03-18 11:57:24 -0700 | [diff] [blame] | 24 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 25 | #define VK_CALL(GPU, X) GR_VK_CALL(GPU->vkInterface(), X) |
| 26 | |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 27 | static int renderpass_features_to_index(bool hasResolve, bool hasStencil, |
| 28 | GrVkRenderPass::SelfDependencyFlags selfDepFlags, |
| 29 | GrVkRenderPass::LoadFromResolve loadFromReslove) { |
| 30 | int index = 0; |
| 31 | if (hasResolve) { |
| 32 | index += 1; |
| 33 | } |
| 34 | if (hasStencil) { |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 35 | index += 2; |
| 36 | } |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 37 | if (selfDepFlags & GrVkRenderPass::SelfDependencyFlags::kForInputAttachment) { |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 38 | index += 4; |
| 39 | } |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 40 | if (selfDepFlags & GrVkRenderPass::SelfDependencyFlags::kForNonCoherentAdvBlend) { |
| 41 | index += 8; |
| 42 | } |
| 43 | if (loadFromReslove == GrVkRenderPass::LoadFromResolve::kLoad) { |
| 44 | index += 16; |
| 45 | } |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 46 | return index; |
| 47 | } |
| 48 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 49 | // We're virtually derived from GrSurface (via GrRenderTarget) so its |
| 50 | // constructor must be explicitly called. |
| 51 | GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu, |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 52 | SkISize dimensions, |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 53 | sk_sp<GrVkImage> colorAttachment, |
| 54 | sk_sp<GrVkImage> resolveAttachment, |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 55 | CreateType createType) |
| 56 | : GrSurface(gpu, dimensions, |
| 57 | colorAttachment->isProtected() ? GrProtected::kYes : GrProtected::kNo) |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 58 | // for the moment we only support 1:1 color to stencil |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 59 | , GrRenderTarget(gpu, dimensions, colorAttachment->numSamples(), |
| 60 | colorAttachment->isProtected() ? GrProtected::kYes : GrProtected::kNo) |
| 61 | , fColorAttachment(std::move(colorAttachment)) |
| 62 | , fResolveAttachment(std::move(resolveAttachment)) |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 63 | , fCachedFramebuffers() { |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 64 | SkASSERT(fColorAttachment); |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 65 | |
| 66 | if (fColorAttachment->numSamples() == 1 && fColorAttachment->supportsInputAttachmentUsage()) { |
| 67 | SkASSERT(!resolveAttachment); |
| 68 | // When we have a single sampled color attachment, we set both the color and resolve |
| 69 | // to the same attachment. This way if we use DMAA on this render target we will resolve |
| 70 | // to the single target attachment. |
| 71 | fResolveAttachment = fColorAttachment; |
| 72 | } |
| 73 | |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 74 | SkASSERT(!resolveAttachment || |
| 75 | (fResolveAttachment->isProtected() == fColorAttachment->isProtected())); |
| 76 | SkASSERT(SkToBool(fColorAttachment->vkUsageFlags() & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)); |
| 77 | this->setFlags(); |
| 78 | if (createType == CreateType::kDirectlyWrapped) { |
| 79 | this->registerWithCacheWrapped(GrWrapCacheable::kNo); |
| 80 | } |
Greg Daniel | 7b62dca | 2020-08-21 11:26:12 -0400 | [diff] [blame] | 81 | } |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 82 | |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 83 | GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu, |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 84 | SkISize dimensions, |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 85 | sk_sp<GrVkFramebuffer> externalFramebuffer) |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 86 | : GrSurface(gpu, dimensions, |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 87 | externalFramebuffer->colorAttachment()->isProtected() ? GrProtected::kYes |
| 88 | : GrProtected::kNo) |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 89 | , GrRenderTarget(gpu, dimensions, 1, |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 90 | externalFramebuffer->colorAttachment()->isProtected() ? GrProtected::kYes |
| 91 | : GrProtected::kNo) |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 92 | , fCachedFramebuffers() |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 93 | , fExternalFramebuffer(externalFramebuffer) { |
| 94 | SkASSERT(fExternalFramebuffer); |
| 95 | SkASSERT(!fColorAttachment); |
| 96 | SkDEBUGCODE(auto colorAttachment = fExternalFramebuffer->colorAttachment()); |
| 97 | SkASSERT(colorAttachment); |
| 98 | SkASSERT(colorAttachment->numSamples() == 1); |
| 99 | SkASSERT(SkToBool(colorAttachment->vkUsageFlags() & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)); |
| 100 | SkASSERT(!SkToBool(colorAttachment->vkUsageFlags() & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)); |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 101 | this->setFlags(); |
Brian Salomon | aa6ca0a | 2019-01-24 16:03:07 -0500 | [diff] [blame] | 102 | this->registerWithCacheWrapped(GrWrapCacheable::kNo); |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 103 | } |
| 104 | |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 105 | void GrVkRenderTarget::setFlags() { |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 106 | if (this->wrapsSecondaryCommandBuffer()) { |
| 107 | return; |
| 108 | } |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 109 | GrVkImage* nonMSAAAttachment = this->nonMSAAAttachment(); |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 110 | if (nonMSAAAttachment && nonMSAAAttachment->supportsInputAttachmentUsage()) { |
Greg Daniel | 638b2e8 | 2020-08-27 14:29:00 -0400 | [diff] [blame] | 111 | this->setVkRTSupportsInputAttachment(); |
| 112 | } |
| 113 | } |
| 114 | |
Greg Daniel | 6c6caf4 | 2020-05-29 12:11:05 -0400 | [diff] [blame] | 115 | sk_sp<GrVkRenderTarget> GrVkRenderTarget::MakeWrappedRenderTarget( |
Greg Daniel | e2893f2 | 2020-10-13 10:20:06 -0400 | [diff] [blame] | 116 | GrVkGpu* gpu, |
| 117 | SkISize dimensions, |
| 118 | int sampleCnt, |
| 119 | const GrVkImageInfo& info, |
Greg Daniel | 6c6caf4 | 2020-05-29 12:11:05 -0400 | [diff] [blame] | 120 | sk_sp<GrBackendSurfaceMutableStateImpl> mutableState) { |
Greg Daniel | 001c67f | 2018-06-26 13:51:57 -0400 | [diff] [blame] | 121 | SkASSERT(VK_NULL_HANDLE != info.fImage); |
egdaniel | 50ead53 | 2016-07-13 14:23:26 -0700 | [diff] [blame] | 122 | SkASSERT(1 == info.fLevelCount); |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 123 | SkASSERT(sampleCnt >= 1 && info.fSampleCount >= 1); |
| 124 | |
| 125 | int wrappedImageSampleCnt = static_cast<int>(info.fSampleCount); |
| 126 | if (sampleCnt != wrappedImageSampleCnt && wrappedImageSampleCnt != 1) { |
| 127 | return nullptr; |
| 128 | } |
| 129 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 130 | sk_sp<GrVkImage> wrappedAttachment = |
| 131 | GrVkImage::MakeWrapped(gpu, |
| 132 | dimensions, |
| 133 | info, |
| 134 | std::move(mutableState), |
| 135 | GrAttachment::UsageFlags::kColorAttachment, |
| 136 | kBorrow_GrWrapOwnership, |
| 137 | GrWrapCacheable::kNo); |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 138 | if (!wrappedAttachment) { |
egdaniel | b2df0c2 | 2016-05-13 11:30:37 -0700 | [diff] [blame] | 139 | return nullptr; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 140 | } |
| 141 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 142 | sk_sp<GrVkImage> colorAttachment; |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 143 | colorAttachment = std::move(wrappedAttachment); |
| 144 | |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 145 | if (!colorAttachment) { |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 146 | return nullptr; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 147 | } |
| 148 | |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 149 | GrVkRenderTarget* vkRT = new GrVkRenderTarget(gpu,dimensions, std::move(colorAttachment), |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 150 | nullptr, CreateType::kDirectlyWrapped); |
Greg Daniel | 001c67f | 2018-06-26 13:51:57 -0400 | [diff] [blame] | 151 | return sk_sp<GrVkRenderTarget>(vkRT); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 152 | } |
| 153 | |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 154 | sk_sp<GrVkRenderTarget> GrVkRenderTarget::MakeSecondaryCBRenderTarget( |
Brian Salomon | a56a746 | 2020-02-07 14:17:25 -0500 | [diff] [blame] | 155 | GrVkGpu* gpu, SkISize dimensions, const GrVkDrawableInfo& vkInfo) { |
Greg Daniel | e2893f2 | 2020-10-13 10:20:06 -0400 | [diff] [blame] | 156 | const GrVkRenderPass* rp = gpu->resourceProvider().findCompatibleExternalRenderPass( |
| 157 | vkInfo.fCompatibleRenderPass, vkInfo.fColorAttachmentIndex); |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 158 | if (!rp) { |
| 159 | return nullptr; |
| 160 | } |
| 161 | |
Greg Daniel | 8daf3b7 | 2019-07-30 09:57:26 -0400 | [diff] [blame] | 162 | if (vkInfo.fSecondaryCommandBuffer == VK_NULL_HANDLE) { |
Greg Daniel | 070cbaf | 2019-01-03 17:35:54 -0500 | [diff] [blame] | 163 | return nullptr; |
| 164 | } |
| 165 | |
Greg Daniel | 7f3408b | 2020-06-03 13:31:00 -0400 | [diff] [blame] | 166 | // We only set the few properties of the GrVkImageInfo that we know like layout and format. The |
| 167 | // others we keep at the default "null" values. |
| 168 | GrVkImageInfo info; |
| 169 | info.fImageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; |
| 170 | info.fFormat = vkInfo.fFormat; |
Greg Daniel | 7b62dca | 2020-08-21 11:26:12 -0400 | [diff] [blame] | 171 | info.fImageUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 172 | VK_IMAGE_USAGE_TRANSFER_SRC_BIT; |
Greg Daniel | 7f3408b | 2020-06-03 13:31:00 -0400 | [diff] [blame] | 173 | |
| 174 | sk_sp<GrBackendSurfaceMutableStateImpl> mutableState(new GrBackendSurfaceMutableStateImpl( |
| 175 | VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_QUEUE_FAMILY_IGNORED)); |
| 176 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 177 | sk_sp<GrVkImage> colorAttachment = |
| 178 | GrVkImage::MakeWrapped(gpu, |
| 179 | dimensions, |
| 180 | info, |
| 181 | std::move(mutableState), |
| 182 | GrAttachment::UsageFlags::kColorAttachment, |
| 183 | kBorrow_GrWrapOwnership, |
| 184 | GrWrapCacheable::kNo, |
| 185 | true); |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 186 | |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 187 | std::unique_ptr<GrVkSecondaryCommandBuffer> scb( |
| 188 | GrVkSecondaryCommandBuffer::Create(vkInfo.fSecondaryCommandBuffer, rp)); |
| 189 | if (!scb) { |
| 190 | return nullptr; |
| 191 | } |
| 192 | |
| 193 | sk_sp<GrVkFramebuffer> framebuffer(new GrVkFramebuffer( |
| 194 | gpu, std::move(colorAttachment), sk_sp<const GrVkRenderPass>(rp), |
| 195 | std::move(scb))); |
| 196 | |
| 197 | GrVkRenderTarget* vkRT = new GrVkRenderTarget(gpu, dimensions, std::move(framebuffer)); |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 198 | |
| 199 | return sk_sp<GrVkRenderTarget>(vkRT); |
| 200 | } |
| 201 | |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 202 | GrBackendFormat GrVkRenderTarget::backendFormat() const { |
| 203 | if (this->wrapsSecondaryCommandBuffer()) { |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 204 | return fExternalFramebuffer->colorAttachment()->backendFormat(); |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 205 | } |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 206 | return fColorAttachment->backendFormat(); |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 207 | } |
| 208 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 209 | GrVkImage* GrVkRenderTarget::nonMSAAAttachment() const { |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 210 | if (fColorAttachment->numSamples() == 1) { |
| 211 | return fColorAttachment.get(); |
| 212 | } else { |
| 213 | return fResolveAttachment.get(); |
| 214 | } |
| 215 | } |
| 216 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 217 | GrVkImage* GrVkRenderTarget::dynamicMSAAAttachment() { |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 218 | if (fDynamicMSAAAttachment) { |
| 219 | return fDynamicMSAAAttachment.get(); |
| 220 | } |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 221 | const GrVkImage* nonMSAAColorAttachment = this->colorAttachment(); |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 222 | SkASSERT(nonMSAAColorAttachment->numSamples() == 1); |
| 223 | |
| 224 | GrVkGpu* gpu = this->getVkGpu(); |
| 225 | auto rp = gpu->getContext()->priv().resourceProvider(); |
| 226 | |
| 227 | const GrBackendFormat& format = nonMSAAColorAttachment->backendFormat(); |
| 228 | |
Greg Daniel | 7743559 | 2021-09-22 13:55:44 -0400 | [diff] [blame] | 229 | GrMemoryless memoryless = |
| 230 | gpu->vkCaps().supportsMemorylessAttachments() ? GrMemoryless::kYes : GrMemoryless::kNo; |
| 231 | |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 232 | sk_sp<GrAttachment> msaaAttachment = |
Greg Daniel | 6610bed | 2021-05-13 13:15:31 -0400 | [diff] [blame] | 233 | rp->getDiscardableMSAAAttachment(nonMSAAColorAttachment->dimensions(), |
| 234 | format, |
| 235 | gpu->caps()->internalMultisampleCount(format), |
Greg Daniel | 7743559 | 2021-09-22 13:55:44 -0400 | [diff] [blame] | 236 | GrProtected(nonMSAAColorAttachment->isProtected()), |
| 237 | memoryless); |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 238 | if (!msaaAttachment) { |
| 239 | return nullptr; |
| 240 | } |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 241 | fDynamicMSAAAttachment = sk_sp<GrVkImage>(static_cast<GrVkImage*>(msaaAttachment.release())); |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 242 | return fDynamicMSAAAttachment.get(); |
| 243 | } |
| 244 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 245 | GrVkImage* GrVkRenderTarget::msaaAttachment() { |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 246 | return this->colorAttachment()->numSamples() == 1 ? this->dynamicMSAAAttachment() |
| 247 | : this->colorAttachment(); |
| 248 | } |
| 249 | |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 250 | bool GrVkRenderTarget::canAttemptStencilAttachment(bool useMSAASurface) const { |
| 251 | SkASSERT(!useMSAASurface || this->numSamples() > 1 || |
| 252 | this->getVkGpu()->vkCaps().supportsDiscardableMSAAForDMSAA()); |
| 253 | if (!useMSAASurface && this->numSamples() > 1) { |
| 254 | return false; |
| 255 | } |
| 256 | bool validMSAA = true; |
| 257 | if (useMSAASurface) { |
| 258 | validMSAA = this->numSamples() > 1 || |
| 259 | (this->getVkGpu()->vkCaps().supportsDiscardableMSAAForDMSAA() && |
| 260 | this->colorAttachment()->supportsInputAttachmentUsage()); |
| 261 | } |
| 262 | // We don't know the status of the stencil attachment for wrapped external secondary command |
| 263 | // buffers so we just assume we don't have one. |
| 264 | return validMSAA && !this->wrapsSecondaryCommandBuffer(); |
| 265 | } |
| 266 | |
Chris Dalton | e0fe23a | 2021-04-23 13:11:44 -0600 | [diff] [blame] | 267 | bool GrVkRenderTarget::completeStencilAttachment(GrAttachment* stencil, bool useMSAASurface) { |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 268 | SkASSERT(!this->wrapsSecondaryCommandBuffer()); |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 269 | SkASSERT(!useMSAASurface || |
| 270 | this->numSamples() > 1 || |
| 271 | this->getVkGpu()->vkCaps().supportsDiscardableMSAAForDMSAA()); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 272 | return true; |
| 273 | } |
| 274 | |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 275 | sk_sp<GrVkFramebuffer> GrVkRenderTarget::externalFramebuffer() const { |
| 276 | return fExternalFramebuffer; |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 277 | } |
| 278 | |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 279 | GrVkResourceProvider::CompatibleRPHandle GrVkRenderTarget::compatibleRenderPassHandle( |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 280 | bool withResolve, |
| 281 | bool withStencil, |
| 282 | SelfDependencyFlags selfDepFlags, |
| 283 | LoadFromResolve loadFromResolve) { |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 284 | SkASSERT(!this->wrapsSecondaryCommandBuffer()); |
| 285 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 286 | const GrVkFramebuffer* fb = |
| 287 | this->getFramebuffer(withResolve, withStencil, selfDepFlags, loadFromResolve); |
| 288 | if (!fb) { |
| 289 | return {}; |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 290 | } |
| 291 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 292 | return fb->compatibleRenderPassHandle(); |
| 293 | } |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 294 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 295 | const GrVkRenderPass* GrVkRenderTarget::getSimpleRenderPass(bool withResolve, |
| 296 | bool withStencil, |
| 297 | SelfDependencyFlags selfDepFlags, |
| 298 | LoadFromResolve loadFromResolve) { |
| 299 | if (this->wrapsSecondaryCommandBuffer()) { |
| 300 | return fExternalFramebuffer->externalRenderPass(); |
| 301 | } |
| 302 | |
| 303 | const GrVkFramebuffer* fb = |
| 304 | this->getFramebuffer(withResolve, withStencil, selfDepFlags, loadFromResolve); |
| 305 | if (!fb) { |
| 306 | return nullptr; |
| 307 | } |
| 308 | |
| 309 | return fb->compatibleRenderPass(); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 310 | } |
| 311 | |
Greg Daniel | a92d787 | 2021-04-07 11:08:36 -0400 | [diff] [blame] | 312 | std::pair<const GrVkRenderPass*, GrVkResourceProvider::CompatibleRPHandle> |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 313 | GrVkRenderTarget::createSimpleRenderPass(bool withResolve, |
| 314 | bool withStencil, |
| 315 | SelfDependencyFlags selfDepFlags, |
| 316 | LoadFromResolve loadFromResolve) { |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 317 | SkASSERT(!this->wrapsSecondaryCommandBuffer()); |
| 318 | |
| 319 | GrVkResourceProvider& rp = this->getVkGpu()->resourceProvider(); |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 320 | |
| 321 | GrVkResourceProvider::CompatibleRPHandle handle; |
| 322 | const GrVkRenderPass* renderPass = rp.findCompatibleRenderPass( |
| 323 | this, &handle, withResolve, withStencil, selfDepFlags, |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 324 | loadFromResolve); |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 325 | SkASSERT(!renderPass || handle.isValid()); |
| 326 | return {renderPass, handle}; |
Greg Daniel | fa3adf7 | 2019-11-07 09:53:41 -0500 | [diff] [blame] | 327 | } |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 328 | |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 329 | const GrVkFramebuffer* GrVkRenderTarget::getFramebuffer(bool withResolve, |
| 330 | bool withStencil, |
| 331 | SelfDependencyFlags selfDepFlags, |
| 332 | LoadFromResolve loadFromResolve) { |
| 333 | int cacheIndex = |
| 334 | renderpass_features_to_index(withResolve, withStencil, selfDepFlags, loadFromResolve); |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 335 | SkASSERT(cacheIndex < GrVkRenderTarget::kNumCachedFramebuffers); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 336 | if (auto fb = fCachedFramebuffers[cacheIndex]) { |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 337 | return fb.get(); |
Greg Daniel | fa3adf7 | 2019-11-07 09:53:41 -0500 | [diff] [blame] | 338 | } |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 339 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 340 | this->createFramebuffer(withResolve, withStencil, selfDepFlags, loadFromResolve); |
| 341 | return fCachedFramebuffers[cacheIndex].get(); |
Greg Daniel | fa3adf7 | 2019-11-07 09:53:41 -0500 | [diff] [blame] | 342 | } |
| 343 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 344 | void GrVkRenderTarget::createFramebuffer(bool withResolve, |
| 345 | bool withStencil, |
| 346 | SelfDependencyFlags selfDepFlags, |
| 347 | LoadFromResolve loadFromResolve) { |
Greg Daniel | fa3adf7 | 2019-11-07 09:53:41 -0500 | [diff] [blame] | 348 | SkASSERT(!this->wrapsSecondaryCommandBuffer()); |
Greg Daniel | fa3adf7 | 2019-11-07 09:53:41 -0500 | [diff] [blame] | 349 | GrVkGpu* gpu = this->getVkGpu(); |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 350 | |
Greg Daniel | a92d787 | 2021-04-07 11:08:36 -0400 | [diff] [blame] | 351 | auto[renderPass, compatibleHandle] = |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 352 | this->createSimpleRenderPass(withResolve, withStencil, selfDepFlags, loadFromResolve); |
Greg Daniel | ed98476 | 2019-11-07 17:15:45 -0500 | [diff] [blame] | 353 | if (!renderPass) { |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 354 | return; |
Greg Daniel | ed98476 | 2019-11-07 17:15:45 -0500 | [diff] [blame] | 355 | } |
Greg Daniel | a92d787 | 2021-04-07 11:08:36 -0400 | [diff] [blame] | 356 | SkASSERT(compatibleHandle.isValid()); |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 357 | |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 358 | int cacheIndex = |
| 359 | renderpass_features_to_index(withResolve, withStencil, selfDepFlags, loadFromResolve); |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 360 | SkASSERT(cacheIndex < GrVkRenderTarget::kNumCachedFramebuffers); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 361 | |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 362 | GrVkImage* resolve = withResolve ? this->resolveAttachment() : nullptr; |
| 363 | GrVkImage* colorAttachment = withResolve ? this->msaaAttachment() : this->colorAttachment(); |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 364 | |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 365 | // Stencil attachment view is stored in the base RT stencil attachment |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 366 | bool useMSAA = this->numSamples() > 1 || withResolve; |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 367 | GrVkImage* stencil = withStencil ? static_cast<GrVkImage*>(this->getStencilAttachment(useMSAA)) |
| 368 | : nullptr; |
Greg Daniel | e2893f2 | 2020-10-13 10:20:06 -0400 | [diff] [blame] | 369 | fCachedFramebuffers[cacheIndex] = |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 370 | GrVkFramebuffer::Make(gpu, this->dimensions(), |
| 371 | sk_sp<const GrVkRenderPass>(renderPass), |
| 372 | colorAttachment, resolve, stencil, compatibleHandle); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 373 | } |
| 374 | |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 375 | void GrVkRenderTarget::getAttachmentsDescriptor(GrVkRenderPass::AttachmentsDescriptor* desc, |
| 376 | GrVkRenderPass::AttachmentFlags* attachmentFlags, |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 377 | bool withResolve, |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 378 | bool withStencil) { |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 379 | SkASSERT(!this->wrapsSecondaryCommandBuffer()); |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 380 | const GrVkImage* colorAttachment = |
Greg Daniel | 60ec617 | 2021-04-16 11:31:58 -0400 | [diff] [blame] | 381 | withResolve ? this->msaaAttachment() : this->colorAttachment(); |
| 382 | |
| 383 | desc->fColor.fFormat = colorAttachment->imageFormat(); |
| 384 | desc->fColor.fSamples = colorAttachment->numSamples(); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 385 | *attachmentFlags = GrVkRenderPass::kColor_AttachmentFlag; |
| 386 | uint32_t attachmentCount = 1; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 387 | |
Greg Daniel | 7acddf5 | 2020-12-16 15:15:51 -0500 | [diff] [blame] | 388 | if (withResolve) { |
| 389 | desc->fResolve.fFormat = desc->fColor.fFormat; |
| 390 | desc->fResolve.fSamples = 1; |
| 391 | *attachmentFlags |= GrVkRenderPass::kResolve_AttachmentFlag; |
| 392 | ++attachmentCount; |
| 393 | } |
| 394 | |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 395 | if (withStencil) { |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 396 | bool useMSAA = this->numSamples() > 1 || withResolve; |
| 397 | const GrAttachment* stencil = this->getStencilAttachment(useMSAA); |
Robert Phillips | 96f2237 | 2020-05-20 12:31:18 -0400 | [diff] [blame] | 398 | SkASSERT(stencil); |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 399 | const GrVkImage* vkStencil = static_cast<const GrVkImage*>(stencil); |
Jim Van Verth | bb60408 | 2020-04-13 13:05:07 -0400 | [diff] [blame] | 400 | desc->fStencil.fFormat = vkStencil->imageFormat(); |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 401 | desc->fStencil.fSamples = vkStencil->numSamples(); |
Chris Dalton | 57ab06c | 2021-04-22 12:57:28 -0600 | [diff] [blame] | 402 | SkASSERT(desc->fStencil.fSamples == desc->fColor.fSamples); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 403 | *attachmentFlags |= GrVkRenderPass::kStencil_AttachmentFlag; |
| 404 | ++attachmentCount; |
| 405 | } |
| 406 | desc->fAttachmentCount = attachmentCount; |
| 407 | } |
| 408 | |
Robert Phillips | 24e2f6e | 2020-06-26 08:30:07 -0400 | [diff] [blame] | 409 | void GrVkRenderTarget::ReconstructAttachmentsDescriptor(const GrVkCaps& vkCaps, |
| 410 | const GrProgramInfo& programInfo, |
| 411 | GrVkRenderPass::AttachmentsDescriptor* desc, |
| 412 | GrVkRenderPass::AttachmentFlags* flags) { |
| 413 | VkFormat format; |
| 414 | SkAssertResult(programInfo.backendFormat().asVkFormat(&format)); |
| 415 | |
| 416 | desc->fColor.fFormat = format; |
| 417 | desc->fColor.fSamples = programInfo.numSamples(); |
| 418 | *flags = GrVkRenderPass::kColor_AttachmentFlag; |
| 419 | uint32_t attachmentCount = 1; |
| 420 | |
Greg Daniel | 1e16937 | 2021-08-24 15:44:15 -0400 | [diff] [blame] | 421 | if (vkCaps.programInfoWillUseDiscardableMSAA(programInfo)) { |
Greg Daniel | a1b5d7e | 2020-12-17 10:36:58 -0500 | [diff] [blame] | 422 | desc->fResolve.fFormat = desc->fColor.fFormat; |
| 423 | desc->fResolve.fSamples = 1; |
| 424 | *flags |= GrVkRenderPass::kResolve_AttachmentFlag; |
| 425 | ++attachmentCount; |
| 426 | } |
| 427 | |
Chris Dalton | 57ab06c | 2021-04-22 12:57:28 -0600 | [diff] [blame] | 428 | SkASSERT(!programInfo.isStencilEnabled() || programInfo.needsStencil()); |
| 429 | if (programInfo.needsStencil()) { |
Greg Daniel | 8ade5e8 | 2020-10-07 13:09:48 -0400 | [diff] [blame] | 430 | VkFormat stencilFormat = vkCaps.preferredStencilFormat(); |
| 431 | desc->fStencil.fFormat = stencilFormat; |
Chris Dalton | 57ab06c | 2021-04-22 12:57:28 -0600 | [diff] [blame] | 432 | desc->fStencil.fSamples = programInfo.numSamples(); |
| 433 | SkASSERT(desc->fStencil.fSamples == desc->fColor.fSamples); |
Robert Phillips | 24e2f6e | 2020-06-26 08:30:07 -0400 | [diff] [blame] | 434 | *flags |= GrVkRenderPass::kStencil_AttachmentFlag; |
| 435 | ++attachmentCount; |
| 436 | } |
| 437 | desc->fAttachmentCount = attachmentCount; |
| 438 | } |
| 439 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 440 | GrVkRenderTarget::~GrVkRenderTarget() { |
| 441 | // either release or abandon should have been called by the owner of this object. |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 442 | SkASSERT(!fColorAttachment); |
| 443 | SkASSERT(!fResolveAttachment); |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 444 | SkASSERT(!fDynamicMSAAAttachment); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 445 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 446 | for (int i = 0; i < kNumCachedFramebuffers; ++i) { |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 447 | SkASSERT(!fCachedFramebuffers[i]); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 448 | } |
Greg Daniel | 37fd658 | 2020-09-14 12:36:09 -0400 | [diff] [blame] | 449 | |
| 450 | SkASSERT(!fCachedInputDescriptorSet); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 451 | } |
| 452 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 453 | void GrVkRenderTarget::releaseInternalObjects() { |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 454 | fColorAttachment.reset(); |
| 455 | fResolveAttachment.reset(); |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 456 | fDynamicMSAAAttachment.reset(); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 457 | |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 458 | for (int i = 0; i < kNumCachedFramebuffers; ++i) { |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 459 | if (fCachedFramebuffers[i]) { |
Greg Daniel | 805c622 | 2021-04-20 12:44:48 -0400 | [diff] [blame] | 460 | fCachedFramebuffers[i].reset(); |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 461 | } |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 462 | } |
Greg Daniel | 2177436 | 2020-09-14 10:36:43 -0400 | [diff] [blame] | 463 | |
Greg Daniel | 37fd658 | 2020-09-14 12:36:09 -0400 | [diff] [blame] | 464 | if (fCachedInputDescriptorSet) { |
| 465 | fCachedInputDescriptorSet->recycle(); |
| 466 | fCachedInputDescriptorSet = nullptr; |
| 467 | } |
| 468 | |
Greg Daniel | de4bbdb | 2021-04-13 14:23:23 -0400 | [diff] [blame] | 469 | fExternalFramebuffer.reset(); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 470 | } |
| 471 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 472 | void GrVkRenderTarget::onRelease() { |
| 473 | this->releaseInternalObjects(); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 474 | GrRenderTarget::onRelease(); |
| 475 | } |
| 476 | |
| 477 | void GrVkRenderTarget::onAbandon() { |
Greg Daniel | f0e04f0 | 2019-12-04 15:17:54 -0500 | [diff] [blame] | 478 | this->releaseInternalObjects(); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 479 | GrRenderTarget::onAbandon(); |
| 480 | } |
| 481 | |
Robert Phillips | b67821d | 2017-12-13 15:00:45 -0500 | [diff] [blame] | 482 | GrBackendRenderTarget GrVkRenderTarget::getBackendRenderTarget() const { |
Greg Daniel | b46add8 | 2019-01-02 14:51:29 -0500 | [diff] [blame] | 483 | SkASSERT(!this->wrapsSecondaryCommandBuffer()); |
Greg Daniel | 80ef70e | 2021-03-10 16:17:21 -0500 | [diff] [blame] | 484 | // This should only get called with a non-released GrVkRenderTargets. |
| 485 | SkASSERT(!this->wasDestroyed()); |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 486 | // If we have a resolve attachment that is what we return for the backend render target |
Greg Daniel | 2bc96d6 | 2021-09-13 13:08:02 -0400 | [diff] [blame] | 487 | const GrVkImage* beAttachment = this->externalAttachment(); |
Greg Daniel | 00d6cf4 | 2021-03-05 22:50:08 +0000 | [diff] [blame] | 488 | return GrBackendRenderTarget(beAttachment->width(), beAttachment->height(), |
| 489 | beAttachment->vkImageInfo(), beAttachment->getMutableState()); |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 490 | } |
| 491 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 492 | GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
| 493 | SkASSERT(!this->wasDestroyed()); |
| 494 | return static_cast<GrVkGpu*>(this->getGpu()); |
| 495 | } |