Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: src/gpu/vk/GrVkImage.h

Issue 2018933004: Add offset to memory allocations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tests Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkImage.h
diff --git a/src/gpu/vk/GrVkImage.h b/src/gpu/vk/GrVkImage.h
index 30b6b89a13ac5aa540a89b7a40be8743a1cc93b0..85ee6207545d752a0dc69dfd7b4874125fadfa3f 100644
--- a/src/gpu/vk/GrVkImage.h
+++ b/src/gpu/vk/GrVkImage.h
@@ -41,7 +41,7 @@ public:
virtual ~GrVkImage();
VkImage image() const { return fInfo.fImage; }
- VkDeviceMemory memory() const { return fInfo.fAlloc; }
+ const GrVkAlloc& alloc() const { return fInfo.fAlloc; }
VkFormat imageFormat() const { return fInfo.fFormat; }
const Resource* resource() const { return fResource; }
bool isLinearTiled() const {
@@ -87,7 +87,7 @@ protected:
void releaseImage(const GrVkGpu* gpu);
void abandonImage();
- void setNewResource(VkImage image, VkDeviceMemory alloc);
+ void setNewResource(VkImage image, const GrVkAlloc& alloc);
GrVkImageInfo fInfo;
bool fIsBorrowed;
@@ -98,19 +98,21 @@ private:
public:
Resource()
: INHERITED()
- , fImage(VK_NULL_HANDLE)
- , fAlloc(VK_NULL_HANDLE) {
+ , fImage(VK_NULL_HANDLE) {
+ fAlloc.fMemory = VK_NULL_HANDLE;
+ fAlloc.fOffset = 0;
}
- Resource(VkImage image, VkDeviceMemory alloc) : fImage(image), fAlloc(alloc) {}
+ Resource(VkImage image, const GrVkAlloc& alloc)
+ : fImage(image), fAlloc(alloc) {}
~Resource() override {}
private:
void freeGPUData(const GrVkGpu* gpu) const override;
- VkImage fImage;
- VkDeviceMemory fAlloc;
+ VkImage fImage;
+ GrVkAlloc fAlloc;
typedef GrVkResource INHERITED;
};
@@ -118,7 +120,8 @@ private:
// for wrapped textures
class BorrowedResource : public Resource {
public:
- BorrowedResource(VkImage image, VkDeviceMemory alloc) : Resource(image, alloc) {
+ BorrowedResource(VkImage image, const GrVkAlloc& alloc)
+ : Resource(image, alloc) {
}
private:
void freeGPUData(const GrVkGpu* gpu) const override;

Powered by Google App Engine
This is Rietveld 408576698