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

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

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed memory leak 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
11 #include <KHR/khrplatform.h> 11 #include <KHR/khrplatform.h>
12 12
13 #include <stdint.h> 13 #include <stdint.h>
14 #include <string.h> 14 #include <string.h>
15 15
16 #include "base/atomicops.h" 16 #include "base/atomicops.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "gpu/command_buffer/common/bitfield_helpers.h" 19 #include "gpu/command_buffer/common/bitfield_helpers.h"
20 #include "gpu/command_buffer/common/cmd_buffer_common.h" 20 #include "gpu/command_buffer/common/cmd_buffer_common.h"
21 #include "gpu/command_buffer/common/constants.h"
21 #include "gpu/command_buffer/common/gles2_cmd_ids.h" 22 #include "gpu/command_buffer/common/gles2_cmd_ids.h"
22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 23 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
23 24
24 // GL types are forward declared to avoid including the GL headers. The problem 25 // GL types are forward declared to avoid including the GL headers. The problem
25 // is determining which GL headers to include from code that is common to the 26 // is determining which GL headers to include from code that is common to the
26 // client and service sides (GLES2 or one of several GL implementations). 27 // client and service sides (GLES2 or one of several GL implementations).
27 typedef unsigned int GLenum; 28 typedef unsigned int GLenum;
28 typedef unsigned int GLbitfield; 29 typedef unsigned int GLbitfield;
29 typedef unsigned int GLuint; 30 typedef unsigned int GLuint;
30 typedef int GLint; 31 typedef int GLint;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 int32_t matrix_stride; 196 int32_t matrix_stride;
196 int32_t is_row_major; 197 int32_t is_row_major;
197 }; 198 };
198 199
199 // The format of the bucket filled out by GetUniformsivES3CHROMIUM 200 // The format of the bucket filled out by GetUniformsivES3CHROMIUM
200 struct UniformsES3Header { 201 struct UniformsES3Header {
201 uint32_t num_uniforms; 202 uint32_t num_uniforms;
202 // UniformES3Info uniforms[num_uniforms]; 203 // UniformES3Info uniforms[num_uniforms];
203 }; 204 };
204 205
206 // The format of fence sync tokens.
207 struct SyncToken {
208 CommandBufferNamespace namespace_id;
209 uint64_t command_buffer_id;
210 uint32_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
205 // The format of QuerySync used by EXT_occlusion_query_boolean 223 // The format of QuerySync used by EXT_occlusion_query_boolean
206 struct QuerySync { 224 struct QuerySync {
207 void Reset() { 225 void Reset() {
208 process_count = 0; 226 process_count = 0;
209 result = 0; 227 result = 0;
210 } 228 }
211 229
212 base::subtle::Atomic32 process_count; 230 base::subtle::Atomic32 process_count;
213 uint64_t result; 231 uint64_t result;
214 }; 232 };
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 "offset of CreateAndConsumeTextureCHROMIUMImmediate.client_id should be 8"); 390 "offset of CreateAndConsumeTextureCHROMIUMImmediate.client_id should be 8");
373 391
374 392
375 #pragma pack(pop) 393 #pragma pack(pop)
376 394
377 } // namespace cmd 395 } // namespace cmd
378 } // namespace gles2 396 } // namespace gles2
379 } // namespace gpu 397 } // namespace gpu
380 398
381 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ 399 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698