Add ctor to GrVkAlloc

TBR=bsalomon@google.com

Bug: skia:
Change-Id: I7b4b372674df6ff43f737ac1b3f2f63b87719b6a
Reviewed-on: https://skia-review.googlesource.com/111660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2018-03-01 19:40:11 -05:00 committed by Skia Commit-Bot
parent ee08b4a2e9
commit a17729f36b

View File

@ -31,19 +31,32 @@
* Vulkan textures are really const GrVkImageInfo* * Vulkan textures are really const GrVkImageInfo*
*/ */
struct GrVkAlloc { struct GrVkAlloc {
VkDeviceMemory fMemory = VK_NULL_HANDLE; // can be VK_NULL_HANDLE iff is an RT and is borrowed GrVkAlloc()
VkDeviceSize fOffset = 0; : fMemory(VK_NULL_HANDLE)
VkDeviceSize fSize = 0; // this can be indeterminate iff Tex uses borrow semantics , fOffset(0)
uint32_t fFlags= 0; , fSize(0)
, fFlags(0)
, fUsesSystemHeap(false) {}
GrVkAlloc(VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, uint32_t flags)
: fMemory(memory)
, fOffset(offset)
, fSize(size)
, fFlags(flags)
, fUsesSystemHeap(false) {}
VkDeviceMemory fMemory; // can be VK_NULL_HANDLE iff is an RT and is borrowed
VkDeviceSize fOffset;
VkDeviceSize fSize; // this can be indeterminate iff Tex uses borrow semantics
uint32_t fFlags;
enum Flag { enum Flag {
kNoncoherent_Flag = 0x1, // memory must be flushed to device after mapping kNoncoherent_Flag = 0x1, // memory must be flushed to device after mapping
}; };
private: private:
friend class GrVkHeap; // For access to usesSystemHeap friend class GrVkHeap; // For access to usesSystemHeap
bool fUsesSystemHeap = false; bool fUsesSystemHeap;
}; };
struct GrVkImageInfo { struct GrVkImageInfo {
/** /**
* If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the image must have * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the image must have