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

Unified Diff: gpu/command_buffer/service/transfer_buffer_manager.cc

Issue 152263002: Changed pack alignment of GPU command buffer commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: #pragma pack value must be literal. Created 6 years, 10 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 | « gpu/command_buffer/common/gles2_cmd_format.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/transfer_buffer_manager.cc
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc
index 76443a1f2500022dd797f8847b4997b1a36fdbe9..51484e39cdbf50c5d1c78ecc4bec8b98c9df25ca 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/debug/trace_event.h"
#include "base/process/process_handle.h"
+#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
using ::base::SharedMemory;
@@ -75,6 +76,10 @@ bool TransferBufferManager::RegisterTransferBuffer(
buffer.size = size;
buffer.shared_memory = duped_shared_memory.release();
+ // Check buffer alignment is sane.
+ DCHECK(!(reinterpret_cast<uintptr_t>(buffer.ptr) &
+ (kCommandBufferEntrySize - 1)));
+
shared_memory_bytes_allocated_ += size;
TRACE_COUNTER_ID1(
"gpu", "GpuTransferBufferMemory", this, shared_memory_bytes_allocated_);
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698