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 "GrVkRenderPass.h" | 8 #include "GrVkRenderPass.h" |
9 | 9 |
10 #include "GrVkFramebuffer.h" | 10 #include "GrVkFramebuffer.h" |
11 #include "GrVkGpu.h" | 11 #include "GrVkGpu.h" |
12 #include "GrVkRenderTarget.h" | 12 #include "GrVkRenderTarget.h" |
13 #include "GrVkUtil.h" | 13 #include "GrVkUtil.h" |
14 | 14 |
15 void setup_simple_vk_attachment_description(VkAttachmentDescription* attachment, | 15 void setup_simple_vk_attachment_description(VkAttachmentDescription* attachment, |
16 VkFormat format, | 16 VkFormat format, |
17 uint32_t samples, | 17 uint32_t samples, |
18 VkImageLayout layout) { | 18 VkImageLayout layout) { |
19 attachment->flags = 0; | 19 attachment->flags = 0; |
20 attachment->format = format; | 20 attachment->format = format; |
21 SkAssertResult(GrSampleCountToVkSampleCount(samples, &attachment->samples)); | 21 SkAssertResult(GrSampleCountToVkSampleCount(samples, &attachment->samples)); |
22 attachment->loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; | 22 attachment->loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; |
23 attachment->storeOp = VK_ATTACHMENT_STORE_OP_STORE; | 23 attachment->storeOp = VK_ATTACHMENT_STORE_OP_STORE; |
24 attachment->stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD; | 24 attachment->stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD; |
25 attachment->storeOp = VK_ATTACHMENT_STORE_OP_STORE; | 25 attachment->stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE; |
26 attachment->initialLayout = layout; | 26 attachment->initialLayout = layout; |
27 attachment->finalLayout = layout; | 27 attachment->finalLayout = layout; |
28 } | 28 } |
29 | 29 |
30 void GrVkRenderPass::initSimple(const GrVkGpu* gpu, const GrVkRenderTarget& targ
et) { | 30 void GrVkRenderPass::initSimple(const GrVkGpu* gpu, const GrVkRenderTarget& targ
et) { |
31 // Get attachment information from render target. This includes which attach
ments the render | 31 // Get attachment information from render target. This includes which attach
ments the render |
32 // target has (color, resolve, stencil) and the attachments format and sampl
e count. | 32 // target has (color, resolve, stencil) and the attachments format and sampl
e count. |
33 target.getAttachmentsDescriptor(&fAttachmentsDescriptor, &fAttachmentFlags); | 33 target.getAttachmentsDescriptor(&fAttachmentsDescriptor, &fAttachmentFlags); |
34 | 34 |
35 uint32_t numAttachments = fAttachmentsDescriptor.fAttachmentCount; | 35 uint32_t numAttachments = fAttachmentsDescriptor.fAttachmentCount; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 211 } |
212 } | 212 } |
213 if (fAttachmentFlags & kStencil_AttachmentFlag) { | 213 if (fAttachmentFlags & kStencil_AttachmentFlag) { |
214 if (fAttachmentsDescriptor.fStencil != desc.fStencil) { | 214 if (fAttachmentsDescriptor.fStencil != desc.fStencil) { |
215 return false; | 215 return false; |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 return true; | 219 return true; |
220 } | 220 } |
OLD | NEW |