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 "GrProcessor.h" |
10 #include "GrVkFramebuffer.h" | 11 #include "GrVkFramebuffer.h" |
11 #include "GrVkGpu.h" | 12 #include "GrVkGpu.h" |
12 #include "GrVkRenderTarget.h" | 13 #include "GrVkRenderTarget.h" |
13 #include "GrVkUtil.h" | 14 #include "GrVkUtil.h" |
14 | 15 |
15 void setup_simple_vk_attachment_description(VkAttachmentDescription* attachment, | 16 void setup_simple_vk_attachment_description(VkAttachmentDescription* attachment, |
16 VkFormat format, | 17 VkFormat format, |
17 uint32_t samples, | 18 uint32_t samples, |
18 VkImageLayout layout) { | 19 VkImageLayout layout) { |
19 attachment->flags = 0; | 20 attachment->flags = 0; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 212 } |
212 } | 213 } |
213 if (fAttachmentFlags & kStencil_AttachmentFlag) { | 214 if (fAttachmentFlags & kStencil_AttachmentFlag) { |
214 if (fAttachmentsDescriptor.fStencil != desc.fStencil) { | 215 if (fAttachmentsDescriptor.fStencil != desc.fStencil) { |
215 return false; | 216 return false; |
216 } | 217 } |
217 } | 218 } |
218 | 219 |
219 return true; | 220 return true; |
220 } | 221 } |
| 222 |
| 223 void GrVkRenderPass::genKey(GrProcessorKeyBuilder* b) const { |
| 224 b->add32(fAttachmentFlags); |
| 225 if (fAttachmentFlags & kColor_AttachmentFlag) { |
| 226 b->add32(fAttachmentsDescriptor.fColor.fFormat); |
| 227 b->add32(fAttachmentsDescriptor.fColor.fSamples); |
| 228 } |
| 229 if (fAttachmentFlags & kResolve_AttachmentFlag) { |
| 230 b->add32(fAttachmentsDescriptor.fResolve.fFormat); |
| 231 b->add32(fAttachmentsDescriptor.fResolve.fSamples); |
| 232 } |
| 233 if (fAttachmentFlags & kStencil_AttachmentFlag) { |
| 234 b->add32(fAttachmentsDescriptor.fStencil.fFormat); |
| 235 b->add32(fAttachmentsDescriptor.fStencil.fSamples); |
| 236 } |
| 237 } |
| 238 |
OLD | NEW |