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

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

Issue 661220: Added support for glGetString, glGetShaderSource,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This is here because service side code must include the system's version of 10 // This is here because service side code must include the system's version of
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h" 86 #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h"
87 87
88 // These are hand written commands. 88 // These are hand written commands.
89 // TODO(gman): Attempt to make these auto-generated. 89 // TODO(gman): Attempt to make these auto-generated.
90 90
91 struct GetAttribLocation { 91 struct GetAttribLocation {
92 typedef GetAttribLocation ValueType; 92 typedef GetAttribLocation ValueType;
93 static const CommandId kCmdId = kGetAttribLocation; 93 static const CommandId kCmdId = kGetAttribLocation;
94 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 94 static const cmd::ArgFlags kArgFlags = cmd::kFixed;
95 95
96 typedef GLint Result;
97
96 static uint32 ComputeSize() { 98 static uint32 ComputeSize() {
97 return static_cast<uint32>(sizeof(ValueType)); // NOLINT 99 return static_cast<uint32>(sizeof(ValueType)); // NOLINT
98 } 100 }
99 101
100 void SetHeader() { 102 void SetHeader() {
101 header.SetCmd<ValueType>(); 103 header.SetCmd<ValueType>();
102 } 104 }
103 105
104 void Init( 106 void Init(
105 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, 107 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_offset) == 20, 151 COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_offset) == 20,
150 OffsetOf_GetAttribLocation_location_shm_offset_not_20); 152 OffsetOf_GetAttribLocation_location_shm_offset_not_20);
151 COMPILE_ASSERT(offsetof(GetAttribLocation, data_size) == 24, 153 COMPILE_ASSERT(offsetof(GetAttribLocation, data_size) == 24,
152 OffsetOf_GetAttribLocation_data_size_not_24); 154 OffsetOf_GetAttribLocation_data_size_not_24);
153 155
154 struct GetAttribLocationImmediate { 156 struct GetAttribLocationImmediate {
155 typedef GetAttribLocationImmediate ValueType; 157 typedef GetAttribLocationImmediate ValueType;
156 static const CommandId kCmdId = kGetAttribLocationImmediate; 158 static const CommandId kCmdId = kGetAttribLocationImmediate;
157 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 159 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
158 160
161 typedef GLint Result;
162
159 static uint32 ComputeDataSize(const char* s) { 163 static uint32 ComputeDataSize(const char* s) {
160 return strlen(s); 164 return strlen(s);
161 } 165 }
162 166
163 static uint32 ComputeSize(const char* s) { 167 static uint32 ComputeSize(const char* s) {
164 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s)); 168 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s));
165 } 169 }
166 170
167 void SetHeader(const char* s) { 171 void SetHeader(const char* s) {
168 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); 172 header.SetCmdByTotalSize<ValueType>(ComputeSize(s));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, location_shm_offset) == 12, 210 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, location_shm_offset) == 12,
207 OffsetOf_GetAttribLocationImmediate_location_shm_offset_not_12); 211 OffsetOf_GetAttribLocationImmediate_location_shm_offset_not_12);
208 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, data_size) == 16, 212 COMPILE_ASSERT(offsetof(GetAttribLocationImmediate, data_size) == 16,
209 OffsetOf_GetAttribLocationImmediate_data_size_not_16); 213 OffsetOf_GetAttribLocationImmediate_data_size_not_16);
210 214
211 struct GetUniformLocation { 215 struct GetUniformLocation {
212 typedef GetUniformLocation ValueType; 216 typedef GetUniformLocation ValueType;
213 static const CommandId kCmdId = kGetUniformLocation; 217 static const CommandId kCmdId = kGetUniformLocation;
214 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 218 static const cmd::ArgFlags kArgFlags = cmd::kFixed;
215 219
220 typedef GLint Result;
221
216 static uint32 ComputeSize() { 222 static uint32 ComputeSize() {
217 return static_cast<uint32>(sizeof(ValueType)); // NOLINT 223 return static_cast<uint32>(sizeof(ValueType)); // NOLINT
218 } 224 }
219 225
220 void SetHeader() { 226 void SetHeader() {
221 header.SetCmd<ValueType>(); 227 header.SetCmd<ValueType>();
222 } 228 }
223 229
224 void Init( 230 void Init(
225 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset, 231 GLuint _program, uint32 _name_shm_id, uint32 _name_shm_offset,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_offset) == 20, 275 COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_offset) == 20,
270 OffsetOf_GetUniformLocation_location_shm_offset_not_20); 276 OffsetOf_GetUniformLocation_location_shm_offset_not_20);
271 COMPILE_ASSERT(offsetof(GetUniformLocation, data_size) == 24, 277 COMPILE_ASSERT(offsetof(GetUniformLocation, data_size) == 24,
272 OffsetOf_GetUniformLocation_data_size_not_24); 278 OffsetOf_GetUniformLocation_data_size_not_24);
273 279
274 struct GetUniformLocationImmediate { 280 struct GetUniformLocationImmediate {
275 typedef GetUniformLocationImmediate ValueType; 281 typedef GetUniformLocationImmediate ValueType;
276 static const CommandId kCmdId = kGetUniformLocationImmediate; 282 static const CommandId kCmdId = kGetUniformLocationImmediate;
277 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 283 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
278 284
285 typedef GLint Result;
286
279 static uint32 ComputeDataSize(const char* s) { 287 static uint32 ComputeDataSize(const char* s) {
280 return strlen(s); 288 return strlen(s);
281 } 289 }
282 290
283 static uint32 ComputeSize(const char* s) { 291 static uint32 ComputeSize(const char* s) {
284 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s)); 292 return static_cast<uint32>(sizeof(ValueType) + ComputeDataSize(s));
285 } 293 }
286 294
287 void SetHeader(const char* s) { 295 void SetHeader(const char* s) {
288 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); 296 header.SetCmdByTotalSize<ValueType>(ComputeSize(s));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, 337 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16,
330 OffsetOf_GetUniformLocationImmediate_data_size_not_16); 338 OffsetOf_GetUniformLocationImmediate_data_size_not_16);
331 339
332 #pragma pack(pop) 340 #pragma pack(pop)
333 341
334 } // namespace gles2 342 } // namespace gles2
335 } // namespace gpu 343 } // namespace gpu
336 344
337 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ 345 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_
338 346
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/GLES2/gl2types.h ('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