Chromium Code Reviews| Index: gpu/command_buffer/common/gles2_cmd_format.h |
| diff --git a/gpu/command_buffer/common/gles2_cmd_format.h b/gpu/command_buffer/common/gles2_cmd_format.h |
| index 252aafd06cf800695b969d1518bb344dcdacfe05..c5637432baccedbcfedcba613e8566a5b4684e86 100644 |
| --- a/gpu/command_buffer/common/gles2_cmd_format.h |
| +++ b/gpu/command_buffer/common/gles2_cmd_format.h |
| @@ -12,6 +12,7 @@ |
| #include <string.h> |
| +#include "base/atomicops.h" |
| #include "gpu/command_buffer/common/bitfield_helpers.h" |
| #include "gpu/command_buffer/common/cmd_buffer_common.h" |
| #include "gpu/command_buffer/common/gles2_cmd_ids.h" |
| @@ -150,6 +151,23 @@ struct QuerySync { |
| uint64 result; |
| }; |
| +struct AsyncUploadSync { |
| + void Reset() { |
| + base::subtle::Release_Store(&async_upload_token, 0); |
| + } |
| + |
| + void SetAsyncUploadToken(uint32 token) { |
| + base::subtle::Release_Store(&async_upload_token, token); |
| + } |
| + |
| + bool HasAsyncUploadTokenPassed(uint32 token) { |
| + uint32_t current_token = base::subtle::Acquire_Load(&async_upload_token); |
| + return (current_token - token < 0x80000000); |
| + } |
| + |
| + base::subtle::Atomic32 async_upload_token; |
| +}; |
|
piman
2014/02/20 01:52:37
Can we add a unit test for this, that mimics our u
|
| + |
| COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20); |
| COMPILE_ASSERT(offsetof(ProgramInput, type) == 0, |
| OffsetOf_ProgramInput_type_not_0); |