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 |