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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 const GrVkImageView* resolveAttachmentView = nullptr; | 128 const GrVkImageView* resolveAttachmentView = nullptr; |
129 if (desc.fSampleCnt) { | 129 if (desc.fSampleCnt) { |
130 GrVkImage::ImageDesc msImageDesc; | 130 GrVkImage::ImageDesc msImageDesc; |
131 msImageDesc.fImageType = VK_IMAGE_TYPE_2D; | 131 msImageDesc.fImageType = VK_IMAGE_TYPE_2D; |
132 msImageDesc.fFormat = pixelFormat; | 132 msImageDesc.fFormat = pixelFormat; |
133 msImageDesc.fWidth = desc.fWidth; | 133 msImageDesc.fWidth = desc.fWidth; |
134 msImageDesc.fHeight = desc.fHeight; | 134 msImageDesc.fHeight = desc.fHeight; |
135 msImageDesc.fLevels = 1; | 135 msImageDesc.fLevels = 1; |
136 msImageDesc.fSamples = desc.fSampleCnt; | 136 msImageDesc.fSamples = desc.fSampleCnt; |
137 msImageDesc.fImageTiling = VK_IMAGE_TILING_OPTIMAL; | 137 msImageDesc.fImageTiling = VK_IMAGE_TILING_OPTIMAL; |
138 msImageDesc.fUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; | 138 msImageDesc.fUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 139 VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 140 VK_IMAGE_USAGE_TRANSFER_SRC_BIT; |
139 msImageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; | 141 msImageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; |
140 | 142 |
141 if (!GrVkImage::InitImageInfo(gpu, msImageDesc, &msInfo)) { | 143 if (!GrVkImage::InitImageInfo(gpu, msImageDesc, &msInfo)) { |
142 return nullptr; | 144 return nullptr; |
143 } | 145 } |
144 | 146 |
145 // Set color attachment image | 147 // Set color attachment image |
146 colorImage = msInfo.fImage; | 148 colorImage = msInfo.fImage; |
147 | 149 |
148 // Create Resolve attachment view | 150 // Create Resolve attachment view |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 } | 375 } |
374 | 376 |
375 return nullptr; | 377 return nullptr; |
376 } | 378 } |
377 | 379 |
378 | 380 |
379 GrVkGpu* GrVkRenderTarget::getVkGpu() const { | 381 GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
380 SkASSERT(!this->wasDestroyed()); | 382 SkASSERT(!this->wasDestroyed()); |
381 return static_cast<GrVkGpu*>(this->getGpu()); | 383 return static_cast<GrVkGpu*>(this->getGpu()); |
382 } | 384 } |
OLD | NEW |