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

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

Issue 1945823002: Set barriers and image layout changes between mipmap blits. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/gpu/vk/GrVkImage.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 11 matching lines...) Expand all
22 GrVkTextureRenderTarget* GrVkTextureRenderTarget::Create(GrVkGpu* gpu, 22 GrVkTextureRenderTarget* GrVkTextureRenderTarget::Create(GrVkGpu* gpu,
23 ResourceType resourceTy pe, 23 ResourceType resourceTy pe,
24 const GrSurfaceDesc& de sc, 24 const GrSurfaceDesc& de sc,
25 VkFormat format, 25 VkFormat format,
26 const GrVkImage::Resour ce* imageResource) { 26 const GrVkImage::Resour ce* imageResource) {
27 VkImage image = imageResource->fImage; 27 VkImage image = imageResource->fImage;
28 // Create the texture ImageView 28 // Create the texture ImageView
29 uint32_t mipLevels = 1; 29 uint32_t mipLevels = 1;
30 //TODO: does a mipmapped textureRenderTarget make sense? 30 //TODO: does a mipmapped textureRenderTarget make sense?
31 //if (desc.fIsMipMapped) { 31 //if (desc.fIsMipMapped) {
32 // mipLevels = SkMipMap::ComputeLevelCount(this->width(), this->height()) ; 32 // mipLevels = SkMipMap::ComputeLevelCount(this->width(), this->height()) + 1;
33 //} 33 //}
34 const GrVkImageView* imageView = GrVkImageView::Create(gpu, image, format, 34 const GrVkImageView* imageView = GrVkImageView::Create(gpu, image, format,
35 GrVkImageView::kColor _Type, mipLevels); 35 GrVkImageView::kColor _Type, mipLevels);
36 if (!imageView) { 36 if (!imageView) {
37 return nullptr; 37 return nullptr;
38 } 38 }
39 39
40 VkFormat pixelFormat; 40 VkFormat pixelFormat;
41 GrPixelConfigToVkFormat(desc.fConfig, &pixelFormat); 41 GrPixelConfigToVkFormat(desc.fConfig, &pixelFormat);
42 42
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 171 }
172 GrVkTextureRenderTarget* trt = Create(gpu, kWrapped, desc, format, imageReso urce); 172 GrVkTextureRenderTarget* trt = Create(gpu, kWrapped, desc, format, imageReso urce);
173 if (trt) { 173 if (trt) {
174 trt->fCurrentLayout = info->fImageLayout; 174 trt->fCurrentLayout = info->fImageLayout;
175 } 175 }
176 // 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
177 imageResource->unref(gpu); 177 imageResource->unref(gpu);
178 178
179 return trt; 179 return trt;
180 } 180 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698