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

Unified Diff: include/gpu/vk/GrVkTypes.h

Issue 1974983002: Refactor Vulkan image, texture, RTs so that create and getter handles match. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixLayerVersion
Patch Set: nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/imagefromyuvtextures.cpp ('k') | src/gpu/vk/GrVkCommandBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/vk/GrVkTypes.h
diff --git a/include/gpu/vk/GrVkTypes.h b/include/gpu/vk/GrVkTypes.h
index 2e6a2556303c19fafe4a4e803dea9f6ba832f055..deee409e6f6186e189127440dee24f3620c67c39 100644
--- a/include/gpu/vk/GrVkTypes.h
+++ b/include/gpu/vk/GrVkTypes.h
@@ -27,18 +27,22 @@
///////////////////////////////////////////////////////////////////////////////
/**
* Types for interacting with Vulkan resources created externally to Skia. GrBackendObjects for
- * Vulkan textures are really const GrVkTextureInfo*
+ * Vulkan textures are really const GrVkImageInfo*
*/
-
-struct GrVkTextureInfo {
+struct GrVkImageInfo {
VkImage fImage;
- VkDeviceMemory fAlloc; // this may be null iff the texture is an RT and uses borrow semantics
+ VkDeviceMemory fAlloc; // can be VK_NULL_HANDLE iff Tex is an RT and uses borrow semantics
VkImageTiling fImageTiling;
VkImageLayout fImageLayout;
VkFormat fFormat;
uint32_t fLevelCount;
+
+ // This gives a way for a client to update the layout of the Image if they change the layout
+ // while we're still holding onto the wrapped texture. They will first need to get a handle
+ // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTexture.
+ void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; }
};
-GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkTextureInfo*));
+GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*));
#endif
« no previous file with comments | « gm/imagefromyuvtextures.cpp ('k') | src/gpu/vk/GrVkCommandBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698