| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 msImageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; | 53 msImageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; |
| 54 | 54 |
| 55 if (!GrVkImage::InitImageInfo(gpu, msImageDesc, &msInfo)) { | 55 if (!GrVkImage::InitImageInfo(gpu, msImageDesc, &msInfo)) { |
| 56 imageView->unref(gpu); |
| 56 return nullptr; | 57 return nullptr; |
| 57 } | 58 } |
| 58 | 59 |
| 59 // Set color attachment image | 60 // Set color attachment image |
| 60 colorImage = msInfo.fImage; | 61 colorImage = msInfo.fImage; |
| 61 | 62 |
| 62 // Create resolve attachment view. | 63 // Create resolve attachment view. |
| 63 resolveAttachmentView = GrVkImageView::Create(gpu, image, pixelFormat, | 64 resolveAttachmentView = GrVkImageView::Create(gpu, image, pixelFormat, |
| 64 GrVkImageView::kColor_Type
, | 65 GrVkImageView::kColor_Type
, |
| 65 info.fLevelCount); | 66 info.fLevelCount); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return false; | 175 return false; |
| 175 } | 176 } |
| 176 fColorAttachmentView->unref(gpu); | 177 fColorAttachmentView->unref(gpu); |
| 177 fColorAttachmentView = colorAttachmentView; | 178 fColorAttachmentView = colorAttachmentView; |
| 178 } | 179 } |
| 179 | 180 |
| 180 this->createFramebuffer(gpu); | 181 this->createFramebuffer(gpu); |
| 181 return true; | 182 return true; |
| 182 } | 183 } |
| 183 | 184 |
| OLD | NEW |