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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_format.h

Issue 1394543003: Added SyncToken command buffer trait to help with IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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
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
223 // The format of QuerySync used by EXT_occlusion_query_boolean 206 // The format of QuerySync used by EXT_occlusion_query_boolean
224 struct QuerySync { 207 struct QuerySync {
225 void Reset() { 208 void Reset() {
226 process_count = 0; 209 process_count = 0;
227 result = 0; 210 result = 0;
228 } 211 }
229 212
230 base::subtle::Atomic32 process_count; 213 base::subtle::Atomic32 process_count;
231 uint64_t result; 214 uint64_t result;
232 }; 215 };
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 "should be 24"); 290 "should be 24");
308 static_assert(offsetof(UniformBlockInfo, referenced_by_fragment_shader) == 28, 291 static_assert(offsetof(UniformBlockInfo, referenced_by_fragment_shader) == 28,
309 "offset of UniformBlockInfo.referenced_by_fragment_shader " 292 "offset of UniformBlockInfo.referenced_by_fragment_shader "
310 "should be 28"); 293 "should be 28");
311 294
312 static_assert(sizeof(UniformBlocksHeader) == 4, 295 static_assert(sizeof(UniformBlocksHeader) == 4,
313 "size of UniformBlocksHeader should be 4"); 296 "size of UniformBlocksHeader should be 4");
314 static_assert(offsetof(UniformBlocksHeader, num_uniform_blocks) == 0, 297 static_assert(offsetof(UniformBlocksHeader, num_uniform_blocks) == 0,
315 "offset of UniformBlocksHeader.num_uniform_blocks should be 0"); 298 "offset of UniformBlocksHeader.num_uniform_blocks should be 0");
316 299
317 static_assert(sizeof(SyncToken) <= GL_SYNC_TOKEN_SIZE_CHROMIUM,
318 "size of SyncToken must not exceed GL_SYNC_TOKEN_SIZE_CHROMIUM");
319
320 namespace cmds { 300 namespace cmds {
321 301
322 #include "../common/gles2_cmd_format_autogen.h" 302 #include "../common/gles2_cmd_format_autogen.h"
323 303
324 // These are hand written commands. 304 // These are hand written commands.
325 // TODO(gman): Attempt to make these auto-generated. 305 // TODO(gman): Attempt to make these auto-generated.
326 306
327 struct GenMailboxCHROMIUM { 307 struct GenMailboxCHROMIUM {
328 typedef GenMailboxCHROMIUM ValueType; 308 typedef GenMailboxCHROMIUM ValueType;
329 static const CommandId kCmdId = kGenMailboxCHROMIUM; 309 static const CommandId kCmdId = kGenMailboxCHROMIUM;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 "offset of CreateAndConsumeTextureCHROMIUMImmediate.client_id should be 8"); 373 "offset of CreateAndConsumeTextureCHROMIUMImmediate.client_id should be 8");
394 374
395 375
396 #pragma pack(pop) 376 #pragma pack(pop)
397 377
398 } // namespace cmd 378 } // namespace cmd
399 } // namespace gles2 379 } // namespace gles2
400 } // namespace gpu 380 } // namespace gpu
401 381
402 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ 382 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698