Index: src/gpu/vk/GrVkImage.h |
diff --git a/src/gpu/vk/GrVkImage.h b/src/gpu/vk/GrVkImage.h |
index 30b6b89a13ac5aa540a89b7a40be8743a1cc93b0..7bc01b6d4e0983073f418a416f9556c2fdb02492 100644 |
--- a/src/gpu/vk/GrVkImage.h |
+++ b/src/gpu/vk/GrVkImage.h |
@@ -33,15 +33,16 @@ public: |
: fInfo(info) |
, fIsBorrowed(kBorrowed_Wrapped == wrapped) { |
if (kBorrowed_Wrapped == wrapped) { |
- fResource = new BorrowedResource(info.fImage, info.fAlloc); |
+ fResource = new BorrowedResource(info.fImage, info.fAlloc, info.fOffset); |
} else { |
- fResource = new Resource(info.fImage, info.fAlloc); |
+ fResource = new Resource(info.fImage, info.fAlloc, info.fOffset); |
} |
} |
virtual ~GrVkImage(); |
VkImage image() const { return fInfo.fImage; } |
VkDeviceMemory memory() const { return fInfo.fAlloc; } |
+ VkDeviceSize offset() const { return fInfo.fOffset; } |
VkFormat imageFormat() const { return fInfo.fFormat; } |
const Resource* resource() const { return fResource; } |
bool isLinearTiled() const { |
@@ -87,7 +88,7 @@ protected: |
void releaseImage(const GrVkGpu* gpu); |
void abandonImage(); |
- void setNewResource(VkImage image, VkDeviceMemory alloc); |
+ void setNewResource(VkImage image, VkDeviceMemory alloc, VkDeviceSize offset); |
GrVkImageInfo fInfo; |
bool fIsBorrowed; |
@@ -99,10 +100,12 @@ private: |
Resource() |
: INHERITED() |
, fImage(VK_NULL_HANDLE) |
- , fAlloc(VK_NULL_HANDLE) { |
+ , fAlloc(VK_NULL_HANDLE) |
+ , fOffset(0) { |
} |
- Resource(VkImage image, VkDeviceMemory alloc) : fImage(image), fAlloc(alloc) {} |
+ Resource(VkImage image, VkDeviceMemory alloc, VkDeviceSize offset) |
+ : fImage(image), fAlloc(alloc), fOffset(offset) {} |
~Resource() override {} |
@@ -111,6 +114,7 @@ private: |
VkImage fImage; |
VkDeviceMemory fAlloc; |
+ VkDeviceSize fOffset; |
typedef GrVkResource INHERITED; |
}; |
@@ -118,7 +122,8 @@ private: |
// for wrapped textures |
class BorrowedResource : public Resource { |
public: |
- BorrowedResource(VkImage image, VkDeviceMemory alloc) : Resource(image, alloc) { |
+ BorrowedResource(VkImage image, VkDeviceMemory alloc, VkDeviceSize offset) |
+ : Resource(image, alloc, offset) { |
} |
private: |
void freeGPUData(const GrVkGpu* gpu) const override; |