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

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

Issue 2256843002: Don't add the resolve attachment to vulkan render passes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 3 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/GrVkFramebuffer.h ('k') | src/gpu/vk/GrVkGpu.cpp » ('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 2016 Google Inc. 2 * Copyright 2016 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 "GrVkFramebuffer.h" 8 #include "GrVkFramebuffer.h"
9 9
10 #include "GrVkGpu.h" 10 #include "GrVkGpu.h"
11 #include "GrVkImageView.h" 11 #include "GrVkImageView.h"
12 #include "GrVkRenderPass.h" 12 #include "GrVkRenderPass.h"
13 13
14 GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu, 14 GrVkFramebuffer* GrVkFramebuffer::Create(GrVkGpu* gpu,
15 int width, int height, 15 int width, int height,
16 const GrVkRenderPass* renderPass, 16 const GrVkRenderPass* renderPass,
17 const GrVkImageView* colorAttachment, 17 const GrVkImageView* colorAttachment,
18 const GrVkImageView* resolveAttachment,
19 const GrVkImageView* stencilAttachment) { 18 const GrVkImageView* stencilAttachment) {
20 // At the very least we need a renderPass and a colorAttachment 19 // At the very least we need a renderPass and a colorAttachment
21 SkASSERT(renderPass); 20 SkASSERT(renderPass);
22 SkASSERT(colorAttachment); 21 SkASSERT(colorAttachment);
23 22
24 VkImageView attachments[3]; 23 VkImageView attachments[3];
25 attachments[0] = colorAttachment->imageView(); 24 attachments[0] = colorAttachment->imageView();
26 int numAttachments = 1; 25 int numAttachments = 1;
27 if (resolveAttachment) {
28 attachments[numAttachments++] = resolveAttachment->imageView();
29 }
30 if (stencilAttachment) { 26 if (stencilAttachment) {
31 attachments[numAttachments++] = stencilAttachment->imageView(); 27 attachments[numAttachments++] = stencilAttachment->imageView();
32 } 28 }
33 29
34 VkFramebufferCreateInfo createInfo; 30 VkFramebufferCreateInfo createInfo;
35 memset(&createInfo, 0, sizeof(VkFramebufferCreateInfo)); 31 memset(&createInfo, 0, sizeof(VkFramebufferCreateInfo));
36 createInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; 32 createInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
37 createInfo.pNext = nullptr; 33 createInfo.pNext = nullptr;
38 createInfo.flags = 0; 34 createInfo.flags = 0;
39 createInfo.renderPass = renderPass->vkRenderPass(); 35 createInfo.renderPass = renderPass->vkRenderPass();
(...skipping 12 matching lines...) Expand all
52 return nullptr; 48 return nullptr;
53 } 49 }
54 50
55 return new GrVkFramebuffer(framebuffer); 51 return new GrVkFramebuffer(framebuffer);
56 } 52 }
57 53
58 void GrVkFramebuffer::freeGPUData(const GrVkGpu* gpu) const { 54 void GrVkFramebuffer::freeGPUData(const GrVkGpu* gpu) const {
59 SkASSERT(fFramebuffer); 55 SkASSERT(fFramebuffer);
60 GR_VK_CALL(gpu->vkInterface(), DestroyFramebuffer(gpu->device(), fFramebuffe r, nullptr)); 56 GR_VK_CALL(gpu->vkInterface(), DestroyFramebuffer(gpu->device(), fFramebuffe r, nullptr));
61 } 57 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkFramebuffer.h ('k') | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698