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

Unified Diff: gpu/command_buffer/client/mapped_memory.cc

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Review comments follow-up Created 6 years, 11 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
Index: gpu/command_buffer/client/mapped_memory.cc
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index 15584aaaf07daebf1bf20ba5225e086bfc1da4db..8393c6f65a1fde3f31d850bcb38375d31c6fea82 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -117,6 +117,17 @@ void MappedMemoryManager::FreePendingToken(void* pointer, int32 token) {
NOTREACHED();
}
+void MappedMemoryManager::FreePendingSerial(void *pointer, uint32 serial) {
+ for (size_t ii = 0; ii < chunks_.size(); ++ii) {
+ MemoryChunk* chunk = chunks_[ii];
+ if (chunk->IsInChunk(pointer)) {
+ chunk->FreePendingSerial(pointer, serial);
+ return;
+ }
+ }
+ NOTREACHED();
+}
+
void MappedMemoryManager::FreeUnused() {
CommandBuffer* cmd_buf = helper_->command_buffer();
MemoryChunkVector::iterator iter = chunks_.begin();

Powered by Google App Engine
This is Rietveld 408576698