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

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

Issue 1906623002: Update min Vulkan version to 1.0.8.0, and fix various bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | src/gpu/vk/GrVkStencilAttachment.cpp » ('j') | 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 "GrVkRenderTarget.h" 8 #include "GrVkRenderTarget.h"
9 9
10 #include "GrRenderTargetPriv.h" 10 #include "GrRenderTargetPriv.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 SkASSERT(info); 209 SkASSERT(info);
210 // We can wrap a rendertarget without its allocation, as long as we don't ta ke ownership 210 // We can wrap a rendertarget without its allocation, as long as we don't ta ke ownership
211 SkASSERT(VK_NULL_HANDLE != info->fImage); 211 SkASSERT(VK_NULL_HANDLE != info->fImage);
212 SkASSERT(VK_NULL_HANDLE != info->fAlloc || kAdopted_LifeCycle != lifeCycle); 212 SkASSERT(VK_NULL_HANDLE != info->fAlloc || kAdopted_LifeCycle != lifeCycle);
213 213
214 GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTi ling) 214 GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTi ling)
215 ? Resource::kLinearTiling_Flag : Resource:: kNo_Flags; 215 ? Resource::kLinearTiling_Flag : Resource:: kNo_Flags;
216 216
217 const GrVkImage::Resource* imageResource; 217 const GrVkImage::Resource* imageResource;
218 if (kBorrowed_LifeCycle == lifeCycle) { 218 if (kBorrowed_LifeCycle == lifeCycle) {
219 imageResource = new GrVkImage::BorrowedResource(info->fImage, info->fAll oc, flags); 219 imageResource = new GrVkImage::BorrowedResource(info->fImage,
220 info->fAlloc,
221 flags,
222 info->fFormat);
220 } else { 223 } else {
221 imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flag s); 224 imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flag s, info->fFormat);
222 } 225 }
223 if (!imageResource) { 226 if (!imageResource) {
224 return nullptr; 227 return nullptr;
225 } 228 }
226 229
227 GrVkRenderTarget* rt = GrVkRenderTarget::Create(gpu, desc, lifeCycle, imageR esource); 230 GrVkRenderTarget* rt = GrVkRenderTarget::Create(gpu, desc, lifeCycle, imageR esource);
228 if (rt) { 231 if (rt) {
229 rt->fCurrentLayout = info->fImageLayout; 232 rt->fCurrentLayout = info->fImageLayout;
230 } 233 }
231 // Create() will increment the refCount of the image resource if it succeeds 234 // Create() will increment the refCount of the image resource if it succeeds
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } 406 }
404 407
405 return nullptr; 408 return nullptr;
406 } 409 }
407 410
408 411
409 GrVkGpu* GrVkRenderTarget::getVkGpu() const { 412 GrVkGpu* GrVkRenderTarget::getVkGpu() const {
410 SkASSERT(!this->wasDestroyed()); 413 SkASSERT(!this->wasDestroyed());
411 return static_cast<GrVkGpu*>(this->getGpu()); 414 return static_cast<GrVkGpu*>(this->getGpu());
412 } 415 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | src/gpu/vk/GrVkStencilAttachment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698