Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: src/gpu/vk/GrVkTextureRenderTarget.cpp

Issue 1943933002: Apply setImageLayout() to all of a VkImage's subresources. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/gpu/vk/GrVkImage.cpp ('K') | « src/gpu/vk/GrVkTexture.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Wrapped textures require both image and allocation (because they can be m apped) 152 // Wrapped textures require both image and allocation (because they can be m apped)
153 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc); 153 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc);
154 154
155 GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTi ling) 155 GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTi ling)
156 ? Resource::kLinearTiling_Flag : Resource:: kNo_Flags; 156 ? Resource::kLinearTiling_Flag : Resource:: kNo_Flags;
157 157
158 const GrVkImage::Resource* imageResource; 158 const GrVkImage::Resource* imageResource;
159 if (kBorrow_GrWrapOwnership == ownership) { 159 if (kBorrow_GrWrapOwnership == ownership) {
160 imageResource = new GrVkImage::BorrowedResource(info->fImage, 160 imageResource = new GrVkImage::BorrowedResource(info->fImage,
161 info->fAlloc, 161 info->fAlloc,
162 flags, 162 info->fFormat,
163 info->fFormat); 163 info->fLevelCount,
164 flags);
164 } else { 165 } else {
165 imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flag s, info->fFormat); 166 imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, info ->fFormat,
167 info->fLevelCount, flags);
166 } 168 }
167 if (!imageResource) { 169 if (!imageResource) {
168 return nullptr; 170 return nullptr;
169 } 171 }
170 GrVkTextureRenderTarget* trt = Create(gpu, kWrapped, desc, format, imageReso urce); 172 GrVkTextureRenderTarget* trt = Create(gpu, kWrapped, desc, format, imageReso urce);
171 if (trt) { 173 if (trt) {
172 trt->fCurrentLayout = info->fImageLayout; 174 trt->fCurrentLayout = info->fImageLayout;
173 } 175 }
174 // Create() will increment the refCount of the image resource if it succeeds 176 // Create() will increment the refCount of the image resource if it succeeds
175 imageResource->unref(gpu); 177 imageResource->unref(gpu);
176 178
177 return trt; 179 return trt;
178 } 180 }
OLDNEW
« src/gpu/vk/GrVkImage.cpp ('K') | « src/gpu/vk/GrVkTexture.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698