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

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

Issue 184223003: gpu: Use explicit atomics instead of assuming that 32bit read/writes are atomic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more s/uint32/base::subtle::Atomic32/ Created 6 years, 9 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 | Annotate | Revision Log
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 <string.h> 13 #include <string.h>
14 14
15 #include "base/atomicops.h"
15 #include "gpu/command_buffer/common/bitfield_helpers.h" 16 #include "gpu/command_buffer/common/bitfield_helpers.h"
16 #include "gpu/command_buffer/common/cmd_buffer_common.h" 17 #include "gpu/command_buffer/common/cmd_buffer_common.h"
17 #include "gpu/command_buffer/common/gles2_cmd_ids.h" 18 #include "gpu/command_buffer/common/gles2_cmd_ids.h"
18 #include "gpu/command_buffer/common/types.h" 19 #include "gpu/command_buffer/common/types.h"
19 20
20 // GL types are forward declared to avoid including the GL headers. The problem 21 // GL types are forward declared to avoid including the GL headers. The problem
21 // is determining which GL headers to include from code that is common to the 22 // is determining which GL headers to include from code that is common to the
22 // client and service sides (GLES2 or one of several GL implementations). 23 // client and service sides (GLES2 or one of several GL implementations).
23 typedef unsigned int GLenum; 24 typedef unsigned int GLenum;
24 typedef unsigned int GLbitfield; 25 typedef unsigned int GLbitfield;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // ProgramInput inputs[num_attribs + num_uniforms]; 141 // ProgramInput inputs[num_attribs + num_uniforms];
141 }; 142 };
142 143
143 // The format of QuerySync used by EXT_occlusion_query_boolean 144 // The format of QuerySync used by EXT_occlusion_query_boolean
144 struct QuerySync { 145 struct QuerySync {
145 void Reset() { 146 void Reset() {
146 process_count = 0; 147 process_count = 0;
147 result = 0; 148 result = 0;
148 } 149 }
149 150
150 uint32 process_count; 151 base::subtle::Atomic32 process_count;
151 uint64 result; 152 uint64 result;
152 }; 153 };
153 154
154 COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20); 155 COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20);
155 COMPILE_ASSERT(offsetof(ProgramInput, type) == 0, 156 COMPILE_ASSERT(offsetof(ProgramInput, type) == 0,
156 OffsetOf_ProgramInput_type_not_0); 157 OffsetOf_ProgramInput_type_not_0);
157 COMPILE_ASSERT(offsetof(ProgramInput, size) == 4, 158 COMPILE_ASSERT(offsetof(ProgramInput, size) == 4,
158 OffsetOf_ProgramInput_size_not_4); 159 OffsetOf_ProgramInput_size_not_4);
159 COMPILE_ASSERT(offsetof(ProgramInput, location_offset) == 8, 160 COMPILE_ASSERT(offsetof(ProgramInput, location_offset) == 8,
160 OffsetOf_ProgramInput_location_offset_not_8); 161 OffsetOf_ProgramInput_location_offset_not_8);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 CommandHeader header; 440 CommandHeader header;
440 }; 441 };
441 442
442 #pragma pack(pop) 443 #pragma pack(pop)
443 444
444 } // namespace cmd 445 } // namespace cmd
445 } // namespace gles2 446 } // namespace gles2
446 } // namespace gpu 447 } // namespace gpu
447 448
448 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ 449 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/query_tracker_unittest.cc ('k') | gpu/command_buffer/service/query_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698