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

Unified Diff: gpu/command_buffer/common/cmd_buffer_common.h

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 | « no previous file | gpu/command_buffer/common/gles2_cmd_format.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/cmd_buffer_common.h
diff --git a/gpu/command_buffer/common/cmd_buffer_common.h b/gpu/command_buffer/common/cmd_buffer_common.h
index c692b7553f071f3bf95d77601bfadd5adc4a54f4..ef6b9329ffeaff70abbee9a6d933dcee8d4aa1aa 100644
--- a/gpu/command_buffer/common/cmd_buffer_common.h
+++ b/gpu/command_buffer/common/cmd_buffer_common.h
@@ -87,14 +87,14 @@ union CommandBufferEntry {
float value_float;
};
-const size_t kCommandBufferEntrySize = 4;
+#define GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT 4
+const size_t kCommandBufferEntrySize = GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT;
COMPILE_ASSERT(sizeof(CommandBufferEntry) == kCommandBufferEntrySize,
Sizeof_CommandBufferEntry_is_not_4);
-// Make sure the compiler does not add extra padding to any of the command
-// structures.
-#pragma pack(push, 1)
+// Command buffer is GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT byte aligned.
+#pragma pack(push, GPU_COMMAND_BUFFER_ENTRY_ALIGNMENT)
// Gets the address of memory just after a structure in a typesafe way. This is
// used for IMMEDIATE commands to get the address of the place to put the data.
« no previous file with comments | « no previous file | gpu/command_buffer/common/gles2_cmd_format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698