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

Unified Diff: src/gpu/vk/GrVkTexture.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, 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkTexture.cpp
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index 91852da0a5834aafa4b41aba494bd264f35193c3..1e1e1b2fa5a3689aded56481545181b752c80076 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -55,13 +55,13 @@ template<typename ResourceType>
GrVkTexture* GrVkTexture::Create(GrVkGpu* gpu,
ResourceType type,
const GrSurfaceDesc& desc,
- VkFormat format, uint32_t levels,
+ VkFormat format,
const GrVkImage::Resource* imageResource) {
VkImage image = imageResource->fImage;
const GrVkImageView* imageView = GrVkImageView::Create(gpu, image, format,
GrVkImageView::kColor_Type,
- levels);
+ imageResource->fLevelCount);
if (!imageView) {
return nullptr;
}
@@ -79,8 +79,7 @@ GrVkTexture* GrVkTexture::CreateNewTexture(GrVkGpu* gpu, SkBudgeted budgeted,
return nullptr;
}
- GrVkTexture* texture = Create(gpu, budgeted, desc, imageDesc.fFormat, imageDesc.fLevels,
- imageResource);
+ GrVkTexture* texture = Create(gpu, budgeted, desc, imageDesc.fFormat, imageResource);
// Create() will increment the refCount of the image resource if it succeeds
imageResource->unref(gpu);
@@ -103,17 +102,18 @@ GrVkTexture* GrVkTexture::CreateWrappedTexture(GrVkGpu* gpu,
if (kBorrow_GrWrapOwnership == ownership) {
imageResource = new GrVkImage::BorrowedResource(info->fImage,
info->fAlloc,
- flags,
- info->fFormat);
+ info->fFormat,
+ info->fLevelCount,
+ flags);
} else {
- imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flags, info->fFormat);
+ imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, info->fFormat,
+ info->fLevelCount, flags);
}
if (!imageResource) {
return nullptr;
}
- // We have no other information so we have to assume that wrapped textures have only one level
- GrVkTexture* texture = Create(gpu, kWrapped, desc, format, 1, imageResource);
+ GrVkTexture* texture = Create(gpu, kWrapped, desc, format, imageResource);
if (texture) {
texture->fCurrentLayout = info->fImageLayout;
}

Powered by Google App Engine
This is Rietveld 408576698