OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrVkRenderTarget.h" | 8 #include "GrVkRenderTarget.h" |
9 | 9 |
10 #include "GrRenderTargetPriv.h" | 10 #include "GrRenderTargetPriv.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 void GrVkRenderTarget::createFramebuffer(GrVkGpu* gpu) { | 224 void GrVkRenderTarget::createFramebuffer(GrVkGpu* gpu) { |
225 if (fFramebuffer) { | 225 if (fFramebuffer) { |
226 fFramebuffer->unref(gpu); | 226 fFramebuffer->unref(gpu); |
227 } | 227 } |
228 if (fCachedSimpleRenderPass) { | 228 if (fCachedSimpleRenderPass) { |
229 fCachedSimpleRenderPass->unref(gpu); | 229 fCachedSimpleRenderPass->unref(gpu); |
230 } | 230 } |
231 | 231 |
232 // Vulkan requires us to create a compatible renderpass before we can create
our framebuffer, | 232 // Vulkan requires us to create a compatible renderpass before we can create
our framebuffer, |
233 // so we use this to get a (cached) basic renderpass, only for creation. | 233 // so we use this to get a (cached) basic renderpass, only for creation. |
234 fCachedSimpleRenderPass = gpu->resourceProvider().findOrCreateCompatibleRend
erPass(*this); | 234 fCachedSimpleRenderPass = |
| 235 gpu->resourceProvider().findCompatibleRenderPass(*this, &fCompatibleRPHa
ndle); |
235 | 236 |
236 // Stencil attachment view is stored in the base RT stencil attachment | 237 // Stencil attachment view is stored in the base RT stencil attachment |
237 const GrVkImageView* stencilView = this->stencilAttachmentView(); | 238 const GrVkImageView* stencilView = this->stencilAttachmentView(); |
238 fFramebuffer = GrVkFramebuffer::Create(gpu, this->width(), this->height(), | 239 fFramebuffer = GrVkFramebuffer::Create(gpu, this->width(), this->height(), |
239 fCachedSimpleRenderPass, fColorAttach
mentView, | 240 fCachedSimpleRenderPass, fColorAttach
mentView, |
240 fResolveAttachmentView, stencilView); | 241 fResolveAttachmentView, stencilView); |
241 SkASSERT(fFramebuffer); | 242 SkASSERT(fFramebuffer); |
242 } | 243 } |
243 | 244 |
244 void GrVkRenderTarget::getAttachmentsDescriptor( | 245 void GrVkRenderTarget::getAttachmentsDescriptor( |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 381 } |
381 | 382 |
382 return nullptr; | 383 return nullptr; |
383 } | 384 } |
384 | 385 |
385 | 386 |
386 GrVkGpu* GrVkRenderTarget::getVkGpu() const { | 387 GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
387 SkASSERT(!this->wasDestroyed()); | 388 SkASSERT(!this->wasDestroyed()); |
388 return static_cast<GrVkGpu*>(this->getGpu()); | 389 return static_cast<GrVkGpu*>(this->getGpu()); |
389 } | 390 } |
OLD | NEW |