diff options
Diffstat (limited to 'include/gpu/vk')
-rw-r--r-- | include/gpu/vk/GrVkTypes.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/gpu/vk/GrVkTypes.h b/include/gpu/vk/GrVkTypes.h index aa1334adca..e9a312160d 100644 --- a/include/gpu/vk/GrVkTypes.h +++ b/include/gpu/vk/GrVkTypes.h @@ -9,6 +9,7 @@ #ifndef GrVkTypes_DEFINED #define GrVkTypes_DEFINED +#include "GrExternalTextureData.h" #include "GrTypes.h" #include "vk/GrVkDefines.h" @@ -59,6 +60,23 @@ struct GrVkImageInfo { void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } }; +class GrVkExternalTextureData : public GrExternalTextureData { +public: + GrVkExternalTextureData(const GrVkImageInfo& info, GrFence fence) + : INHERITED(fence) + , fInfo(info) {} + GrBackend getBackend() const override { return kVulkan_GrBackend; } + +protected: + GrBackendObject getBackendObject() const override { + return reinterpret_cast<GrBackendObject>(&fInfo); + } + + GrVkImageInfo fInfo; + + typedef GrExternalTextureData INHERITED; +}; + GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); #endif |