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

Side by Side Diff: src/gpu/vk/GrVkTextureRenderTarget.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/GrVkTexture.cpp ('k') | tools/vulkan/VulkanTestContext.h » ('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 "GrVkTextureRenderTarget.h" 8 #include "GrVkTextureRenderTarget.h"
9 9
10 #include "GrRenderTargetPriv.h" 10 #include "GrRenderTargetPriv.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 const GrVkTextureInfo* info) { 145 const GrVkTextureInfo* info) {
146 SkASSERT(info); 146 SkASSERT(info);
147 // Wrapped textures require both image and allocation (because they can be m apped) 147 // Wrapped textures require both image and allocation (because they can be m apped)
148 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc); 148 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc);
149 149
150 GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTi ling) 150 GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTi ling)
151 ? Resource::kLinearTiling_Flag : Resource:: kNo_Flags; 151 ? Resource::kLinearTiling_Flag : Resource:: kNo_Flags;
152 152
153 const GrVkImage::Resource* imageResource; 153 const GrVkImage::Resource* imageResource;
154 if (kBorrowed_LifeCycle == lifeCycle) { 154 if (kBorrowed_LifeCycle == lifeCycle) {
155 imageResource = new GrVkImage::BorrowedResource(info->fImage, info->fAll oc, flags); 155 imageResource = new GrVkImage::BorrowedResource(info->fImage,
156 info->fAlloc,
157 flags,
158 info->fFormat);
156 } else { 159 } else {
157 imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flag s); 160 imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flag s, info->fFormat);
158 } 161 }
159 if (!imageResource) { 162 if (!imageResource) {
160 return nullptr; 163 return nullptr;
161 } 164 }
162 165
163 GrVkTextureRenderTarget* trt = GrVkTextureRenderTarget::Create(gpu, desc, li feCycle, 166 GrVkTextureRenderTarget* trt = GrVkTextureRenderTarget::Create(gpu, desc, li feCycle,
164 format, image Resource); 167 format, image Resource);
165 if (trt) { 168 if (trt) {
166 trt->fCurrentLayout = info->fImageLayout; 169 trt->fCurrentLayout = info->fImageLayout;
167 } 170 }
168 // Create() will increment the refCount of the image resource if it succeeds 171 // Create() will increment the refCount of the image resource if it succeeds
169 imageResource->unref(gpu); 172 imageResource->unref(gpu);
170 173
171 return trt; 174 return trt;
172 } 175 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkTexture.cpp ('k') | tools/vulkan/VulkanTestContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698