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

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

Issue 2275203002: Make command buffer commands and immediate data volatile (Closed)
Patch Set: std::copy->const_cast+memcpy Created 4 years, 3 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_autogen.h ('k') | gpu/command_buffer/common/mailbox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_utils.h
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.h b/gpu/command_buffer/common/gles2_cmd_utils.h
index 1ec812a8bfd2f565df860ca939948e0614b40fbd..875bc35d2d54366b93ad9ef2ccb5087c38746169 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.h
+++ b/gpu/command_buffer/common/gles2_cmd_utils.h
@@ -57,19 +57,19 @@ inline bool SafeAddInt32(int32_t a, int32_t b, int32_t* dst) {
// Returns the address of the first byte after a struct.
template <typename T>
-const void* AddressAfterStruct(const T& pod) {
- return reinterpret_cast<const uint8_t*>(&pod) + sizeof(pod);
+const volatile void* AddressAfterStruct(const volatile T& pod) {
+ return reinterpret_cast<const volatile uint8_t*>(&pod) + sizeof(pod);
}
// Returns the address of the frst byte after the struct or NULL if size >
// immediate_data_size.
template <typename RETURN_TYPE, typename COMMAND_TYPE>
-RETURN_TYPE GetImmediateDataAs(const COMMAND_TYPE& pod,
+RETURN_TYPE GetImmediateDataAs(const volatile COMMAND_TYPE& pod,
uint32_t size,
uint32_t immediate_data_size) {
return (size <= immediate_data_size)
? static_cast<RETURN_TYPE>(
- const_cast<void*>(AddressAfterStruct(pod)))
+ const_cast<volatile void*>(AddressAfterStruct(pod)))
: NULL;
}
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_autogen.h ('k') | gpu/command_buffer/common/mailbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698