summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/mapped_memory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/client/mapped_memory.cc')
-rw-r--r--gpu/command_buffer/client/mapped_memory.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index 461343e..c8d400e 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -23,7 +23,8 @@ MemoryChunk::MemoryChunk(
}
MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper)
- : helper_(helper) {
+ : chunk_size_multiple_(1),
+ helper_(helper) {
}
MappedMemoryManager::~MappedMemoryManager() {
@@ -52,7 +53,10 @@ void* MappedMemoryManager::Alloc(
// Make a new chunk to satisfy the request.
CommandBuffer* cmd_buf = helper_->command_buffer();
- int32 id = cmd_buf->CreateTransferBuffer(size, -1);
+ unsigned int chunk_size =
+ ((size + chunk_size_multiple_ - 1) / chunk_size_multiple_) *
+ chunk_size_multiple_;
+ int32 id = cmd_buf->CreateTransferBuffer(chunk_size, -1);
if (id == -1) {
return NULL;
}