OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file defines the GLES2 command buffer commands. | 5 // This file defines the GLES2 command buffer commands. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
9 | 9 |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 struct QuerySync { | 145 struct QuerySync { |
146 void Reset() { | 146 void Reset() { |
147 process_count = 0; | 147 process_count = 0; |
148 result = 0; | 148 result = 0; |
149 } | 149 } |
150 | 150 |
151 base::subtle::Atomic32 process_count; | 151 base::subtle::Atomic32 process_count; |
152 uint64 result; | 152 uint64 result; |
153 }; | 153 }; |
154 | 154 |
155 struct AsyncUploadSync { | |
156 void Reset() { | |
157 base::subtle::Release_Store(&async_upload_token, 0); | |
158 } | |
159 | |
160 void SetAsyncUploadToken(uint32 token) { | |
161 DCHECK_NE(token, 0u); | |
162 base::subtle::Release_Store(&async_upload_token, token); | |
163 } | |
164 | |
165 bool HasAsyncUploadTokenPassed(uint32 token) { | |
166 DCHECK_NE(token, 0u); | |
167 uint32_t current_token = base::subtle::Acquire_Load(&async_upload_token); | |
168 return (current_token - token < 0x80000000); | |
169 } | |
170 | |
171 base::subtle::Atomic32 async_upload_token; | |
172 }; | |
173 | |
174 COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20); | 155 COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20); |
175 COMPILE_ASSERT(offsetof(ProgramInput, type) == 0, | 156 COMPILE_ASSERT(offsetof(ProgramInput, type) == 0, |
176 OffsetOf_ProgramInput_type_not_0); | 157 OffsetOf_ProgramInput_type_not_0); |
177 COMPILE_ASSERT(offsetof(ProgramInput, size) == 4, | 158 COMPILE_ASSERT(offsetof(ProgramInput, size) == 4, |
178 OffsetOf_ProgramInput_size_not_4); | 159 OffsetOf_ProgramInput_size_not_4); |
179 COMPILE_ASSERT(offsetof(ProgramInput, location_offset) == 8, | 160 COMPILE_ASSERT(offsetof(ProgramInput, location_offset) == 8, |
180 OffsetOf_ProgramInput_location_offset_not_8); | 161 OffsetOf_ProgramInput_location_offset_not_8); |
181 COMPILE_ASSERT(offsetof(ProgramInput, name_offset) == 12, | 162 COMPILE_ASSERT(offsetof(ProgramInput, name_offset) == 12, |
182 OffsetOf_ProgramInput_name_offset_not_12); | 163 OffsetOf_ProgramInput_name_offset_not_12); |
183 COMPILE_ASSERT(offsetof(ProgramInput, name_length) == 16, | 164 COMPILE_ASSERT(offsetof(ProgramInput, name_length) == 16, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 CommandHeader header; | 440 CommandHeader header; |
460 }; | 441 }; |
461 | 442 |
462 #pragma pack(pop) | 443 #pragma pack(pop) |
463 | 444 |
464 } // namespace cmd | 445 } // namespace cmd |
465 } // namespace gles2 | 446 } // namespace gles2 |
466 } // namespace gpu | 447 } // namespace gpu |
467 | 448 |
468 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 449 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
OLD | NEW |