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

Unified Diff: src/gpu/vk/GrVkIndexBuffer.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/GrVkIndexBuffer.h ('k') | src/gpu/vk/GrVkTransferBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkIndexBuffer.cpp
diff --git a/src/gpu/vk/GrVkIndexBuffer.cpp b/src/gpu/vk/GrVkIndexBuffer.cpp
index 52f7bd59b738d37c90ebaeda00f8bd141fbd3b64..6cec856cd4d661161b9d8828b47c7e0947508fa8 100644
--- a/src/gpu/vk/GrVkIndexBuffer.cpp
+++ b/src/gpu/vk/GrVkIndexBuffer.cpp
@@ -10,7 +10,8 @@
GrVkIndexBuffer::GrVkIndexBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc,
const GrVkBuffer::Resource* bufferResource)
- : INHERITED(gpu, desc.fSizeInBytes, desc.fDynamic, false)
+ : INHERITED(gpu, kIndex_GrBufferType, desc.fSizeInBytes,
+ desc.fDynamic ? kDynamic_GrAccessPattern : kStatic_GrAccessPattern, false)
, GrVkBuffer(desc, bufferResource) {
this->registerWithCache();
}
@@ -47,11 +48,9 @@ void GrVkIndexBuffer::onAbandon() {
INHERITED::onAbandon();
}
-void* GrVkIndexBuffer::onMap() {
+void GrVkIndexBuffer::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/GrVkIndexBuffer.h ('k') | src/gpu/vk/GrVkTransferBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698