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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unset texture and texture_ref after deleting Created 6 years, 8 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 struct QuerySync { 145 struct QuerySync {
146 void Reset() { 146 void Reset() {
147 process_count = 0; 147 process_count = 0;
148 result = 0; 148 result = 0;
149 } 149 }
150 150
151 base::subtle::Atomic32 process_count; 151 base::subtle::Atomic32 process_count;
152 uint64 result; 152 uint64 result;
153 }; 153 };
154 154
155 struct AsyncUploadSync {
156 void Reset() {
157 base::subtle::Release_Store(&async_upload_token, 0);
158 }
159
160 void SetAsyncUploadToken(uint32 token) {
161 DCHECK_NE(token, 0u);
162 base::subtle::Release_Store(&async_upload_token, token);
163 }
164
165 bool HasAsyncUploadTokenPassed(uint32 token) {
166 DCHECK_NE(token, 0u);
167 uint32_t current_token = base::subtle::Acquire_Load(&async_upload_token);
168 return (current_token - token < 0x80000000);
169 }
170
171 base::subtle::Atomic32 async_upload_token;
172 };
173
155 COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20); 174 COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20);
156 COMPILE_ASSERT(offsetof(ProgramInput, type) == 0, 175 COMPILE_ASSERT(offsetof(ProgramInput, type) == 0,
157 OffsetOf_ProgramInput_type_not_0); 176 OffsetOf_ProgramInput_type_not_0);
158 COMPILE_ASSERT(offsetof(ProgramInput, size) == 4, 177 COMPILE_ASSERT(offsetof(ProgramInput, size) == 4,
159 OffsetOf_ProgramInput_size_not_4); 178 OffsetOf_ProgramInput_size_not_4);
160 COMPILE_ASSERT(offsetof(ProgramInput, location_offset) == 8, 179 COMPILE_ASSERT(offsetof(ProgramInput, location_offset) == 8,
161 OffsetOf_ProgramInput_location_offset_not_8); 180 OffsetOf_ProgramInput_location_offset_not_8);
162 COMPILE_ASSERT(offsetof(ProgramInput, name_offset) == 12, 181 COMPILE_ASSERT(offsetof(ProgramInput, name_offset) == 12,
163 OffsetOf_ProgramInput_name_offset_not_12); 182 OffsetOf_ProgramInput_name_offset_not_12);
164 COMPILE_ASSERT(offsetof(ProgramInput, name_length) == 16, 183 COMPILE_ASSERT(offsetof(ProgramInput, name_length) == 16,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 CommandHeader header; 459 CommandHeader header;
441 }; 460 };
442 461
443 #pragma pack(pop) 462 #pragma pack(pop)
444 463
445 } // namespace cmd 464 } // namespace cmd
446 } // namespace gles2 465 } // namespace gles2
447 } // namespace gpu 466 } // namespace gpu
448 467
449 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ 468 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/cmd_buffer_functions.txt ('k') | gpu/command_buffer/common/gles2_cmd_format_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698