OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef GPU_COMMAND_BUFFER_COMMON_SYNC_TOKEN_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_SYNC_TOKEN_H_ |
6 #define GPU_COMMAND_BUFFER_COMMON_SYNC_TOKEN_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_SYNC_TOKEN_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 // See src/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt for more | 23 // See src/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt for more |
24 // details. | 24 // details. |
25 struct GPU_EXPORT SyncToken { | 25 struct GPU_EXPORT SyncToken { |
26 SyncToken() | 26 SyncToken() |
27 : verified_flush_(false), | 27 : verified_flush_(false), |
28 namespace_id_(CommandBufferNamespace::INVALID), | 28 namespace_id_(CommandBufferNamespace::INVALID), |
29 extra_data_field_(0), | 29 extra_data_field_(0), |
30 command_buffer_id_(0), | 30 command_buffer_id_(0), |
31 release_count_(0) {} | 31 release_count_(0) {} |
32 | 32 |
33 // TODO(dyen): This is an intermediate conversion constructor while we | |
34 // are converting from the old sync point system. Remove once conversion | |
35 // is finished. | |
36 explicit SyncToken(uint32_t sync_point) | |
37 : verified_flush_(sync_point ? true : false), | |
38 namespace_id_(sync_point ? gpu::CommandBufferNamespace::OLD_SYNC_POINTS | |
39 : gpu::CommandBufferNamespace::INVALID), | |
40 extra_data_field_(0), | |
41 command_buffer_id_(0), | |
42 release_count_(sync_point) {} | |
43 | |
44 SyncToken(CommandBufferNamespace namespace_id, | 33 SyncToken(CommandBufferNamespace namespace_id, |
45 int32_t extra_data_field, | 34 int32_t extra_data_field, |
46 uint64_t command_buffer_id, | 35 uint64_t command_buffer_id, |
47 uint64_t release_count) | 36 uint64_t release_count) |
48 : verified_flush_(false), | 37 : verified_flush_(false), |
49 namespace_id_(namespace_id), | 38 namespace_id_(namespace_id), |
50 extra_data_field_(extra_data_field), | 39 extra_data_field_(extra_data_field), |
51 command_buffer_id_(command_buffer_id), | 40 command_buffer_id_(command_buffer_id), |
52 release_count_(release_count) {} | 41 release_count_(release_count) {} |
53 | 42 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 uint64_t command_buffer_id_; | 110 uint64_t command_buffer_id_; |
122 uint64_t release_count_; | 111 uint64_t release_count_; |
123 }; | 112 }; |
124 | 113 |
125 static_assert(sizeof(SyncToken) <= GL_SYNC_TOKEN_SIZE_CHROMIUM, | 114 static_assert(sizeof(SyncToken) <= GL_SYNC_TOKEN_SIZE_CHROMIUM, |
126 "SyncToken size must not exceed GL_SYNC_TOKEN_SIZE_CHROMIUM"); | 115 "SyncToken size must not exceed GL_SYNC_TOKEN_SIZE_CHROMIUM"); |
127 | 116 |
128 } // namespace gpu | 117 } // namespace gpu |
129 | 118 |
130 #endif // GPU_COMMAND_BUFFER_COMMON_SYNC_TOKEN_H_ | 119 #endif // GPU_COMMAND_BUFFER_COMMON_SYNC_TOKEN_H_ |
OLD | NEW |