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

Unified Diff: src/gpu/vk/GrVkGpu.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/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index a8525223ed15980ef86b740ec3d1c3938402d981..da245505157528732bc96e0e53f37f053624d42f 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -493,7 +493,6 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex,
VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_TRANSFER_BIT;
VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(layout);
VkAccessFlags dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
- // TODO: change layout of all the subresources
tex->setImageLayout(this,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
srcAccessMask,
@@ -727,7 +726,6 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) const {
VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(origSrcLayout);
VkAccessFlags dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
- // TODO: change layout of all the subresources
tex->setImageLayout(this, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
srcAccessMask, dstAccessMask, srcStageMask, dstStageMask, false);
@@ -750,13 +748,8 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) const {
srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(origDstLayout);
dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
- tex->setImageLayout(this,
- VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
- srcAccessMask,
- dstAccessMask,
- srcStageMask,
- dstStageMask,
- false);
+ tex->setImageLayout(this, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ srcAccessMask, dstAccessMask, srcStageMask, dstStageMask, false);
// Blit original image
int width = tex->width();
@@ -790,6 +783,7 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) const {
blitRegion.dstOffsets[1] = { width/2, height/2, 0 };
// TODO: insert image barrier to wait on previous blit
+ // TODO: change layout of src subresource to TRANSFER_SRC_OPTIMAL
fCurrentCmdBuffer->blitImage(this,
tex->resource(),
@@ -968,6 +962,7 @@ GrBackendObject GrVkGpu::createTestingOnlyBackendTexture(void* srcData, int w, i
info->fImageTiling = imageTiling;
info->fImageLayout = initialLayout;
info->fFormat = pixelFormat;
+ info->fLevelCount = 1;
return (GrBackendObject)info;
}
« no previous file with comments | « include/gpu/vk/GrVkTypes.h ('k') | src/gpu/vk/GrVkImage.h » ('j') | src/gpu/vk/GrVkImage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698