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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 if (!msaaResource) { | 139 if (!msaaResource) { |
140 return nullptr; | 140 return nullptr; |
141 } | 141 } |
142 | 142 |
143 // Set color attachment image | 143 // Set color attachment image |
144 colorImage = msaaResource->fImage; | 144 colorImage = msaaResource->fImage; |
145 | 145 |
146 // Create Resolve attachment view | 146 // Create Resolve attachment view |
147 resolveAttachmentView = GrVkImageView::Create(gpu, imageResource->fImage
, pixelFormat, | 147 resolveAttachmentView = GrVkImageView::Create(gpu, imageResource->fImage
, pixelFormat, |
148 GrVkImageView::kColor_Type
); | 148 GrVkImageView::kColor_Type
, 1); |
149 if (!resolveAttachmentView) { | 149 if (!resolveAttachmentView) { |
150 msaaResource->unref(gpu); | 150 msaaResource->unref(gpu); |
151 return nullptr; | 151 return nullptr; |
152 } | 152 } |
153 } else { | 153 } else { |
154 // Set color attachment image | 154 // Set color attachment image |
155 colorImage = imageResource->fImage; | 155 colorImage = imageResource->fImage; |
156 } | 156 } |
157 | 157 |
158 // Get color attachment view | 158 // Get color attachment view |
159 const GrVkImageView* colorAttachmentView = GrVkImageView::Create(gpu, colorI
mage, pixelFormat, | 159 const GrVkImageView* colorAttachmentView = GrVkImageView::Create(gpu, colorI
mage, pixelFormat, |
160 GrVkImageVi
ew::kColor_Type); | 160 GrVkImageVi
ew::kColor_Type, 1); |
161 if (!colorAttachmentView) { | 161 if (!colorAttachmentView) { |
162 if (msaaResource) { | 162 if (msaaResource) { |
163 resolveAttachmentView->unref(gpu); | 163 resolveAttachmentView->unref(gpu); |
164 msaaResource->unref(gpu); | 164 msaaResource->unref(gpu); |
165 } | 165 } |
166 return NULL; | 166 return NULL; |
167 } | 167 } |
168 | 168 |
169 GrVkRenderTarget* texRT; | 169 GrVkRenderTarget* texRT; |
170 if (msaaResource) { | 170 if (msaaResource) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 } | 397 } |
398 | 398 |
399 return nullptr; | 399 return nullptr; |
400 } | 400 } |
401 | 401 |
402 | 402 |
403 GrVkGpu* GrVkRenderTarget::getVkGpu() const { | 403 GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
404 SkASSERT(!this->wasDestroyed()); | 404 SkASSERT(!this->wasDestroyed()); |
405 return static_cast<GrVkGpu*>(this->getGpu()); | 405 return static_cast<GrVkGpu*>(this->getGpu()); |
406 } | 406 } |
OLD | NEW |