aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkBuffer.h
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-06-01 09:39:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-01 09:39:15 -0700
commit1e305ba0d6a4237020d36234e9e286d3b0489401 (patch)
tree703124336683add4f026ae699db8e079b357696c /src/gpu/vk/GrVkBuffer.h
parent4a603fc591dcd36b3cb47344c244ecbbbaf179f4 (diff)
Add offset to memory allocations
This is setting up for suballocations within one large allocation BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018933004 TBR=bsalomon@google.com Review-Url: https://codereview.chromium.org/2018933004
Diffstat (limited to 'src/gpu/vk/GrVkBuffer.h')
-rw-r--r--src/gpu/vk/GrVkBuffer.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gpu/vk/GrVkBuffer.h b/src/gpu/vk/GrVkBuffer.h
index 141b2a378f..f7d43c796d 100644
--- a/src/gpu/vk/GrVkBuffer.h
+++ b/src/gpu/vk/GrVkBuffer.h
@@ -10,6 +10,7 @@
#include "GrVkResource.h"
#include "vk/GrVkDefines.h"
+#include "vk/GrVkTypes.h"
class GrVkGpu;
@@ -24,8 +25,8 @@ public:
SkASSERT(!fResource);
}
- VkBuffer buffer() const { return fResource->fBuffer; }
- VkDeviceMemory alloc() const { return fResource->fAlloc; }
+ VkBuffer buffer() const { return fResource->fBuffer; }
+ const GrVkAlloc& alloc() const { return fResource->fAlloc; }
const GrVkResource* resource() const { return fResource; }
size_t size() const { return fDesc.fSizeInBytes; }
@@ -53,10 +54,12 @@ protected:
class Resource : public GrVkResource {
public:
- Resource(VkBuffer buf, VkDeviceMemory alloc) : INHERITED(), fBuffer(buf), fAlloc(alloc) {}
+ Resource(VkBuffer buf, const GrVkAlloc& alloc)
+ : INHERITED(), fBuffer(buf), fAlloc(alloc) {}
+
+ VkBuffer fBuffer;
+ GrVkAlloc fAlloc;
- VkBuffer fBuffer;
- VkDeviceMemory fAlloc;
private:
void freeGPUData(const GrVkGpu* gpu) const;