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 "GrVkTextureRenderTarget.h" | 8 #include "GrVkTextureRenderTarget.h" |
9 | 9 |
10 #include "GrRenderTargetPriv.h" | 10 #include "GrRenderTargetPriv.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const GrVkImageView* resolveAttachmentView = nullptr; | 42 const GrVkImageView* resolveAttachmentView = nullptr; |
43 if (desc.fSampleCnt) { | 43 if (desc.fSampleCnt) { |
44 GrVkImage::ImageDesc msImageDesc; | 44 GrVkImage::ImageDesc msImageDesc; |
45 msImageDesc.fImageType = VK_IMAGE_TYPE_2D; | 45 msImageDesc.fImageType = VK_IMAGE_TYPE_2D; |
46 msImageDesc.fFormat = pixelFormat; | 46 msImageDesc.fFormat = pixelFormat; |
47 msImageDesc.fWidth = desc.fWidth; | 47 msImageDesc.fWidth = desc.fWidth; |
48 msImageDesc.fHeight = desc.fHeight; | 48 msImageDesc.fHeight = desc.fHeight; |
49 msImageDesc.fLevels = 1; | 49 msImageDesc.fLevels = 1; |
50 msImageDesc.fSamples = desc.fSampleCnt; | 50 msImageDesc.fSamples = desc.fSampleCnt; |
51 msImageDesc.fImageTiling = VK_IMAGE_TILING_OPTIMAL; | 51 msImageDesc.fImageTiling = VK_IMAGE_TILING_OPTIMAL; |
52 msImageDesc.fUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; | 52 msImageDesc.fUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 53 VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 54 VK_IMAGE_USAGE_TRANSFER_SRC_BIT; |
53 msImageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; | 55 msImageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; |
54 | 56 |
55 if (!GrVkImage::InitImageInfo(gpu, msImageDesc, &msInfo)) { | 57 if (!GrVkImage::InitImageInfo(gpu, msImageDesc, &msInfo)) { |
56 imageView->unref(gpu); | 58 imageView->unref(gpu); |
57 return nullptr; | 59 return nullptr; |
58 } | 60 } |
59 | 61 |
60 // Set color attachment image | 62 // Set color attachment image |
61 colorImage = msInfo.fImage; | 63 colorImage = msInfo.fImage; |
62 | 64 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return false; | 177 return false; |
176 } | 178 } |
177 fColorAttachmentView->unref(gpu); | 179 fColorAttachmentView->unref(gpu); |
178 fColorAttachmentView = colorAttachmentView; | 180 fColorAttachmentView = colorAttachmentView; |
179 } | 181 } |
180 | 182 |
181 this->createFramebuffer(gpu); | 183 this->createFramebuffer(gpu); |
182 return true; | 184 return true; |
183 } | 185 } |
184 | 186 |
OLD | NEW |