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

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

Issue 2344323002: Refactor vulkan buffer mapping and unmapping (Closed)
Patch Set: Don't reset fMapPtr on static 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 | « no previous file | src/gpu/vk/GrVkBuffer.cpp » ('j') | src/gpu/vk/GrVkBuffer.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkBuffer.h
diff --git a/src/gpu/vk/GrVkBuffer.h b/src/gpu/vk/GrVkBuffer.h
index 473a837646efcb6a5ebcabdd2224d76ab26244e9..a3028235425c443e4d259ebd9d9e25a7ce552f84 100644
--- a/src/gpu/vk/GrVkBuffer.h
+++ b/src/gpu/vk/GrVkBuffer.h
@@ -23,6 +23,7 @@ public:
virtual ~GrVkBuffer() {
// either release or abandon should have been called by the owner of this object.
SkASSERT(!fResource);
+ delete [] (unsigned char*)fMapPtr;
}
VkBuffer buffer() const { return fResource->fBuffer; }
@@ -83,7 +84,7 @@ protected:
: fDesc(desc), fResource(resource), fOffset(0), fMapPtr(nullptr) {
}
- void* vkMap(const GrVkGpu* gpu);
+ void* vkMap(GrVkGpu* gpu);
void vkUnmap(GrVkGpu* gpu);
// If the caller passes in a non null createdNewBuffer, this function will set the bool to true
// if it creates a new VkBuffer to upload the data to.
@@ -99,6 +100,9 @@ private:
return Create(gpu, descriptor);
}
+ void innerMap(GrVkGpu* gpu, size_t size, bool* createdNewBuffer = nullptr);
+ void innerUnmap(GrVkGpu* gpu, size_t size);
+
void validate() const;
bool vkIsMapped() const;
« no previous file with comments | « no previous file | src/gpu/vk/GrVkBuffer.cpp » ('j') | src/gpu/vk/GrVkBuffer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698