diff options
author | Greg Daniel <egdaniel@google.com> | 2018-04-10 09:34:07 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-10 14:20:22 +0000 |
commit | 52e16d984898f18c84de773507da875a7954b922 (patch) | |
tree | 61dc6aaa14903f6b8c2e7e55d5d40c136e653354 /include/gpu/vk | |
parent | 58627cb8eb559670b86f06225eb87e6c1c5e8504 (diff) |
Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better.
The big api level change here is that the getBackendInfo calls now return by value
instead of a pointer. These changes are being made in support of Vulkan so that
the client can update the VkImageLayout on the GrBackendTexture and have that
update get reflected in our internal tracking of the image. This is done by storing
a ref counted GrVkImageLayout object on the GrBackendTexture and the GrVkImage.
Bug: skia:
Change-Id: I8c6158fd3a66eb61fef97ebf09ea5364bca3f1ae
Reviewed-on: https://skia-review.googlesource.com/119101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include/gpu/vk')
-rw-r--r-- | include/gpu/vk/GrVkTypes.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/gpu/vk/GrVkTypes.h b/include/gpu/vk/GrVkTypes.h index bfc3d5ac3e..e57845ec5d 100644 --- a/include/gpu/vk/GrVkTypes.h +++ b/include/gpu/vk/GrVkTypes.h @@ -75,6 +75,22 @@ struct GrVkImageInfo { VkFormat fFormat; uint32_t fLevelCount; + GrVkImageInfo() + : fImage(VK_NULL_HANDLE) + , fAlloc() + , fImageTiling(VK_IMAGE_TILING_OPTIMAL) + , fImageLayout(VK_IMAGE_LAYOUT_UNDEFINED) + , fFormat(VK_FORMAT_UNDEFINED) + , fLevelCount(0) {} + + GrVkImageInfo(const GrVkImageInfo& info, VkImageLayout layout) + : fImage(info.fImage) + , fAlloc(info.fAlloc) + , fImageTiling(info.fImageTiling) + , fImageLayout(layout) + , fFormat(info.fFormat) + , fLevelCount(info.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. |