| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 int32_t matrix_stride; | 196 int32_t matrix_stride; |
| 197 int32_t is_row_major; | 197 int32_t is_row_major; |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 // The format of the bucket filled out by GetUniformsivES3CHROMIUM | 200 // The format of the bucket filled out by GetUniformsivES3CHROMIUM |
| 201 struct UniformsES3Header { | 201 struct UniformsES3Header { |
| 202 uint32_t num_uniforms; | 202 uint32_t num_uniforms; |
| 203 // UniformES3Info uniforms[num_uniforms]; | 203 // UniformES3Info uniforms[num_uniforms]; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 // The format of fence sync tokens. |
| 207 struct SyncToken { |
| 208 CommandBufferNamespace namespace_id; |
| 209 uint64_t command_buffer_id; |
| 210 uint64_t release_count; |
| 211 |
| 212 bool operator<(const SyncToken& other) const { |
| 213 // TODO(dyen): Once all our compilers support c++11, we can replace this |
| 214 // long list of comparisons with std::tie(). |
| 215 return (namespace_id < other.namespace_id) || |
| 216 ((namespace_id == other.namespace_id) && |
| 217 ((command_buffer_id < other.command_buffer_id) || |
| 218 ((command_buffer_id == other.command_buffer_id) && |
| 219 (release_count < other.release_count)))); |
| 220 } |
| 221 }; |
| 222 |
| 206 // The format of QuerySync used by EXT_occlusion_query_boolean | 223 // The format of QuerySync used by EXT_occlusion_query_boolean |
| 207 struct QuerySync { | 224 struct QuerySync { |
| 208 void Reset() { | 225 void Reset() { |
| 209 process_count = 0; | 226 process_count = 0; |
| 210 result = 0; | 227 result = 0; |
| 211 } | 228 } |
| 212 | 229 |
| 213 base::subtle::Atomic32 process_count; | 230 base::subtle::Atomic32 process_count; |
| 214 uint64_t result; | 231 uint64_t result; |
| 215 }; | 232 }; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 "should be 24"); | 307 "should be 24"); |
| 291 static_assert(offsetof(UniformBlockInfo, referenced_by_fragment_shader) == 28, | 308 static_assert(offsetof(UniformBlockInfo, referenced_by_fragment_shader) == 28, |
| 292 "offset of UniformBlockInfo.referenced_by_fragment_shader " | 309 "offset of UniformBlockInfo.referenced_by_fragment_shader " |
| 293 "should be 28"); | 310 "should be 28"); |
| 294 | 311 |
| 295 static_assert(sizeof(UniformBlocksHeader) == 4, | 312 static_assert(sizeof(UniformBlocksHeader) == 4, |
| 296 "size of UniformBlocksHeader should be 4"); | 313 "size of UniformBlocksHeader should be 4"); |
| 297 static_assert(offsetof(UniformBlocksHeader, num_uniform_blocks) == 0, | 314 static_assert(offsetof(UniformBlocksHeader, num_uniform_blocks) == 0, |
| 298 "offset of UniformBlocksHeader.num_uniform_blocks should be 0"); | 315 "offset of UniformBlocksHeader.num_uniform_blocks should be 0"); |
| 299 | 316 |
| 317 static_assert(sizeof(SyncToken) <= GL_SYNC_TOKEN_SIZE_CHROMIUM, |
| 318 "size of SyncToken must not exceed GL_SYNC_TOKEN_SIZE_CHROMIUM"); |
| 319 |
| 300 namespace cmds { | 320 namespace cmds { |
| 301 | 321 |
| 302 #include "../common/gles2_cmd_format_autogen.h" | 322 #include "../common/gles2_cmd_format_autogen.h" |
| 303 | 323 |
| 304 // These are hand written commands. | 324 // These are hand written commands. |
| 305 // TODO(gman): Attempt to make these auto-generated. | 325 // TODO(gman): Attempt to make these auto-generated. |
| 306 | 326 |
| 307 struct GenMailboxCHROMIUM { | 327 struct GenMailboxCHROMIUM { |
| 308 typedef GenMailboxCHROMIUM ValueType; | 328 typedef GenMailboxCHROMIUM ValueType; |
| 309 static const CommandId kCmdId = kGenMailboxCHROMIUM; | 329 static const CommandId kCmdId = kGenMailboxCHROMIUM; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 "offset of CreateAndConsumeTextureCHROMIUMImmediate.client_id should be 8"); | 393 "offset of CreateAndConsumeTextureCHROMIUMImmediate.client_id should be 8"); |
| 374 | 394 |
| 375 | 395 |
| 376 #pragma pack(pop) | 396 #pragma pack(pop) |
| 377 | 397 |
| 378 } // namespace cmd | 398 } // namespace cmd |
| 379 } // namespace gles2 | 399 } // namespace gles2 |
| 380 } // namespace gpu | 400 } // namespace gpu |
| 381 | 401 |
| 382 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 402 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
| OLD | NEW |