Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: src/gpu/vk/GrVkRenderTarget.cpp

Issue 1977403002: Refactor creation of GrVkRenderPasses to make them move general (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: review nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkRenderTarget.h ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkRenderTarget.h ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698