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

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

Issue 2356343003: Some Vulkan memory fixes and cleanup (Closed)
Patch Set: Fix release build Created 4 years, 3 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
« no previous file with comments | « src/gpu/vk/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkMemory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkMemory.h
diff --git a/src/gpu/vk/GrVkMemory.h b/src/gpu/vk/GrVkMemory.h
index f8d5fdf91c8d273f81721f0de7c8511667847adc..a1d4392ebed8e72049135be6a9950746e24bfe98 100644
--- a/src/gpu/vk/GrVkMemory.h
+++ b/src/gpu/vk/GrVkMemory.h
@@ -93,7 +93,7 @@ protected:
class GrVkSubHeap : public GrVkFreeListAlloc {
public:
- GrVkSubHeap(const GrVkGpu* gpu, uint32_t memoryTypeIndex,
+ GrVkSubHeap(const GrVkGpu* gpu, uint32_t memoryTypeIndex, uint32_t heapIndex,
VkDeviceSize size, VkDeviceSize alignment);
~GrVkSubHeap();
@@ -105,6 +105,9 @@ public:
private:
const GrVkGpu* fGpu;
+#ifdef SK_DEBUG
+ uint32_t fHeapIndex;
+#endif
uint32_t fMemoryTypeIndex;
VkDeviceMemory fAlloc;
@@ -135,21 +138,24 @@ public:
VkDeviceSize allocSize() const { return fAllocSize; }
VkDeviceSize usedSize() const { return fUsedSize; }
- bool alloc(VkDeviceSize size, VkDeviceSize alignment, uint32_t memoryTypeIndex,
- GrVkAlloc* alloc) {
+ bool alloc(VkDeviceSize size, VkDeviceSize alignment, uint32_t memoryTypeIndex,
+ uint32_t heapIndex, GrVkAlloc* alloc) {
SkASSERT(size > 0);
- return (*this.*fAllocFunc)(size, alignment, memoryTypeIndex, alloc);
+ return (*this.*fAllocFunc)(size, alignment, memoryTypeIndex, heapIndex, alloc);
}
bool free(const GrVkAlloc& alloc);
private:
- typedef bool (GrVkHeap::*AllocFunc)(VkDeviceSize size, VkDeviceSize alignment,
- uint32_t memoryTypeIndex, GrVkAlloc* alloc);
+ typedef bool (GrVkHeap::*AllocFunc)(VkDeviceSize size, VkDeviceSize alignment,
+ uint32_t memoryTypeIndex, uint32_t heapIndex,
+ GrVkAlloc* alloc);
- bool subAlloc(VkDeviceSize size, VkDeviceSize alignment,
- uint32_t memoryTypeIndex, GrVkAlloc* alloc);
+ bool subAlloc(VkDeviceSize size, VkDeviceSize alignment,
+ uint32_t memoryTypeIndex, uint32_t heapIndex,
+ GrVkAlloc* alloc);
bool singleAlloc(VkDeviceSize size, VkDeviceSize alignment,
- uint32_t memoryTypeIndex, GrVkAlloc* alloc);
+ uint32_t memoryTypeIndex, uint32_t heapIndex,
+ GrVkAlloc* alloc);
const GrVkGpu* fGpu;
VkDeviceSize fSubHeapSize;
« no previous file with comments | « src/gpu/vk/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkMemory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698