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

Unified Diff: src/gpu/vk/GrVkVertexBuffer.cpp

Issue 1825393002: Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: asserts Created 4 years, 9 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/GrVkVertexBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkVertexBuffer.cpp
diff --git a/src/gpu/vk/GrVkVertexBuffer.cpp b/src/gpu/vk/GrVkVertexBuffer.cpp
index 46c6d28f23d2bd7ec8b704635b7f814e58a98732..1d3eadb42c87c5ff7e1fe4e37f3fb0341e2160cf 100644
--- a/src/gpu/vk/GrVkVertexBuffer.cpp
+++ b/src/gpu/vk/GrVkVertexBuffer.cpp
@@ -10,7 +10,8 @@
GrVkVertexBuffer::GrVkVertexBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc,
const GrVkBuffer::Resource* bufferResource)
- : INHERITED(gpu, desc.fSizeInBytes, desc.fDynamic, false)
+ : INHERITED(gpu, kVertex_GrBufferType, desc.fSizeInBytes,
+ desc.fDynamic ? kDynamic_GrAccessPattern : kStatic_GrAccessPattern, false)
, GrVkBuffer(desc, bufferResource) {
this->registerWithCache();
}
@@ -46,11 +47,9 @@ void GrVkVertexBuffer::onAbandon() {
INHERITED::onAbandon();
}
-void* GrVkVertexBuffer::onMap() {
+void GrVkVertexBuffer::onMap() {
if (!this->wasDestroyed()) {
- return this->vkMap(this->getVkGpu());
- } else {
- return NULL;
+ this->GrBuffer::fMapPtr = this->vkMap(this->getVkGpu());
}
}
« no previous file with comments | « src/gpu/vk/GrVkVertexBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698