1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// This file is auto-generated from
6// gpu/command_buffer/build_gles2_cmd_buffer.py
7// It's formatted by clang-format using chromium coding style:
8//    clang-format -i -style=chromium filename
9// DO NOT EDIT!
10
11#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
12#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
13
14struct ActiveTexture {
15  typedef ActiveTexture ValueType;
16  static const CommandId kCmdId = kActiveTexture;
17  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
18  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
19
20  static uint32_t ComputeSize() {
21    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
22  }
23
24  void SetHeader() { header.SetCmd<ValueType>(); }
25
26  void Init(GLenum _texture) {
27    SetHeader();
28    texture = _texture;
29  }
30
31  void* Set(void* cmd, GLenum _texture) {
32    static_cast<ValueType*>(cmd)->Init(_texture);
33    return NextCmdAddress<ValueType>(cmd);
34  }
35
36  gpu::CommandHeader header;
37  uint32_t texture;
38};
39
40COMPILE_ASSERT(sizeof(ActiveTexture) == 8, Sizeof_ActiveTexture_is_not_8);
41COMPILE_ASSERT(offsetof(ActiveTexture, header) == 0,
42               OffsetOf_ActiveTexture_header_not_0);
43COMPILE_ASSERT(offsetof(ActiveTexture, texture) == 4,
44               OffsetOf_ActiveTexture_texture_not_4);
45
46struct AttachShader {
47  typedef AttachShader ValueType;
48  static const CommandId kCmdId = kAttachShader;
49  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
50  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
51
52  static uint32_t ComputeSize() {
53    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
54  }
55
56  void SetHeader() { header.SetCmd<ValueType>(); }
57
58  void Init(GLuint _program, GLuint _shader) {
59    SetHeader();
60    program = _program;
61    shader = _shader;
62  }
63
64  void* Set(void* cmd, GLuint _program, GLuint _shader) {
65    static_cast<ValueType*>(cmd)->Init(_program, _shader);
66    return NextCmdAddress<ValueType>(cmd);
67  }
68
69  gpu::CommandHeader header;
70  uint32_t program;
71  uint32_t shader;
72};
73
74COMPILE_ASSERT(sizeof(AttachShader) == 12, Sizeof_AttachShader_is_not_12);
75COMPILE_ASSERT(offsetof(AttachShader, header) == 0,
76               OffsetOf_AttachShader_header_not_0);
77COMPILE_ASSERT(offsetof(AttachShader, program) == 4,
78               OffsetOf_AttachShader_program_not_4);
79COMPILE_ASSERT(offsetof(AttachShader, shader) == 8,
80               OffsetOf_AttachShader_shader_not_8);
81
82struct BindAttribLocationBucket {
83  typedef BindAttribLocationBucket ValueType;
84  static const CommandId kCmdId = kBindAttribLocationBucket;
85  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
86  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
87
88  static uint32_t ComputeSize() {
89    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
90  }
91
92  void SetHeader() { header.SetCmd<ValueType>(); }
93
94  void Init(GLuint _program, GLuint _index, uint32_t _name_bucket_id) {
95    SetHeader();
96    program = _program;
97    index = _index;
98    name_bucket_id = _name_bucket_id;
99  }
100
101  void* Set(void* cmd,
102            GLuint _program,
103            GLuint _index,
104            uint32_t _name_bucket_id) {
105    static_cast<ValueType*>(cmd)->Init(_program, _index, _name_bucket_id);
106    return NextCmdAddress<ValueType>(cmd);
107  }
108
109  gpu::CommandHeader header;
110  uint32_t program;
111  uint32_t index;
112  uint32_t name_bucket_id;
113};
114
115COMPILE_ASSERT(sizeof(BindAttribLocationBucket) == 16,
116               Sizeof_BindAttribLocationBucket_is_not_16);
117COMPILE_ASSERT(offsetof(BindAttribLocationBucket, header) == 0,
118               OffsetOf_BindAttribLocationBucket_header_not_0);
119COMPILE_ASSERT(offsetof(BindAttribLocationBucket, program) == 4,
120               OffsetOf_BindAttribLocationBucket_program_not_4);
121COMPILE_ASSERT(offsetof(BindAttribLocationBucket, index) == 8,
122               OffsetOf_BindAttribLocationBucket_index_not_8);
123COMPILE_ASSERT(offsetof(BindAttribLocationBucket, name_bucket_id) == 12,
124               OffsetOf_BindAttribLocationBucket_name_bucket_id_not_12);
125
126struct BindBuffer {
127  typedef BindBuffer ValueType;
128  static const CommandId kCmdId = kBindBuffer;
129  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
130  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
131
132  static uint32_t ComputeSize() {
133    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
134  }
135
136  void SetHeader() { header.SetCmd<ValueType>(); }
137
138  void Init(GLenum _target, GLuint _buffer) {
139    SetHeader();
140    target = _target;
141    buffer = _buffer;
142  }
143
144  void* Set(void* cmd, GLenum _target, GLuint _buffer) {
145    static_cast<ValueType*>(cmd)->Init(_target, _buffer);
146    return NextCmdAddress<ValueType>(cmd);
147  }
148
149  gpu::CommandHeader header;
150  uint32_t target;
151  uint32_t buffer;
152};
153
154COMPILE_ASSERT(sizeof(BindBuffer) == 12, Sizeof_BindBuffer_is_not_12);
155COMPILE_ASSERT(offsetof(BindBuffer, header) == 0,
156               OffsetOf_BindBuffer_header_not_0);
157COMPILE_ASSERT(offsetof(BindBuffer, target) == 4,
158               OffsetOf_BindBuffer_target_not_4);
159COMPILE_ASSERT(offsetof(BindBuffer, buffer) == 8,
160               OffsetOf_BindBuffer_buffer_not_8);
161
162struct BindFramebuffer {
163  typedef BindFramebuffer ValueType;
164  static const CommandId kCmdId = kBindFramebuffer;
165  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
166  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);
167
168  static uint32_t ComputeSize() {
169    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
170  }
171
172  void SetHeader() { header.SetCmd<ValueType>(); }
173
174  void Init(GLenum _target, GLuint _framebuffer) {
175    SetHeader();
176    target = _target;
177    framebuffer = _framebuffer;
178  }
179
180  void* Set(void* cmd, GLenum _target, GLuint _framebuffer) {
181    static_cast<ValueType*>(cmd)->Init(_target, _framebuffer);
182    return NextCmdAddress<ValueType>(cmd);
183  }
184
185  gpu::CommandHeader header;
186  uint32_t target;
187  uint32_t framebuffer;
188};
189
190COMPILE_ASSERT(sizeof(BindFramebuffer) == 12, Sizeof_BindFramebuffer_is_not_12);
191COMPILE_ASSERT(offsetof(BindFramebuffer, header) == 0,
192               OffsetOf_BindFramebuffer_header_not_0);
193COMPILE_ASSERT(offsetof(BindFramebuffer, target) == 4,
194               OffsetOf_BindFramebuffer_target_not_4);
195COMPILE_ASSERT(offsetof(BindFramebuffer, framebuffer) == 8,
196               OffsetOf_BindFramebuffer_framebuffer_not_8);
197
198struct BindRenderbuffer {
199  typedef BindRenderbuffer ValueType;
200  static const CommandId kCmdId = kBindRenderbuffer;
201  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
202  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
203
204  static uint32_t ComputeSize() {
205    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
206  }
207
208  void SetHeader() { header.SetCmd<ValueType>(); }
209
210  void Init(GLenum _target, GLuint _renderbuffer) {
211    SetHeader();
212    target = _target;
213    renderbuffer = _renderbuffer;
214  }
215
216  void* Set(void* cmd, GLenum _target, GLuint _renderbuffer) {
217    static_cast<ValueType*>(cmd)->Init(_target, _renderbuffer);
218    return NextCmdAddress<ValueType>(cmd);
219  }
220
221  gpu::CommandHeader header;
222  uint32_t target;
223  uint32_t renderbuffer;
224};
225
226COMPILE_ASSERT(sizeof(BindRenderbuffer) == 12,
227               Sizeof_BindRenderbuffer_is_not_12);
228COMPILE_ASSERT(offsetof(BindRenderbuffer, header) == 0,
229               OffsetOf_BindRenderbuffer_header_not_0);
230COMPILE_ASSERT(offsetof(BindRenderbuffer, target) == 4,
231               OffsetOf_BindRenderbuffer_target_not_4);
232COMPILE_ASSERT(offsetof(BindRenderbuffer, renderbuffer) == 8,
233               OffsetOf_BindRenderbuffer_renderbuffer_not_8);
234
235struct BindTexture {
236  typedef BindTexture ValueType;
237  static const CommandId kCmdId = kBindTexture;
238  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
239  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);
240
241  static uint32_t ComputeSize() {
242    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
243  }
244
245  void SetHeader() { header.SetCmd<ValueType>(); }
246
247  void Init(GLenum _target, GLuint _texture) {
248    SetHeader();
249    target = _target;
250    texture = _texture;
251  }
252
253  void* Set(void* cmd, GLenum _target, GLuint _texture) {
254    static_cast<ValueType*>(cmd)->Init(_target, _texture);
255    return NextCmdAddress<ValueType>(cmd);
256  }
257
258  gpu::CommandHeader header;
259  uint32_t target;
260  uint32_t texture;
261};
262
263COMPILE_ASSERT(sizeof(BindTexture) == 12, Sizeof_BindTexture_is_not_12);
264COMPILE_ASSERT(offsetof(BindTexture, header) == 0,
265               OffsetOf_BindTexture_header_not_0);
266COMPILE_ASSERT(offsetof(BindTexture, target) == 4,
267               OffsetOf_BindTexture_target_not_4);
268COMPILE_ASSERT(offsetof(BindTexture, texture) == 8,
269               OffsetOf_BindTexture_texture_not_8);
270
271struct BlendColor {
272  typedef BlendColor ValueType;
273  static const CommandId kCmdId = kBlendColor;
274  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
275  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
276
277  static uint32_t ComputeSize() {
278    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
279  }
280
281  void SetHeader() { header.SetCmd<ValueType>(); }
282
283  void Init(GLclampf _red, GLclampf _green, GLclampf _blue, GLclampf _alpha) {
284    SetHeader();
285    red = _red;
286    green = _green;
287    blue = _blue;
288    alpha = _alpha;
289  }
290
291  void* Set(void* cmd,
292            GLclampf _red,
293            GLclampf _green,
294            GLclampf _blue,
295            GLclampf _alpha) {
296    static_cast<ValueType*>(cmd)->Init(_red, _green, _blue, _alpha);
297    return NextCmdAddress<ValueType>(cmd);
298  }
299
300  gpu::CommandHeader header;
301  float red;
302  float green;
303  float blue;
304  float alpha;
305};
306
307COMPILE_ASSERT(sizeof(BlendColor) == 20, Sizeof_BlendColor_is_not_20);
308COMPILE_ASSERT(offsetof(BlendColor, header) == 0,
309               OffsetOf_BlendColor_header_not_0);
310COMPILE_ASSERT(offsetof(BlendColor, red) == 4, OffsetOf_BlendColor_red_not_4);
311COMPILE_ASSERT(offsetof(BlendColor, green) == 8,
312               OffsetOf_BlendColor_green_not_8);
313COMPILE_ASSERT(offsetof(BlendColor, blue) == 12,
314               OffsetOf_BlendColor_blue_not_12);
315COMPILE_ASSERT(offsetof(BlendColor, alpha) == 16,
316               OffsetOf_BlendColor_alpha_not_16);
317
318struct BlendEquation {
319  typedef BlendEquation ValueType;
320  static const CommandId kCmdId = kBlendEquation;
321  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
322  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
323
324  static uint32_t ComputeSize() {
325    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
326  }
327
328  void SetHeader() { header.SetCmd<ValueType>(); }
329
330  void Init(GLenum _mode) {
331    SetHeader();
332    mode = _mode;
333  }
334
335  void* Set(void* cmd, GLenum _mode) {
336    static_cast<ValueType*>(cmd)->Init(_mode);
337    return NextCmdAddress<ValueType>(cmd);
338  }
339
340  gpu::CommandHeader header;
341  uint32_t mode;
342};
343
344COMPILE_ASSERT(sizeof(BlendEquation) == 8, Sizeof_BlendEquation_is_not_8);
345COMPILE_ASSERT(offsetof(BlendEquation, header) == 0,
346               OffsetOf_BlendEquation_header_not_0);
347COMPILE_ASSERT(offsetof(BlendEquation, mode) == 4,
348               OffsetOf_BlendEquation_mode_not_4);
349
350struct BlendEquationSeparate {
351  typedef BlendEquationSeparate ValueType;
352  static const CommandId kCmdId = kBlendEquationSeparate;
353  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
354  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
355
356  static uint32_t ComputeSize() {
357    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
358  }
359
360  void SetHeader() { header.SetCmd<ValueType>(); }
361
362  void Init(GLenum _modeRGB, GLenum _modeAlpha) {
363    SetHeader();
364    modeRGB = _modeRGB;
365    modeAlpha = _modeAlpha;
366  }
367
368  void* Set(void* cmd, GLenum _modeRGB, GLenum _modeAlpha) {
369    static_cast<ValueType*>(cmd)->Init(_modeRGB, _modeAlpha);
370    return NextCmdAddress<ValueType>(cmd);
371  }
372
373  gpu::CommandHeader header;
374  uint32_t modeRGB;
375  uint32_t modeAlpha;
376};
377
378COMPILE_ASSERT(sizeof(BlendEquationSeparate) == 12,
379               Sizeof_BlendEquationSeparate_is_not_12);
380COMPILE_ASSERT(offsetof(BlendEquationSeparate, header) == 0,
381               OffsetOf_BlendEquationSeparate_header_not_0);
382COMPILE_ASSERT(offsetof(BlendEquationSeparate, modeRGB) == 4,
383               OffsetOf_BlendEquationSeparate_modeRGB_not_4);
384COMPILE_ASSERT(offsetof(BlendEquationSeparate, modeAlpha) == 8,
385               OffsetOf_BlendEquationSeparate_modeAlpha_not_8);
386
387struct BlendFunc {
388  typedef BlendFunc ValueType;
389  static const CommandId kCmdId = kBlendFunc;
390  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
391  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
392
393  static uint32_t ComputeSize() {
394    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
395  }
396
397  void SetHeader() { header.SetCmd<ValueType>(); }
398
399  void Init(GLenum _sfactor, GLenum _dfactor) {
400    SetHeader();
401    sfactor = _sfactor;
402    dfactor = _dfactor;
403  }
404
405  void* Set(void* cmd, GLenum _sfactor, GLenum _dfactor) {
406    static_cast<ValueType*>(cmd)->Init(_sfactor, _dfactor);
407    return NextCmdAddress<ValueType>(cmd);
408  }
409
410  gpu::CommandHeader header;
411  uint32_t sfactor;
412  uint32_t dfactor;
413};
414
415COMPILE_ASSERT(sizeof(BlendFunc) == 12, Sizeof_BlendFunc_is_not_12);
416COMPILE_ASSERT(offsetof(BlendFunc, header) == 0,
417               OffsetOf_BlendFunc_header_not_0);
418COMPILE_ASSERT(offsetof(BlendFunc, sfactor) == 4,
419               OffsetOf_BlendFunc_sfactor_not_4);
420COMPILE_ASSERT(offsetof(BlendFunc, dfactor) == 8,
421               OffsetOf_BlendFunc_dfactor_not_8);
422
423struct BlendFuncSeparate {
424  typedef BlendFuncSeparate ValueType;
425  static const CommandId kCmdId = kBlendFuncSeparate;
426  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
427  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
428
429  static uint32_t ComputeSize() {
430    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
431  }
432
433  void SetHeader() { header.SetCmd<ValueType>(); }
434
435  void Init(GLenum _srcRGB,
436            GLenum _dstRGB,
437            GLenum _srcAlpha,
438            GLenum _dstAlpha) {
439    SetHeader();
440    srcRGB = _srcRGB;
441    dstRGB = _dstRGB;
442    srcAlpha = _srcAlpha;
443    dstAlpha = _dstAlpha;
444  }
445
446  void* Set(void* cmd,
447            GLenum _srcRGB,
448            GLenum _dstRGB,
449            GLenum _srcAlpha,
450            GLenum _dstAlpha) {
451    static_cast<ValueType*>(cmd)->Init(_srcRGB, _dstRGB, _srcAlpha, _dstAlpha);
452    return NextCmdAddress<ValueType>(cmd);
453  }
454
455  gpu::CommandHeader header;
456  uint32_t srcRGB;
457  uint32_t dstRGB;
458  uint32_t srcAlpha;
459  uint32_t dstAlpha;
460};
461
462COMPILE_ASSERT(sizeof(BlendFuncSeparate) == 20,
463               Sizeof_BlendFuncSeparate_is_not_20);
464COMPILE_ASSERT(offsetof(BlendFuncSeparate, header) == 0,
465               OffsetOf_BlendFuncSeparate_header_not_0);
466COMPILE_ASSERT(offsetof(BlendFuncSeparate, srcRGB) == 4,
467               OffsetOf_BlendFuncSeparate_srcRGB_not_4);
468COMPILE_ASSERT(offsetof(BlendFuncSeparate, dstRGB) == 8,
469               OffsetOf_BlendFuncSeparate_dstRGB_not_8);
470COMPILE_ASSERT(offsetof(BlendFuncSeparate, srcAlpha) == 12,
471               OffsetOf_BlendFuncSeparate_srcAlpha_not_12);
472COMPILE_ASSERT(offsetof(BlendFuncSeparate, dstAlpha) == 16,
473               OffsetOf_BlendFuncSeparate_dstAlpha_not_16);
474
475struct BufferData {
476  typedef BufferData ValueType;
477  static const CommandId kCmdId = kBufferData;
478  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
479  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
480
481  static uint32_t ComputeSize() {
482    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
483  }
484
485  void SetHeader() { header.SetCmd<ValueType>(); }
486
487  void Init(GLenum _target,
488            GLsizeiptr _size,
489            uint32_t _data_shm_id,
490            uint32_t _data_shm_offset,
491            GLenum _usage) {
492    SetHeader();
493    target = _target;
494    size = _size;
495    data_shm_id = _data_shm_id;
496    data_shm_offset = _data_shm_offset;
497    usage = _usage;
498  }
499
500  void* Set(void* cmd,
501            GLenum _target,
502            GLsizeiptr _size,
503            uint32_t _data_shm_id,
504            uint32_t _data_shm_offset,
505            GLenum _usage) {
506    static_cast<ValueType*>(cmd)
507        ->Init(_target, _size, _data_shm_id, _data_shm_offset, _usage);
508    return NextCmdAddress<ValueType>(cmd);
509  }
510
511  gpu::CommandHeader header;
512  uint32_t target;
513  int32_t size;
514  uint32_t data_shm_id;
515  uint32_t data_shm_offset;
516  uint32_t usage;
517};
518
519COMPILE_ASSERT(sizeof(BufferData) == 24, Sizeof_BufferData_is_not_24);
520COMPILE_ASSERT(offsetof(BufferData, header) == 0,
521               OffsetOf_BufferData_header_not_0);
522COMPILE_ASSERT(offsetof(BufferData, target) == 4,
523               OffsetOf_BufferData_target_not_4);
524COMPILE_ASSERT(offsetof(BufferData, size) == 8, OffsetOf_BufferData_size_not_8);
525COMPILE_ASSERT(offsetof(BufferData, data_shm_id) == 12,
526               OffsetOf_BufferData_data_shm_id_not_12);
527COMPILE_ASSERT(offsetof(BufferData, data_shm_offset) == 16,
528               OffsetOf_BufferData_data_shm_offset_not_16);
529COMPILE_ASSERT(offsetof(BufferData, usage) == 20,
530               OffsetOf_BufferData_usage_not_20);
531
532struct BufferSubData {
533  typedef BufferSubData ValueType;
534  static const CommandId kCmdId = kBufferSubData;
535  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
536  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
537
538  static uint32_t ComputeSize() {
539    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
540  }
541
542  void SetHeader() { header.SetCmd<ValueType>(); }
543
544  void Init(GLenum _target,
545            GLintptr _offset,
546            GLsizeiptr _size,
547            uint32_t _data_shm_id,
548            uint32_t _data_shm_offset) {
549    SetHeader();
550    target = _target;
551    offset = _offset;
552    size = _size;
553    data_shm_id = _data_shm_id;
554    data_shm_offset = _data_shm_offset;
555  }
556
557  void* Set(void* cmd,
558            GLenum _target,
559            GLintptr _offset,
560            GLsizeiptr _size,
561            uint32_t _data_shm_id,
562            uint32_t _data_shm_offset) {
563    static_cast<ValueType*>(cmd)
564        ->Init(_target, _offset, _size, _data_shm_id, _data_shm_offset);
565    return NextCmdAddress<ValueType>(cmd);
566  }
567
568  gpu::CommandHeader header;
569  uint32_t target;
570  int32_t offset;
571  int32_t size;
572  uint32_t data_shm_id;
573  uint32_t data_shm_offset;
574};
575
576COMPILE_ASSERT(sizeof(BufferSubData) == 24, Sizeof_BufferSubData_is_not_24);
577COMPILE_ASSERT(offsetof(BufferSubData, header) == 0,
578               OffsetOf_BufferSubData_header_not_0);
579COMPILE_ASSERT(offsetof(BufferSubData, target) == 4,
580               OffsetOf_BufferSubData_target_not_4);
581COMPILE_ASSERT(offsetof(BufferSubData, offset) == 8,
582               OffsetOf_BufferSubData_offset_not_8);
583COMPILE_ASSERT(offsetof(BufferSubData, size) == 12,
584               OffsetOf_BufferSubData_size_not_12);
585COMPILE_ASSERT(offsetof(BufferSubData, data_shm_id) == 16,
586               OffsetOf_BufferSubData_data_shm_id_not_16);
587COMPILE_ASSERT(offsetof(BufferSubData, data_shm_offset) == 20,
588               OffsetOf_BufferSubData_data_shm_offset_not_20);
589
590struct CheckFramebufferStatus {
591  typedef CheckFramebufferStatus ValueType;
592  static const CommandId kCmdId = kCheckFramebufferStatus;
593  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
594  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
595
596  typedef GLenum Result;
597
598  static uint32_t ComputeSize() {
599    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
600  }
601
602  void SetHeader() { header.SetCmd<ValueType>(); }
603
604  void Init(GLenum _target,
605            uint32_t _result_shm_id,
606            uint32_t _result_shm_offset) {
607    SetHeader();
608    target = _target;
609    result_shm_id = _result_shm_id;
610    result_shm_offset = _result_shm_offset;
611  }
612
613  void* Set(void* cmd,
614            GLenum _target,
615            uint32_t _result_shm_id,
616            uint32_t _result_shm_offset) {
617    static_cast<ValueType*>(cmd)
618        ->Init(_target, _result_shm_id, _result_shm_offset);
619    return NextCmdAddress<ValueType>(cmd);
620  }
621
622  gpu::CommandHeader header;
623  uint32_t target;
624  uint32_t result_shm_id;
625  uint32_t result_shm_offset;
626};
627
628COMPILE_ASSERT(sizeof(CheckFramebufferStatus) == 16,
629               Sizeof_CheckFramebufferStatus_is_not_16);
630COMPILE_ASSERT(offsetof(CheckFramebufferStatus, header) == 0,
631               OffsetOf_CheckFramebufferStatus_header_not_0);
632COMPILE_ASSERT(offsetof(CheckFramebufferStatus, target) == 4,
633               OffsetOf_CheckFramebufferStatus_target_not_4);
634COMPILE_ASSERT(offsetof(CheckFramebufferStatus, result_shm_id) == 8,
635               OffsetOf_CheckFramebufferStatus_result_shm_id_not_8);
636COMPILE_ASSERT(offsetof(CheckFramebufferStatus, result_shm_offset) == 12,
637               OffsetOf_CheckFramebufferStatus_result_shm_offset_not_12);
638
639struct Clear {
640  typedef Clear ValueType;
641  static const CommandId kCmdId = kClear;
642  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
643  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);
644
645  static uint32_t ComputeSize() {
646    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
647  }
648
649  void SetHeader() { header.SetCmd<ValueType>(); }
650
651  void Init(GLbitfield _mask) {
652    SetHeader();
653    mask = _mask;
654  }
655
656  void* Set(void* cmd, GLbitfield _mask) {
657    static_cast<ValueType*>(cmd)->Init(_mask);
658    return NextCmdAddress<ValueType>(cmd);
659  }
660
661  gpu::CommandHeader header;
662  uint32_t mask;
663};
664
665COMPILE_ASSERT(sizeof(Clear) == 8, Sizeof_Clear_is_not_8);
666COMPILE_ASSERT(offsetof(Clear, header) == 0, OffsetOf_Clear_header_not_0);
667COMPILE_ASSERT(offsetof(Clear, mask) == 4, OffsetOf_Clear_mask_not_4);
668
669struct ClearColor {
670  typedef ClearColor ValueType;
671  static const CommandId kCmdId = kClearColor;
672  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
673  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
674
675  static uint32_t ComputeSize() {
676    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
677  }
678
679  void SetHeader() { header.SetCmd<ValueType>(); }
680
681  void Init(GLclampf _red, GLclampf _green, GLclampf _blue, GLclampf _alpha) {
682    SetHeader();
683    red = _red;
684    green = _green;
685    blue = _blue;
686    alpha = _alpha;
687  }
688
689  void* Set(void* cmd,
690            GLclampf _red,
691            GLclampf _green,
692            GLclampf _blue,
693            GLclampf _alpha) {
694    static_cast<ValueType*>(cmd)->Init(_red, _green, _blue, _alpha);
695    return NextCmdAddress<ValueType>(cmd);
696  }
697
698  gpu::CommandHeader header;
699  float red;
700  float green;
701  float blue;
702  float alpha;
703};
704
705COMPILE_ASSERT(sizeof(ClearColor) == 20, Sizeof_ClearColor_is_not_20);
706COMPILE_ASSERT(offsetof(ClearColor, header) == 0,
707               OffsetOf_ClearColor_header_not_0);
708COMPILE_ASSERT(offsetof(ClearColor, red) == 4, OffsetOf_ClearColor_red_not_4);
709COMPILE_ASSERT(offsetof(ClearColor, green) == 8,
710               OffsetOf_ClearColor_green_not_8);
711COMPILE_ASSERT(offsetof(ClearColor, blue) == 12,
712               OffsetOf_ClearColor_blue_not_12);
713COMPILE_ASSERT(offsetof(ClearColor, alpha) == 16,
714               OffsetOf_ClearColor_alpha_not_16);
715
716struct ClearDepthf {
717  typedef ClearDepthf ValueType;
718  static const CommandId kCmdId = kClearDepthf;
719  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
720  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
721
722  static uint32_t ComputeSize() {
723    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
724  }
725
726  void SetHeader() { header.SetCmd<ValueType>(); }
727
728  void Init(GLclampf _depth) {
729    SetHeader();
730    depth = _depth;
731  }
732
733  void* Set(void* cmd, GLclampf _depth) {
734    static_cast<ValueType*>(cmd)->Init(_depth);
735    return NextCmdAddress<ValueType>(cmd);
736  }
737
738  gpu::CommandHeader header;
739  float depth;
740};
741
742COMPILE_ASSERT(sizeof(ClearDepthf) == 8, Sizeof_ClearDepthf_is_not_8);
743COMPILE_ASSERT(offsetof(ClearDepthf, header) == 0,
744               OffsetOf_ClearDepthf_header_not_0);
745COMPILE_ASSERT(offsetof(ClearDepthf, depth) == 4,
746               OffsetOf_ClearDepthf_depth_not_4);
747
748struct ClearStencil {
749  typedef ClearStencil ValueType;
750  static const CommandId kCmdId = kClearStencil;
751  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
752  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
753
754  static uint32_t ComputeSize() {
755    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
756  }
757
758  void SetHeader() { header.SetCmd<ValueType>(); }
759
760  void Init(GLint _s) {
761    SetHeader();
762    s = _s;
763  }
764
765  void* Set(void* cmd, GLint _s) {
766    static_cast<ValueType*>(cmd)->Init(_s);
767    return NextCmdAddress<ValueType>(cmd);
768  }
769
770  gpu::CommandHeader header;
771  int32_t s;
772};
773
774COMPILE_ASSERT(sizeof(ClearStencil) == 8, Sizeof_ClearStencil_is_not_8);
775COMPILE_ASSERT(offsetof(ClearStencil, header) == 0,
776               OffsetOf_ClearStencil_header_not_0);
777COMPILE_ASSERT(offsetof(ClearStencil, s) == 4, OffsetOf_ClearStencil_s_not_4);
778
779struct ColorMask {
780  typedef ColorMask ValueType;
781  static const CommandId kCmdId = kColorMask;
782  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
783  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
784
785  static uint32_t ComputeSize() {
786    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
787  }
788
789  void SetHeader() { header.SetCmd<ValueType>(); }
790
791  void Init(GLboolean _red,
792            GLboolean _green,
793            GLboolean _blue,
794            GLboolean _alpha) {
795    SetHeader();
796    red = _red;
797    green = _green;
798    blue = _blue;
799    alpha = _alpha;
800  }
801
802  void* Set(void* cmd,
803            GLboolean _red,
804            GLboolean _green,
805            GLboolean _blue,
806            GLboolean _alpha) {
807    static_cast<ValueType*>(cmd)->Init(_red, _green, _blue, _alpha);
808    return NextCmdAddress<ValueType>(cmd);
809  }
810
811  gpu::CommandHeader header;
812  uint32_t red;
813  uint32_t green;
814  uint32_t blue;
815  uint32_t alpha;
816};
817
818COMPILE_ASSERT(sizeof(ColorMask) == 20, Sizeof_ColorMask_is_not_20);
819COMPILE_ASSERT(offsetof(ColorMask, header) == 0,
820               OffsetOf_ColorMask_header_not_0);
821COMPILE_ASSERT(offsetof(ColorMask, red) == 4, OffsetOf_ColorMask_red_not_4);
822COMPILE_ASSERT(offsetof(ColorMask, green) == 8, OffsetOf_ColorMask_green_not_8);
823COMPILE_ASSERT(offsetof(ColorMask, blue) == 12, OffsetOf_ColorMask_blue_not_12);
824COMPILE_ASSERT(offsetof(ColorMask, alpha) == 16,
825               OffsetOf_ColorMask_alpha_not_16);
826
827struct CompileShader {
828  typedef CompileShader ValueType;
829  static const CommandId kCmdId = kCompileShader;
830  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
831  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
832
833  static uint32_t ComputeSize() {
834    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
835  }
836
837  void SetHeader() { header.SetCmd<ValueType>(); }
838
839  void Init(GLuint _shader) {
840    SetHeader();
841    shader = _shader;
842  }
843
844  void* Set(void* cmd, GLuint _shader) {
845    static_cast<ValueType*>(cmd)->Init(_shader);
846    return NextCmdAddress<ValueType>(cmd);
847  }
848
849  gpu::CommandHeader header;
850  uint32_t shader;
851};
852
853COMPILE_ASSERT(sizeof(CompileShader) == 8, Sizeof_CompileShader_is_not_8);
854COMPILE_ASSERT(offsetof(CompileShader, header) == 0,
855               OffsetOf_CompileShader_header_not_0);
856COMPILE_ASSERT(offsetof(CompileShader, shader) == 4,
857               OffsetOf_CompileShader_shader_not_4);
858
859struct CompressedTexImage2DBucket {
860  typedef CompressedTexImage2DBucket ValueType;
861  static const CommandId kCmdId = kCompressedTexImage2DBucket;
862  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
863  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
864
865  static uint32_t ComputeSize() {
866    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
867  }
868
869  void SetHeader() { header.SetCmd<ValueType>(); }
870
871  void Init(GLenum _target,
872            GLint _level,
873            GLenum _internalformat,
874            GLsizei _width,
875            GLsizei _height,
876            GLuint _bucket_id) {
877    SetHeader();
878    target = _target;
879    level = _level;
880    internalformat = _internalformat;
881    width = _width;
882    height = _height;
883    bucket_id = _bucket_id;
884  }
885
886  void* Set(void* cmd,
887            GLenum _target,
888            GLint _level,
889            GLenum _internalformat,
890            GLsizei _width,
891            GLsizei _height,
892            GLuint _bucket_id) {
893    static_cast<ValueType*>(cmd)
894        ->Init(_target, _level, _internalformat, _width, _height, _bucket_id);
895    return NextCmdAddress<ValueType>(cmd);
896  }
897
898  gpu::CommandHeader header;
899  uint32_t target;
900  int32_t level;
901  uint32_t internalformat;
902  int32_t width;
903  int32_t height;
904  uint32_t bucket_id;
905  static const int32_t border = 0;
906};
907
908COMPILE_ASSERT(sizeof(CompressedTexImage2DBucket) == 28,
909               Sizeof_CompressedTexImage2DBucket_is_not_28);
910COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, header) == 0,
911               OffsetOf_CompressedTexImage2DBucket_header_not_0);
912COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, target) == 4,
913               OffsetOf_CompressedTexImage2DBucket_target_not_4);
914COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, level) == 8,
915               OffsetOf_CompressedTexImage2DBucket_level_not_8);
916COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, internalformat) == 12,
917               OffsetOf_CompressedTexImage2DBucket_internalformat_not_12);
918COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, width) == 16,
919               OffsetOf_CompressedTexImage2DBucket_width_not_16);
920COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, height) == 20,
921               OffsetOf_CompressedTexImage2DBucket_height_not_20);
922COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, bucket_id) == 24,
923               OffsetOf_CompressedTexImage2DBucket_bucket_id_not_24);
924
925struct CompressedTexImage2D {
926  typedef CompressedTexImage2D ValueType;
927  static const CommandId kCmdId = kCompressedTexImage2D;
928  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
929  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
930
931  static uint32_t ComputeSize() {
932    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
933  }
934
935  void SetHeader() { header.SetCmd<ValueType>(); }
936
937  void Init(GLenum _target,
938            GLint _level,
939            GLenum _internalformat,
940            GLsizei _width,
941            GLsizei _height,
942            GLsizei _imageSize,
943            uint32_t _data_shm_id,
944            uint32_t _data_shm_offset) {
945    SetHeader();
946    target = _target;
947    level = _level;
948    internalformat = _internalformat;
949    width = _width;
950    height = _height;
951    imageSize = _imageSize;
952    data_shm_id = _data_shm_id;
953    data_shm_offset = _data_shm_offset;
954  }
955
956  void* Set(void* cmd,
957            GLenum _target,
958            GLint _level,
959            GLenum _internalformat,
960            GLsizei _width,
961            GLsizei _height,
962            GLsizei _imageSize,
963            uint32_t _data_shm_id,
964            uint32_t _data_shm_offset) {
965    static_cast<ValueType*>(cmd)->Init(_target,
966                                       _level,
967                                       _internalformat,
968                                       _width,
969                                       _height,
970                                       _imageSize,
971                                       _data_shm_id,
972                                       _data_shm_offset);
973    return NextCmdAddress<ValueType>(cmd);
974  }
975
976  gpu::CommandHeader header;
977  uint32_t target;
978  int32_t level;
979  uint32_t internalformat;
980  int32_t width;
981  int32_t height;
982  int32_t imageSize;
983  uint32_t data_shm_id;
984  uint32_t data_shm_offset;
985  static const int32_t border = 0;
986};
987
988COMPILE_ASSERT(sizeof(CompressedTexImage2D) == 36,
989               Sizeof_CompressedTexImage2D_is_not_36);
990COMPILE_ASSERT(offsetof(CompressedTexImage2D, header) == 0,
991               OffsetOf_CompressedTexImage2D_header_not_0);
992COMPILE_ASSERT(offsetof(CompressedTexImage2D, target) == 4,
993               OffsetOf_CompressedTexImage2D_target_not_4);
994COMPILE_ASSERT(offsetof(CompressedTexImage2D, level) == 8,
995               OffsetOf_CompressedTexImage2D_level_not_8);
996COMPILE_ASSERT(offsetof(CompressedTexImage2D, internalformat) == 12,
997               OffsetOf_CompressedTexImage2D_internalformat_not_12);
998COMPILE_ASSERT(offsetof(CompressedTexImage2D, width) == 16,
999               OffsetOf_CompressedTexImage2D_width_not_16);
1000COMPILE_ASSERT(offsetof(CompressedTexImage2D, height) == 20,
1001               OffsetOf_CompressedTexImage2D_height_not_20);
1002COMPILE_ASSERT(offsetof(CompressedTexImage2D, imageSize) == 24,
1003               OffsetOf_CompressedTexImage2D_imageSize_not_24);
1004COMPILE_ASSERT(offsetof(CompressedTexImage2D, data_shm_id) == 28,
1005               OffsetOf_CompressedTexImage2D_data_shm_id_not_28);
1006COMPILE_ASSERT(offsetof(CompressedTexImage2D, data_shm_offset) == 32,
1007               OffsetOf_CompressedTexImage2D_data_shm_offset_not_32);
1008
1009struct CompressedTexSubImage2DBucket {
1010  typedef CompressedTexSubImage2DBucket ValueType;
1011  static const CommandId kCmdId = kCompressedTexSubImage2DBucket;
1012  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1013  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1014
1015  static uint32_t ComputeSize() {
1016    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1017  }
1018
1019  void SetHeader() { header.SetCmd<ValueType>(); }
1020
1021  void Init(GLenum _target,
1022            GLint _level,
1023            GLint _xoffset,
1024            GLint _yoffset,
1025            GLsizei _width,
1026            GLsizei _height,
1027            GLenum _format,
1028            GLuint _bucket_id) {
1029    SetHeader();
1030    target = _target;
1031    level = _level;
1032    xoffset = _xoffset;
1033    yoffset = _yoffset;
1034    width = _width;
1035    height = _height;
1036    format = _format;
1037    bucket_id = _bucket_id;
1038  }
1039
1040  void* Set(void* cmd,
1041            GLenum _target,
1042            GLint _level,
1043            GLint _xoffset,
1044            GLint _yoffset,
1045            GLsizei _width,
1046            GLsizei _height,
1047            GLenum _format,
1048            GLuint _bucket_id) {
1049    static_cast<ValueType*>(cmd)->Init(_target,
1050                                       _level,
1051                                       _xoffset,
1052                                       _yoffset,
1053                                       _width,
1054                                       _height,
1055                                       _format,
1056                                       _bucket_id);
1057    return NextCmdAddress<ValueType>(cmd);
1058  }
1059
1060  gpu::CommandHeader header;
1061  uint32_t target;
1062  int32_t level;
1063  int32_t xoffset;
1064  int32_t yoffset;
1065  int32_t width;
1066  int32_t height;
1067  uint32_t format;
1068  uint32_t bucket_id;
1069};
1070
1071COMPILE_ASSERT(sizeof(CompressedTexSubImage2DBucket) == 36,
1072               Sizeof_CompressedTexSubImage2DBucket_is_not_36);
1073COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, header) == 0,
1074               OffsetOf_CompressedTexSubImage2DBucket_header_not_0);
1075COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, target) == 4,
1076               OffsetOf_CompressedTexSubImage2DBucket_target_not_4);
1077COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, level) == 8,
1078               OffsetOf_CompressedTexSubImage2DBucket_level_not_8);
1079COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, xoffset) == 12,
1080               OffsetOf_CompressedTexSubImage2DBucket_xoffset_not_12);
1081COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, yoffset) == 16,
1082               OffsetOf_CompressedTexSubImage2DBucket_yoffset_not_16);
1083COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, width) == 20,
1084               OffsetOf_CompressedTexSubImage2DBucket_width_not_20);
1085COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, height) == 24,
1086               OffsetOf_CompressedTexSubImage2DBucket_height_not_24);
1087COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, format) == 28,
1088               OffsetOf_CompressedTexSubImage2DBucket_format_not_28);
1089COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, bucket_id) == 32,
1090               OffsetOf_CompressedTexSubImage2DBucket_bucket_id_not_32);
1091
1092struct CompressedTexSubImage2D {
1093  typedef CompressedTexSubImage2D ValueType;
1094  static const CommandId kCmdId = kCompressedTexSubImage2D;
1095  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1096  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1097
1098  static uint32_t ComputeSize() {
1099    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1100  }
1101
1102  void SetHeader() { header.SetCmd<ValueType>(); }
1103
1104  void Init(GLenum _target,
1105            GLint _level,
1106            GLint _xoffset,
1107            GLint _yoffset,
1108            GLsizei _width,
1109            GLsizei _height,
1110            GLenum _format,
1111            GLsizei _imageSize,
1112            uint32_t _data_shm_id,
1113            uint32_t _data_shm_offset) {
1114    SetHeader();
1115    target = _target;
1116    level = _level;
1117    xoffset = _xoffset;
1118    yoffset = _yoffset;
1119    width = _width;
1120    height = _height;
1121    format = _format;
1122    imageSize = _imageSize;
1123    data_shm_id = _data_shm_id;
1124    data_shm_offset = _data_shm_offset;
1125  }
1126
1127  void* Set(void* cmd,
1128            GLenum _target,
1129            GLint _level,
1130            GLint _xoffset,
1131            GLint _yoffset,
1132            GLsizei _width,
1133            GLsizei _height,
1134            GLenum _format,
1135            GLsizei _imageSize,
1136            uint32_t _data_shm_id,
1137            uint32_t _data_shm_offset) {
1138    static_cast<ValueType*>(cmd)->Init(_target,
1139                                       _level,
1140                                       _xoffset,
1141                                       _yoffset,
1142                                       _width,
1143                                       _height,
1144                                       _format,
1145                                       _imageSize,
1146                                       _data_shm_id,
1147                                       _data_shm_offset);
1148    return NextCmdAddress<ValueType>(cmd);
1149  }
1150
1151  gpu::CommandHeader header;
1152  uint32_t target;
1153  int32_t level;
1154  int32_t xoffset;
1155  int32_t yoffset;
1156  int32_t width;
1157  int32_t height;
1158  uint32_t format;
1159  int32_t imageSize;
1160  uint32_t data_shm_id;
1161  uint32_t data_shm_offset;
1162};
1163
1164COMPILE_ASSERT(sizeof(CompressedTexSubImage2D) == 44,
1165               Sizeof_CompressedTexSubImage2D_is_not_44);
1166COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, header) == 0,
1167               OffsetOf_CompressedTexSubImage2D_header_not_0);
1168COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, target) == 4,
1169               OffsetOf_CompressedTexSubImage2D_target_not_4);
1170COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, level) == 8,
1171               OffsetOf_CompressedTexSubImage2D_level_not_8);
1172COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, xoffset) == 12,
1173               OffsetOf_CompressedTexSubImage2D_xoffset_not_12);
1174COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, yoffset) == 16,
1175               OffsetOf_CompressedTexSubImage2D_yoffset_not_16);
1176COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, width) == 20,
1177               OffsetOf_CompressedTexSubImage2D_width_not_20);
1178COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, height) == 24,
1179               OffsetOf_CompressedTexSubImage2D_height_not_24);
1180COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, format) == 28,
1181               OffsetOf_CompressedTexSubImage2D_format_not_28);
1182COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, imageSize) == 32,
1183               OffsetOf_CompressedTexSubImage2D_imageSize_not_32);
1184COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, data_shm_id) == 36,
1185               OffsetOf_CompressedTexSubImage2D_data_shm_id_not_36);
1186COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, data_shm_offset) == 40,
1187               OffsetOf_CompressedTexSubImage2D_data_shm_offset_not_40);
1188
1189struct CopyTexImage2D {
1190  typedef CopyTexImage2D ValueType;
1191  static const CommandId kCmdId = kCopyTexImage2D;
1192  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1193  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1194
1195  static uint32_t ComputeSize() {
1196    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1197  }
1198
1199  void SetHeader() { header.SetCmd<ValueType>(); }
1200
1201  void Init(GLenum _target,
1202            GLint _level,
1203            GLenum _internalformat,
1204            GLint _x,
1205            GLint _y,
1206            GLsizei _width,
1207            GLsizei _height) {
1208    SetHeader();
1209    target = _target;
1210    level = _level;
1211    internalformat = _internalformat;
1212    x = _x;
1213    y = _y;
1214    width = _width;
1215    height = _height;
1216  }
1217
1218  void* Set(void* cmd,
1219            GLenum _target,
1220            GLint _level,
1221            GLenum _internalformat,
1222            GLint _x,
1223            GLint _y,
1224            GLsizei _width,
1225            GLsizei _height) {
1226    static_cast<ValueType*>(cmd)
1227        ->Init(_target, _level, _internalformat, _x, _y, _width, _height);
1228    return NextCmdAddress<ValueType>(cmd);
1229  }
1230
1231  gpu::CommandHeader header;
1232  uint32_t target;
1233  int32_t level;
1234  uint32_t internalformat;
1235  int32_t x;
1236  int32_t y;
1237  int32_t width;
1238  int32_t height;
1239  static const int32_t border = 0;
1240};
1241
1242COMPILE_ASSERT(sizeof(CopyTexImage2D) == 32, Sizeof_CopyTexImage2D_is_not_32);
1243COMPILE_ASSERT(offsetof(CopyTexImage2D, header) == 0,
1244               OffsetOf_CopyTexImage2D_header_not_0);
1245COMPILE_ASSERT(offsetof(CopyTexImage2D, target) == 4,
1246               OffsetOf_CopyTexImage2D_target_not_4);
1247COMPILE_ASSERT(offsetof(CopyTexImage2D, level) == 8,
1248               OffsetOf_CopyTexImage2D_level_not_8);
1249COMPILE_ASSERT(offsetof(CopyTexImage2D, internalformat) == 12,
1250               OffsetOf_CopyTexImage2D_internalformat_not_12);
1251COMPILE_ASSERT(offsetof(CopyTexImage2D, x) == 16,
1252               OffsetOf_CopyTexImage2D_x_not_16);
1253COMPILE_ASSERT(offsetof(CopyTexImage2D, y) == 20,
1254               OffsetOf_CopyTexImage2D_y_not_20);
1255COMPILE_ASSERT(offsetof(CopyTexImage2D, width) == 24,
1256               OffsetOf_CopyTexImage2D_width_not_24);
1257COMPILE_ASSERT(offsetof(CopyTexImage2D, height) == 28,
1258               OffsetOf_CopyTexImage2D_height_not_28);
1259
1260struct CopyTexSubImage2D {
1261  typedef CopyTexSubImage2D ValueType;
1262  static const CommandId kCmdId = kCopyTexSubImage2D;
1263  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1264  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1265
1266  static uint32_t ComputeSize() {
1267    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1268  }
1269
1270  void SetHeader() { header.SetCmd<ValueType>(); }
1271
1272  void Init(GLenum _target,
1273            GLint _level,
1274            GLint _xoffset,
1275            GLint _yoffset,
1276            GLint _x,
1277            GLint _y,
1278            GLsizei _width,
1279            GLsizei _height) {
1280    SetHeader();
1281    target = _target;
1282    level = _level;
1283    xoffset = _xoffset;
1284    yoffset = _yoffset;
1285    x = _x;
1286    y = _y;
1287    width = _width;
1288    height = _height;
1289  }
1290
1291  void* Set(void* cmd,
1292            GLenum _target,
1293            GLint _level,
1294            GLint _xoffset,
1295            GLint _yoffset,
1296            GLint _x,
1297            GLint _y,
1298            GLsizei _width,
1299            GLsizei _height) {
1300    static_cast<ValueType*>(cmd)
1301        ->Init(_target, _level, _xoffset, _yoffset, _x, _y, _width, _height);
1302    return NextCmdAddress<ValueType>(cmd);
1303  }
1304
1305  gpu::CommandHeader header;
1306  uint32_t target;
1307  int32_t level;
1308  int32_t xoffset;
1309  int32_t yoffset;
1310  int32_t x;
1311  int32_t y;
1312  int32_t width;
1313  int32_t height;
1314};
1315
1316COMPILE_ASSERT(sizeof(CopyTexSubImage2D) == 36,
1317               Sizeof_CopyTexSubImage2D_is_not_36);
1318COMPILE_ASSERT(offsetof(CopyTexSubImage2D, header) == 0,
1319               OffsetOf_CopyTexSubImage2D_header_not_0);
1320COMPILE_ASSERT(offsetof(CopyTexSubImage2D, target) == 4,
1321               OffsetOf_CopyTexSubImage2D_target_not_4);
1322COMPILE_ASSERT(offsetof(CopyTexSubImage2D, level) == 8,
1323               OffsetOf_CopyTexSubImage2D_level_not_8);
1324COMPILE_ASSERT(offsetof(CopyTexSubImage2D, xoffset) == 12,
1325               OffsetOf_CopyTexSubImage2D_xoffset_not_12);
1326COMPILE_ASSERT(offsetof(CopyTexSubImage2D, yoffset) == 16,
1327               OffsetOf_CopyTexSubImage2D_yoffset_not_16);
1328COMPILE_ASSERT(offsetof(CopyTexSubImage2D, x) == 20,
1329               OffsetOf_CopyTexSubImage2D_x_not_20);
1330COMPILE_ASSERT(offsetof(CopyTexSubImage2D, y) == 24,
1331               OffsetOf_CopyTexSubImage2D_y_not_24);
1332COMPILE_ASSERT(offsetof(CopyTexSubImage2D, width) == 28,
1333               OffsetOf_CopyTexSubImage2D_width_not_28);
1334COMPILE_ASSERT(offsetof(CopyTexSubImage2D, height) == 32,
1335               OffsetOf_CopyTexSubImage2D_height_not_32);
1336
1337struct CreateProgram {
1338  typedef CreateProgram ValueType;
1339  static const CommandId kCmdId = kCreateProgram;
1340  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1341  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1342
1343  static uint32_t ComputeSize() {
1344    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1345  }
1346
1347  void SetHeader() { header.SetCmd<ValueType>(); }
1348
1349  void Init(uint32_t _client_id) {
1350    SetHeader();
1351    client_id = _client_id;
1352  }
1353
1354  void* Set(void* cmd, uint32_t _client_id) {
1355    static_cast<ValueType*>(cmd)->Init(_client_id);
1356    return NextCmdAddress<ValueType>(cmd);
1357  }
1358
1359  gpu::CommandHeader header;
1360  uint32_t client_id;
1361};
1362
1363COMPILE_ASSERT(sizeof(CreateProgram) == 8, Sizeof_CreateProgram_is_not_8);
1364COMPILE_ASSERT(offsetof(CreateProgram, header) == 0,
1365               OffsetOf_CreateProgram_header_not_0);
1366COMPILE_ASSERT(offsetof(CreateProgram, client_id) == 4,
1367               OffsetOf_CreateProgram_client_id_not_4);
1368
1369struct CreateShader {
1370  typedef CreateShader ValueType;
1371  static const CommandId kCmdId = kCreateShader;
1372  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1373  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1374
1375  static uint32_t ComputeSize() {
1376    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1377  }
1378
1379  void SetHeader() { header.SetCmd<ValueType>(); }
1380
1381  void Init(GLenum _type, uint32_t _client_id) {
1382    SetHeader();
1383    type = _type;
1384    client_id = _client_id;
1385  }
1386
1387  void* Set(void* cmd, GLenum _type, uint32_t _client_id) {
1388    static_cast<ValueType*>(cmd)->Init(_type, _client_id);
1389    return NextCmdAddress<ValueType>(cmd);
1390  }
1391
1392  gpu::CommandHeader header;
1393  uint32_t type;
1394  uint32_t client_id;
1395};
1396
1397COMPILE_ASSERT(sizeof(CreateShader) == 12, Sizeof_CreateShader_is_not_12);
1398COMPILE_ASSERT(offsetof(CreateShader, header) == 0,
1399               OffsetOf_CreateShader_header_not_0);
1400COMPILE_ASSERT(offsetof(CreateShader, type) == 4,
1401               OffsetOf_CreateShader_type_not_4);
1402COMPILE_ASSERT(offsetof(CreateShader, client_id) == 8,
1403               OffsetOf_CreateShader_client_id_not_8);
1404
1405struct CullFace {
1406  typedef CullFace ValueType;
1407  static const CommandId kCmdId = kCullFace;
1408  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1409  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1410
1411  static uint32_t ComputeSize() {
1412    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1413  }
1414
1415  void SetHeader() { header.SetCmd<ValueType>(); }
1416
1417  void Init(GLenum _mode) {
1418    SetHeader();
1419    mode = _mode;
1420  }
1421
1422  void* Set(void* cmd, GLenum _mode) {
1423    static_cast<ValueType*>(cmd)->Init(_mode);
1424    return NextCmdAddress<ValueType>(cmd);
1425  }
1426
1427  gpu::CommandHeader header;
1428  uint32_t mode;
1429};
1430
1431COMPILE_ASSERT(sizeof(CullFace) == 8, Sizeof_CullFace_is_not_8);
1432COMPILE_ASSERT(offsetof(CullFace, header) == 0, OffsetOf_CullFace_header_not_0);
1433COMPILE_ASSERT(offsetof(CullFace, mode) == 4, OffsetOf_CullFace_mode_not_4);
1434
1435struct DeleteBuffersImmediate {
1436  typedef DeleteBuffersImmediate ValueType;
1437  static const CommandId kCmdId = kDeleteBuffersImmediate;
1438  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
1439  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1440
1441  static uint32_t ComputeDataSize(GLsizei n) {
1442    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
1443  }
1444
1445  static uint32_t ComputeSize(GLsizei n) {
1446    return static_cast<uint32_t>(sizeof(ValueType) +
1447                                 ComputeDataSize(n));  // NOLINT
1448  }
1449
1450  void SetHeader(GLsizei n) {
1451    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
1452  }
1453
1454  void Init(GLsizei _n, const GLuint* _buffers) {
1455    SetHeader(_n);
1456    n = _n;
1457    memcpy(ImmediateDataAddress(this), _buffers, ComputeDataSize(_n));
1458  }
1459
1460  void* Set(void* cmd, GLsizei _n, const GLuint* _buffers) {
1461    static_cast<ValueType*>(cmd)->Init(_n, _buffers);
1462    const uint32_t size = ComputeSize(_n);
1463    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
1464  }
1465
1466  gpu::CommandHeader header;
1467  int32_t n;
1468};
1469
1470COMPILE_ASSERT(sizeof(DeleteBuffersImmediate) == 8,
1471               Sizeof_DeleteBuffersImmediate_is_not_8);
1472COMPILE_ASSERT(offsetof(DeleteBuffersImmediate, header) == 0,
1473               OffsetOf_DeleteBuffersImmediate_header_not_0);
1474COMPILE_ASSERT(offsetof(DeleteBuffersImmediate, n) == 4,
1475               OffsetOf_DeleteBuffersImmediate_n_not_4);
1476
1477struct DeleteFramebuffersImmediate {
1478  typedef DeleteFramebuffersImmediate ValueType;
1479  static const CommandId kCmdId = kDeleteFramebuffersImmediate;
1480  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
1481  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1482
1483  static uint32_t ComputeDataSize(GLsizei n) {
1484    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
1485  }
1486
1487  static uint32_t ComputeSize(GLsizei n) {
1488    return static_cast<uint32_t>(sizeof(ValueType) +
1489                                 ComputeDataSize(n));  // NOLINT
1490  }
1491
1492  void SetHeader(GLsizei n) {
1493    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
1494  }
1495
1496  void Init(GLsizei _n, const GLuint* _framebuffers) {
1497    SetHeader(_n);
1498    n = _n;
1499    memcpy(ImmediateDataAddress(this), _framebuffers, ComputeDataSize(_n));
1500  }
1501
1502  void* Set(void* cmd, GLsizei _n, const GLuint* _framebuffers) {
1503    static_cast<ValueType*>(cmd)->Init(_n, _framebuffers);
1504    const uint32_t size = ComputeSize(_n);
1505    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
1506  }
1507
1508  gpu::CommandHeader header;
1509  int32_t n;
1510};
1511
1512COMPILE_ASSERT(sizeof(DeleteFramebuffersImmediate) == 8,
1513               Sizeof_DeleteFramebuffersImmediate_is_not_8);
1514COMPILE_ASSERT(offsetof(DeleteFramebuffersImmediate, header) == 0,
1515               OffsetOf_DeleteFramebuffersImmediate_header_not_0);
1516COMPILE_ASSERT(offsetof(DeleteFramebuffersImmediate, n) == 4,
1517               OffsetOf_DeleteFramebuffersImmediate_n_not_4);
1518
1519struct DeleteProgram {
1520  typedef DeleteProgram ValueType;
1521  static const CommandId kCmdId = kDeleteProgram;
1522  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1523  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1524
1525  static uint32_t ComputeSize() {
1526    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1527  }
1528
1529  void SetHeader() { header.SetCmd<ValueType>(); }
1530
1531  void Init(GLuint _program) {
1532    SetHeader();
1533    program = _program;
1534  }
1535
1536  void* Set(void* cmd, GLuint _program) {
1537    static_cast<ValueType*>(cmd)->Init(_program);
1538    return NextCmdAddress<ValueType>(cmd);
1539  }
1540
1541  gpu::CommandHeader header;
1542  uint32_t program;
1543};
1544
1545COMPILE_ASSERT(sizeof(DeleteProgram) == 8, Sizeof_DeleteProgram_is_not_8);
1546COMPILE_ASSERT(offsetof(DeleteProgram, header) == 0,
1547               OffsetOf_DeleteProgram_header_not_0);
1548COMPILE_ASSERT(offsetof(DeleteProgram, program) == 4,
1549               OffsetOf_DeleteProgram_program_not_4);
1550
1551struct DeleteRenderbuffersImmediate {
1552  typedef DeleteRenderbuffersImmediate ValueType;
1553  static const CommandId kCmdId = kDeleteRenderbuffersImmediate;
1554  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
1555  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1556
1557  static uint32_t ComputeDataSize(GLsizei n) {
1558    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
1559  }
1560
1561  static uint32_t ComputeSize(GLsizei n) {
1562    return static_cast<uint32_t>(sizeof(ValueType) +
1563                                 ComputeDataSize(n));  // NOLINT
1564  }
1565
1566  void SetHeader(GLsizei n) {
1567    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
1568  }
1569
1570  void Init(GLsizei _n, const GLuint* _renderbuffers) {
1571    SetHeader(_n);
1572    n = _n;
1573    memcpy(ImmediateDataAddress(this), _renderbuffers, ComputeDataSize(_n));
1574  }
1575
1576  void* Set(void* cmd, GLsizei _n, const GLuint* _renderbuffers) {
1577    static_cast<ValueType*>(cmd)->Init(_n, _renderbuffers);
1578    const uint32_t size = ComputeSize(_n);
1579    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
1580  }
1581
1582  gpu::CommandHeader header;
1583  int32_t n;
1584};
1585
1586COMPILE_ASSERT(sizeof(DeleteRenderbuffersImmediate) == 8,
1587               Sizeof_DeleteRenderbuffersImmediate_is_not_8);
1588COMPILE_ASSERT(offsetof(DeleteRenderbuffersImmediate, header) == 0,
1589               OffsetOf_DeleteRenderbuffersImmediate_header_not_0);
1590COMPILE_ASSERT(offsetof(DeleteRenderbuffersImmediate, n) == 4,
1591               OffsetOf_DeleteRenderbuffersImmediate_n_not_4);
1592
1593struct DeleteShader {
1594  typedef DeleteShader ValueType;
1595  static const CommandId kCmdId = kDeleteShader;
1596  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1597  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1598
1599  static uint32_t ComputeSize() {
1600    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1601  }
1602
1603  void SetHeader() { header.SetCmd<ValueType>(); }
1604
1605  void Init(GLuint _shader) {
1606    SetHeader();
1607    shader = _shader;
1608  }
1609
1610  void* Set(void* cmd, GLuint _shader) {
1611    static_cast<ValueType*>(cmd)->Init(_shader);
1612    return NextCmdAddress<ValueType>(cmd);
1613  }
1614
1615  gpu::CommandHeader header;
1616  uint32_t shader;
1617};
1618
1619COMPILE_ASSERT(sizeof(DeleteShader) == 8, Sizeof_DeleteShader_is_not_8);
1620COMPILE_ASSERT(offsetof(DeleteShader, header) == 0,
1621               OffsetOf_DeleteShader_header_not_0);
1622COMPILE_ASSERT(offsetof(DeleteShader, shader) == 4,
1623               OffsetOf_DeleteShader_shader_not_4);
1624
1625struct DeleteTexturesImmediate {
1626  typedef DeleteTexturesImmediate ValueType;
1627  static const CommandId kCmdId = kDeleteTexturesImmediate;
1628  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
1629  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1630
1631  static uint32_t ComputeDataSize(GLsizei n) {
1632    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
1633  }
1634
1635  static uint32_t ComputeSize(GLsizei n) {
1636    return static_cast<uint32_t>(sizeof(ValueType) +
1637                                 ComputeDataSize(n));  // NOLINT
1638  }
1639
1640  void SetHeader(GLsizei n) {
1641    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
1642  }
1643
1644  void Init(GLsizei _n, const GLuint* _textures) {
1645    SetHeader(_n);
1646    n = _n;
1647    memcpy(ImmediateDataAddress(this), _textures, ComputeDataSize(_n));
1648  }
1649
1650  void* Set(void* cmd, GLsizei _n, const GLuint* _textures) {
1651    static_cast<ValueType*>(cmd)->Init(_n, _textures);
1652    const uint32_t size = ComputeSize(_n);
1653    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
1654  }
1655
1656  gpu::CommandHeader header;
1657  int32_t n;
1658};
1659
1660COMPILE_ASSERT(sizeof(DeleteTexturesImmediate) == 8,
1661               Sizeof_DeleteTexturesImmediate_is_not_8);
1662COMPILE_ASSERT(offsetof(DeleteTexturesImmediate, header) == 0,
1663               OffsetOf_DeleteTexturesImmediate_header_not_0);
1664COMPILE_ASSERT(offsetof(DeleteTexturesImmediate, n) == 4,
1665               OffsetOf_DeleteTexturesImmediate_n_not_4);
1666
1667struct DepthFunc {
1668  typedef DepthFunc ValueType;
1669  static const CommandId kCmdId = kDepthFunc;
1670  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1671  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1672
1673  static uint32_t ComputeSize() {
1674    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1675  }
1676
1677  void SetHeader() { header.SetCmd<ValueType>(); }
1678
1679  void Init(GLenum _func) {
1680    SetHeader();
1681    func = _func;
1682  }
1683
1684  void* Set(void* cmd, GLenum _func) {
1685    static_cast<ValueType*>(cmd)->Init(_func);
1686    return NextCmdAddress<ValueType>(cmd);
1687  }
1688
1689  gpu::CommandHeader header;
1690  uint32_t func;
1691};
1692
1693COMPILE_ASSERT(sizeof(DepthFunc) == 8, Sizeof_DepthFunc_is_not_8);
1694COMPILE_ASSERT(offsetof(DepthFunc, header) == 0,
1695               OffsetOf_DepthFunc_header_not_0);
1696COMPILE_ASSERT(offsetof(DepthFunc, func) == 4, OffsetOf_DepthFunc_func_not_4);
1697
1698struct DepthMask {
1699  typedef DepthMask ValueType;
1700  static const CommandId kCmdId = kDepthMask;
1701  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1702  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1703
1704  static uint32_t ComputeSize() {
1705    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1706  }
1707
1708  void SetHeader() { header.SetCmd<ValueType>(); }
1709
1710  void Init(GLboolean _flag) {
1711    SetHeader();
1712    flag = _flag;
1713  }
1714
1715  void* Set(void* cmd, GLboolean _flag) {
1716    static_cast<ValueType*>(cmd)->Init(_flag);
1717    return NextCmdAddress<ValueType>(cmd);
1718  }
1719
1720  gpu::CommandHeader header;
1721  uint32_t flag;
1722};
1723
1724COMPILE_ASSERT(sizeof(DepthMask) == 8, Sizeof_DepthMask_is_not_8);
1725COMPILE_ASSERT(offsetof(DepthMask, header) == 0,
1726               OffsetOf_DepthMask_header_not_0);
1727COMPILE_ASSERT(offsetof(DepthMask, flag) == 4, OffsetOf_DepthMask_flag_not_4);
1728
1729struct DepthRangef {
1730  typedef DepthRangef ValueType;
1731  static const CommandId kCmdId = kDepthRangef;
1732  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1733  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1734
1735  static uint32_t ComputeSize() {
1736    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1737  }
1738
1739  void SetHeader() { header.SetCmd<ValueType>(); }
1740
1741  void Init(GLclampf _zNear, GLclampf _zFar) {
1742    SetHeader();
1743    zNear = _zNear;
1744    zFar = _zFar;
1745  }
1746
1747  void* Set(void* cmd, GLclampf _zNear, GLclampf _zFar) {
1748    static_cast<ValueType*>(cmd)->Init(_zNear, _zFar);
1749    return NextCmdAddress<ValueType>(cmd);
1750  }
1751
1752  gpu::CommandHeader header;
1753  float zNear;
1754  float zFar;
1755};
1756
1757COMPILE_ASSERT(sizeof(DepthRangef) == 12, Sizeof_DepthRangef_is_not_12);
1758COMPILE_ASSERT(offsetof(DepthRangef, header) == 0,
1759               OffsetOf_DepthRangef_header_not_0);
1760COMPILE_ASSERT(offsetof(DepthRangef, zNear) == 4,
1761               OffsetOf_DepthRangef_zNear_not_4);
1762COMPILE_ASSERT(offsetof(DepthRangef, zFar) == 8,
1763               OffsetOf_DepthRangef_zFar_not_8);
1764
1765struct DetachShader {
1766  typedef DetachShader ValueType;
1767  static const CommandId kCmdId = kDetachShader;
1768  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1769  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1770
1771  static uint32_t ComputeSize() {
1772    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1773  }
1774
1775  void SetHeader() { header.SetCmd<ValueType>(); }
1776
1777  void Init(GLuint _program, GLuint _shader) {
1778    SetHeader();
1779    program = _program;
1780    shader = _shader;
1781  }
1782
1783  void* Set(void* cmd, GLuint _program, GLuint _shader) {
1784    static_cast<ValueType*>(cmd)->Init(_program, _shader);
1785    return NextCmdAddress<ValueType>(cmd);
1786  }
1787
1788  gpu::CommandHeader header;
1789  uint32_t program;
1790  uint32_t shader;
1791};
1792
1793COMPILE_ASSERT(sizeof(DetachShader) == 12, Sizeof_DetachShader_is_not_12);
1794COMPILE_ASSERT(offsetof(DetachShader, header) == 0,
1795               OffsetOf_DetachShader_header_not_0);
1796COMPILE_ASSERT(offsetof(DetachShader, program) == 4,
1797               OffsetOf_DetachShader_program_not_4);
1798COMPILE_ASSERT(offsetof(DetachShader, shader) == 8,
1799               OffsetOf_DetachShader_shader_not_8);
1800
1801struct Disable {
1802  typedef Disable ValueType;
1803  static const CommandId kCmdId = kDisable;
1804  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1805  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1806
1807  static uint32_t ComputeSize() {
1808    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1809  }
1810
1811  void SetHeader() { header.SetCmd<ValueType>(); }
1812
1813  void Init(GLenum _cap) {
1814    SetHeader();
1815    cap = _cap;
1816  }
1817
1818  void* Set(void* cmd, GLenum _cap) {
1819    static_cast<ValueType*>(cmd)->Init(_cap);
1820    return NextCmdAddress<ValueType>(cmd);
1821  }
1822
1823  gpu::CommandHeader header;
1824  uint32_t cap;
1825};
1826
1827COMPILE_ASSERT(sizeof(Disable) == 8, Sizeof_Disable_is_not_8);
1828COMPILE_ASSERT(offsetof(Disable, header) == 0, OffsetOf_Disable_header_not_0);
1829COMPILE_ASSERT(offsetof(Disable, cap) == 4, OffsetOf_Disable_cap_not_4);
1830
1831struct DisableVertexAttribArray {
1832  typedef DisableVertexAttribArray ValueType;
1833  static const CommandId kCmdId = kDisableVertexAttribArray;
1834  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1835  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1836
1837  static uint32_t ComputeSize() {
1838    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1839  }
1840
1841  void SetHeader() { header.SetCmd<ValueType>(); }
1842
1843  void Init(GLuint _index) {
1844    SetHeader();
1845    index = _index;
1846  }
1847
1848  void* Set(void* cmd, GLuint _index) {
1849    static_cast<ValueType*>(cmd)->Init(_index);
1850    return NextCmdAddress<ValueType>(cmd);
1851  }
1852
1853  gpu::CommandHeader header;
1854  uint32_t index;
1855};
1856
1857COMPILE_ASSERT(sizeof(DisableVertexAttribArray) == 8,
1858               Sizeof_DisableVertexAttribArray_is_not_8);
1859COMPILE_ASSERT(offsetof(DisableVertexAttribArray, header) == 0,
1860               OffsetOf_DisableVertexAttribArray_header_not_0);
1861COMPILE_ASSERT(offsetof(DisableVertexAttribArray, index) == 4,
1862               OffsetOf_DisableVertexAttribArray_index_not_4);
1863
1864struct DrawArrays {
1865  typedef DrawArrays ValueType;
1866  static const CommandId kCmdId = kDrawArrays;
1867  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1868  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);
1869
1870  static uint32_t ComputeSize() {
1871    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1872  }
1873
1874  void SetHeader() { header.SetCmd<ValueType>(); }
1875
1876  void Init(GLenum _mode, GLint _first, GLsizei _count) {
1877    SetHeader();
1878    mode = _mode;
1879    first = _first;
1880    count = _count;
1881  }
1882
1883  void* Set(void* cmd, GLenum _mode, GLint _first, GLsizei _count) {
1884    static_cast<ValueType*>(cmd)->Init(_mode, _first, _count);
1885    return NextCmdAddress<ValueType>(cmd);
1886  }
1887
1888  gpu::CommandHeader header;
1889  uint32_t mode;
1890  int32_t first;
1891  int32_t count;
1892};
1893
1894COMPILE_ASSERT(sizeof(DrawArrays) == 16, Sizeof_DrawArrays_is_not_16);
1895COMPILE_ASSERT(offsetof(DrawArrays, header) == 0,
1896               OffsetOf_DrawArrays_header_not_0);
1897COMPILE_ASSERT(offsetof(DrawArrays, mode) == 4, OffsetOf_DrawArrays_mode_not_4);
1898COMPILE_ASSERT(offsetof(DrawArrays, first) == 8,
1899               OffsetOf_DrawArrays_first_not_8);
1900COMPILE_ASSERT(offsetof(DrawArrays, count) == 12,
1901               OffsetOf_DrawArrays_count_not_12);
1902
1903struct DrawElements {
1904  typedef DrawElements ValueType;
1905  static const CommandId kCmdId = kDrawElements;
1906  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1907  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);
1908
1909  static uint32_t ComputeSize() {
1910    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1911  }
1912
1913  void SetHeader() { header.SetCmd<ValueType>(); }
1914
1915  void Init(GLenum _mode, GLsizei _count, GLenum _type, GLuint _index_offset) {
1916    SetHeader();
1917    mode = _mode;
1918    count = _count;
1919    type = _type;
1920    index_offset = _index_offset;
1921  }
1922
1923  void* Set(void* cmd,
1924            GLenum _mode,
1925            GLsizei _count,
1926            GLenum _type,
1927            GLuint _index_offset) {
1928    static_cast<ValueType*>(cmd)->Init(_mode, _count, _type, _index_offset);
1929    return NextCmdAddress<ValueType>(cmd);
1930  }
1931
1932  gpu::CommandHeader header;
1933  uint32_t mode;
1934  int32_t count;
1935  uint32_t type;
1936  uint32_t index_offset;
1937};
1938
1939COMPILE_ASSERT(sizeof(DrawElements) == 20, Sizeof_DrawElements_is_not_20);
1940COMPILE_ASSERT(offsetof(DrawElements, header) == 0,
1941               OffsetOf_DrawElements_header_not_0);
1942COMPILE_ASSERT(offsetof(DrawElements, mode) == 4,
1943               OffsetOf_DrawElements_mode_not_4);
1944COMPILE_ASSERT(offsetof(DrawElements, count) == 8,
1945               OffsetOf_DrawElements_count_not_8);
1946COMPILE_ASSERT(offsetof(DrawElements, type) == 12,
1947               OffsetOf_DrawElements_type_not_12);
1948COMPILE_ASSERT(offsetof(DrawElements, index_offset) == 16,
1949               OffsetOf_DrawElements_index_offset_not_16);
1950
1951struct Enable {
1952  typedef Enable ValueType;
1953  static const CommandId kCmdId = kEnable;
1954  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1955  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1956
1957  static uint32_t ComputeSize() {
1958    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1959  }
1960
1961  void SetHeader() { header.SetCmd<ValueType>(); }
1962
1963  void Init(GLenum _cap) {
1964    SetHeader();
1965    cap = _cap;
1966  }
1967
1968  void* Set(void* cmd, GLenum _cap) {
1969    static_cast<ValueType*>(cmd)->Init(_cap);
1970    return NextCmdAddress<ValueType>(cmd);
1971  }
1972
1973  gpu::CommandHeader header;
1974  uint32_t cap;
1975};
1976
1977COMPILE_ASSERT(sizeof(Enable) == 8, Sizeof_Enable_is_not_8);
1978COMPILE_ASSERT(offsetof(Enable, header) == 0, OffsetOf_Enable_header_not_0);
1979COMPILE_ASSERT(offsetof(Enable, cap) == 4, OffsetOf_Enable_cap_not_4);
1980
1981struct EnableVertexAttribArray {
1982  typedef EnableVertexAttribArray ValueType;
1983  static const CommandId kCmdId = kEnableVertexAttribArray;
1984  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
1985  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
1986
1987  static uint32_t ComputeSize() {
1988    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
1989  }
1990
1991  void SetHeader() { header.SetCmd<ValueType>(); }
1992
1993  void Init(GLuint _index) {
1994    SetHeader();
1995    index = _index;
1996  }
1997
1998  void* Set(void* cmd, GLuint _index) {
1999    static_cast<ValueType*>(cmd)->Init(_index);
2000    return NextCmdAddress<ValueType>(cmd);
2001  }
2002
2003  gpu::CommandHeader header;
2004  uint32_t index;
2005};
2006
2007COMPILE_ASSERT(sizeof(EnableVertexAttribArray) == 8,
2008               Sizeof_EnableVertexAttribArray_is_not_8);
2009COMPILE_ASSERT(offsetof(EnableVertexAttribArray, header) == 0,
2010               OffsetOf_EnableVertexAttribArray_header_not_0);
2011COMPILE_ASSERT(offsetof(EnableVertexAttribArray, index) == 4,
2012               OffsetOf_EnableVertexAttribArray_index_not_4);
2013
2014struct Finish {
2015  typedef Finish ValueType;
2016  static const CommandId kCmdId = kFinish;
2017  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2018  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2019
2020  static uint32_t ComputeSize() {
2021    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2022  }
2023
2024  void SetHeader() { header.SetCmd<ValueType>(); }
2025
2026  void Init() { SetHeader(); }
2027
2028  void* Set(void* cmd) {
2029    static_cast<ValueType*>(cmd)->Init();
2030    return NextCmdAddress<ValueType>(cmd);
2031  }
2032
2033  gpu::CommandHeader header;
2034};
2035
2036COMPILE_ASSERT(sizeof(Finish) == 4, Sizeof_Finish_is_not_4);
2037COMPILE_ASSERT(offsetof(Finish, header) == 0, OffsetOf_Finish_header_not_0);
2038
2039struct Flush {
2040  typedef Flush ValueType;
2041  static const CommandId kCmdId = kFlush;
2042  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2043  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2044
2045  static uint32_t ComputeSize() {
2046    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2047  }
2048
2049  void SetHeader() { header.SetCmd<ValueType>(); }
2050
2051  void Init() { SetHeader(); }
2052
2053  void* Set(void* cmd) {
2054    static_cast<ValueType*>(cmd)->Init();
2055    return NextCmdAddress<ValueType>(cmd);
2056  }
2057
2058  gpu::CommandHeader header;
2059};
2060
2061COMPILE_ASSERT(sizeof(Flush) == 4, Sizeof_Flush_is_not_4);
2062COMPILE_ASSERT(offsetof(Flush, header) == 0, OffsetOf_Flush_header_not_0);
2063
2064struct FramebufferRenderbuffer {
2065  typedef FramebufferRenderbuffer ValueType;
2066  static const CommandId kCmdId = kFramebufferRenderbuffer;
2067  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2068  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2069
2070  static uint32_t ComputeSize() {
2071    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2072  }
2073
2074  void SetHeader() { header.SetCmd<ValueType>(); }
2075
2076  void Init(GLenum _target,
2077            GLenum _attachment,
2078            GLenum _renderbuffertarget,
2079            GLuint _renderbuffer) {
2080    SetHeader();
2081    target = _target;
2082    attachment = _attachment;
2083    renderbuffertarget = _renderbuffertarget;
2084    renderbuffer = _renderbuffer;
2085  }
2086
2087  void* Set(void* cmd,
2088            GLenum _target,
2089            GLenum _attachment,
2090            GLenum _renderbuffertarget,
2091            GLuint _renderbuffer) {
2092    static_cast<ValueType*>(cmd)
2093        ->Init(_target, _attachment, _renderbuffertarget, _renderbuffer);
2094    return NextCmdAddress<ValueType>(cmd);
2095  }
2096
2097  gpu::CommandHeader header;
2098  uint32_t target;
2099  uint32_t attachment;
2100  uint32_t renderbuffertarget;
2101  uint32_t renderbuffer;
2102};
2103
2104COMPILE_ASSERT(sizeof(FramebufferRenderbuffer) == 20,
2105               Sizeof_FramebufferRenderbuffer_is_not_20);
2106COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, header) == 0,
2107               OffsetOf_FramebufferRenderbuffer_header_not_0);
2108COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, target) == 4,
2109               OffsetOf_FramebufferRenderbuffer_target_not_4);
2110COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, attachment) == 8,
2111               OffsetOf_FramebufferRenderbuffer_attachment_not_8);
2112COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, renderbuffertarget) == 12,
2113               OffsetOf_FramebufferRenderbuffer_renderbuffertarget_not_12);
2114COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, renderbuffer) == 16,
2115               OffsetOf_FramebufferRenderbuffer_renderbuffer_not_16);
2116
2117struct FramebufferTexture2D {
2118  typedef FramebufferTexture2D ValueType;
2119  static const CommandId kCmdId = kFramebufferTexture2D;
2120  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2121  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);
2122
2123  static uint32_t ComputeSize() {
2124    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2125  }
2126
2127  void SetHeader() { header.SetCmd<ValueType>(); }
2128
2129  void Init(GLenum _target,
2130            GLenum _attachment,
2131            GLenum _textarget,
2132            GLuint _texture) {
2133    SetHeader();
2134    target = _target;
2135    attachment = _attachment;
2136    textarget = _textarget;
2137    texture = _texture;
2138  }
2139
2140  void* Set(void* cmd,
2141            GLenum _target,
2142            GLenum _attachment,
2143            GLenum _textarget,
2144            GLuint _texture) {
2145    static_cast<ValueType*>(cmd)
2146        ->Init(_target, _attachment, _textarget, _texture);
2147    return NextCmdAddress<ValueType>(cmd);
2148  }
2149
2150  gpu::CommandHeader header;
2151  uint32_t target;
2152  uint32_t attachment;
2153  uint32_t textarget;
2154  uint32_t texture;
2155  static const int32_t level = 0;
2156};
2157
2158COMPILE_ASSERT(sizeof(FramebufferTexture2D) == 20,
2159               Sizeof_FramebufferTexture2D_is_not_20);
2160COMPILE_ASSERT(offsetof(FramebufferTexture2D, header) == 0,
2161               OffsetOf_FramebufferTexture2D_header_not_0);
2162COMPILE_ASSERT(offsetof(FramebufferTexture2D, target) == 4,
2163               OffsetOf_FramebufferTexture2D_target_not_4);
2164COMPILE_ASSERT(offsetof(FramebufferTexture2D, attachment) == 8,
2165               OffsetOf_FramebufferTexture2D_attachment_not_8);
2166COMPILE_ASSERT(offsetof(FramebufferTexture2D, textarget) == 12,
2167               OffsetOf_FramebufferTexture2D_textarget_not_12);
2168COMPILE_ASSERT(offsetof(FramebufferTexture2D, texture) == 16,
2169               OffsetOf_FramebufferTexture2D_texture_not_16);
2170
2171struct FrontFace {
2172  typedef FrontFace ValueType;
2173  static const CommandId kCmdId = kFrontFace;
2174  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2175  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2176
2177  static uint32_t ComputeSize() {
2178    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2179  }
2180
2181  void SetHeader() { header.SetCmd<ValueType>(); }
2182
2183  void Init(GLenum _mode) {
2184    SetHeader();
2185    mode = _mode;
2186  }
2187
2188  void* Set(void* cmd, GLenum _mode) {
2189    static_cast<ValueType*>(cmd)->Init(_mode);
2190    return NextCmdAddress<ValueType>(cmd);
2191  }
2192
2193  gpu::CommandHeader header;
2194  uint32_t mode;
2195};
2196
2197COMPILE_ASSERT(sizeof(FrontFace) == 8, Sizeof_FrontFace_is_not_8);
2198COMPILE_ASSERT(offsetof(FrontFace, header) == 0,
2199               OffsetOf_FrontFace_header_not_0);
2200COMPILE_ASSERT(offsetof(FrontFace, mode) == 4, OffsetOf_FrontFace_mode_not_4);
2201
2202struct GenBuffersImmediate {
2203  typedef GenBuffersImmediate ValueType;
2204  static const CommandId kCmdId = kGenBuffersImmediate;
2205  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
2206  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2207
2208  static uint32_t ComputeDataSize(GLsizei n) {
2209    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
2210  }
2211
2212  static uint32_t ComputeSize(GLsizei n) {
2213    return static_cast<uint32_t>(sizeof(ValueType) +
2214                                 ComputeDataSize(n));  // NOLINT
2215  }
2216
2217  void SetHeader(GLsizei n) {
2218    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
2219  }
2220
2221  void Init(GLsizei _n, GLuint* _buffers) {
2222    SetHeader(_n);
2223    n = _n;
2224    memcpy(ImmediateDataAddress(this), _buffers, ComputeDataSize(_n));
2225  }
2226
2227  void* Set(void* cmd, GLsizei _n, GLuint* _buffers) {
2228    static_cast<ValueType*>(cmd)->Init(_n, _buffers);
2229    const uint32_t size = ComputeSize(_n);
2230    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
2231  }
2232
2233  gpu::CommandHeader header;
2234  int32_t n;
2235};
2236
2237COMPILE_ASSERT(sizeof(GenBuffersImmediate) == 8,
2238               Sizeof_GenBuffersImmediate_is_not_8);
2239COMPILE_ASSERT(offsetof(GenBuffersImmediate, header) == 0,
2240               OffsetOf_GenBuffersImmediate_header_not_0);
2241COMPILE_ASSERT(offsetof(GenBuffersImmediate, n) == 4,
2242               OffsetOf_GenBuffersImmediate_n_not_4);
2243
2244struct GenerateMipmap {
2245  typedef GenerateMipmap ValueType;
2246  static const CommandId kCmdId = kGenerateMipmap;
2247  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2248  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2249
2250  static uint32_t ComputeSize() {
2251    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2252  }
2253
2254  void SetHeader() { header.SetCmd<ValueType>(); }
2255
2256  void Init(GLenum _target) {
2257    SetHeader();
2258    target = _target;
2259  }
2260
2261  void* Set(void* cmd, GLenum _target) {
2262    static_cast<ValueType*>(cmd)->Init(_target);
2263    return NextCmdAddress<ValueType>(cmd);
2264  }
2265
2266  gpu::CommandHeader header;
2267  uint32_t target;
2268};
2269
2270COMPILE_ASSERT(sizeof(GenerateMipmap) == 8, Sizeof_GenerateMipmap_is_not_8);
2271COMPILE_ASSERT(offsetof(GenerateMipmap, header) == 0,
2272               OffsetOf_GenerateMipmap_header_not_0);
2273COMPILE_ASSERT(offsetof(GenerateMipmap, target) == 4,
2274               OffsetOf_GenerateMipmap_target_not_4);
2275
2276struct GenFramebuffersImmediate {
2277  typedef GenFramebuffersImmediate ValueType;
2278  static const CommandId kCmdId = kGenFramebuffersImmediate;
2279  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
2280  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2281
2282  static uint32_t ComputeDataSize(GLsizei n) {
2283    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
2284  }
2285
2286  static uint32_t ComputeSize(GLsizei n) {
2287    return static_cast<uint32_t>(sizeof(ValueType) +
2288                                 ComputeDataSize(n));  // NOLINT
2289  }
2290
2291  void SetHeader(GLsizei n) {
2292    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
2293  }
2294
2295  void Init(GLsizei _n, GLuint* _framebuffers) {
2296    SetHeader(_n);
2297    n = _n;
2298    memcpy(ImmediateDataAddress(this), _framebuffers, ComputeDataSize(_n));
2299  }
2300
2301  void* Set(void* cmd, GLsizei _n, GLuint* _framebuffers) {
2302    static_cast<ValueType*>(cmd)->Init(_n, _framebuffers);
2303    const uint32_t size = ComputeSize(_n);
2304    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
2305  }
2306
2307  gpu::CommandHeader header;
2308  int32_t n;
2309};
2310
2311COMPILE_ASSERT(sizeof(GenFramebuffersImmediate) == 8,
2312               Sizeof_GenFramebuffersImmediate_is_not_8);
2313COMPILE_ASSERT(offsetof(GenFramebuffersImmediate, header) == 0,
2314               OffsetOf_GenFramebuffersImmediate_header_not_0);
2315COMPILE_ASSERT(offsetof(GenFramebuffersImmediate, n) == 4,
2316               OffsetOf_GenFramebuffersImmediate_n_not_4);
2317
2318struct GenRenderbuffersImmediate {
2319  typedef GenRenderbuffersImmediate ValueType;
2320  static const CommandId kCmdId = kGenRenderbuffersImmediate;
2321  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
2322  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2323
2324  static uint32_t ComputeDataSize(GLsizei n) {
2325    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
2326  }
2327
2328  static uint32_t ComputeSize(GLsizei n) {
2329    return static_cast<uint32_t>(sizeof(ValueType) +
2330                                 ComputeDataSize(n));  // NOLINT
2331  }
2332
2333  void SetHeader(GLsizei n) {
2334    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
2335  }
2336
2337  void Init(GLsizei _n, GLuint* _renderbuffers) {
2338    SetHeader(_n);
2339    n = _n;
2340    memcpy(ImmediateDataAddress(this), _renderbuffers, ComputeDataSize(_n));
2341  }
2342
2343  void* Set(void* cmd, GLsizei _n, GLuint* _renderbuffers) {
2344    static_cast<ValueType*>(cmd)->Init(_n, _renderbuffers);
2345    const uint32_t size = ComputeSize(_n);
2346    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
2347  }
2348
2349  gpu::CommandHeader header;
2350  int32_t n;
2351};
2352
2353COMPILE_ASSERT(sizeof(GenRenderbuffersImmediate) == 8,
2354               Sizeof_GenRenderbuffersImmediate_is_not_8);
2355COMPILE_ASSERT(offsetof(GenRenderbuffersImmediate, header) == 0,
2356               OffsetOf_GenRenderbuffersImmediate_header_not_0);
2357COMPILE_ASSERT(offsetof(GenRenderbuffersImmediate, n) == 4,
2358               OffsetOf_GenRenderbuffersImmediate_n_not_4);
2359
2360struct GenTexturesImmediate {
2361  typedef GenTexturesImmediate ValueType;
2362  static const CommandId kCmdId = kGenTexturesImmediate;
2363  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
2364  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2365
2366  static uint32_t ComputeDataSize(GLsizei n) {
2367    return static_cast<uint32_t>(sizeof(GLuint) * n);  // NOLINT
2368  }
2369
2370  static uint32_t ComputeSize(GLsizei n) {
2371    return static_cast<uint32_t>(sizeof(ValueType) +
2372                                 ComputeDataSize(n));  // NOLINT
2373  }
2374
2375  void SetHeader(GLsizei n) {
2376    header.SetCmdByTotalSize<ValueType>(ComputeSize(n));
2377  }
2378
2379  void Init(GLsizei _n, GLuint* _textures) {
2380    SetHeader(_n);
2381    n = _n;
2382    memcpy(ImmediateDataAddress(this), _textures, ComputeDataSize(_n));
2383  }
2384
2385  void* Set(void* cmd, GLsizei _n, GLuint* _textures) {
2386    static_cast<ValueType*>(cmd)->Init(_n, _textures);
2387    const uint32_t size = ComputeSize(_n);
2388    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
2389  }
2390
2391  gpu::CommandHeader header;
2392  int32_t n;
2393};
2394
2395COMPILE_ASSERT(sizeof(GenTexturesImmediate) == 8,
2396               Sizeof_GenTexturesImmediate_is_not_8);
2397COMPILE_ASSERT(offsetof(GenTexturesImmediate, header) == 0,
2398               OffsetOf_GenTexturesImmediate_header_not_0);
2399COMPILE_ASSERT(offsetof(GenTexturesImmediate, n) == 4,
2400               OffsetOf_GenTexturesImmediate_n_not_4);
2401
2402struct GetActiveAttrib {
2403  typedef GetActiveAttrib ValueType;
2404  static const CommandId kCmdId = kGetActiveAttrib;
2405  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2406  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2407
2408  struct Result {
2409    int32_t success;
2410    int32_t size;
2411    uint32_t type;
2412  };
2413
2414  static uint32_t ComputeSize() {
2415    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2416  }
2417
2418  void SetHeader() { header.SetCmd<ValueType>(); }
2419
2420  void Init(GLuint _program,
2421            GLuint _index,
2422            uint32_t _name_bucket_id,
2423            uint32_t _result_shm_id,
2424            uint32_t _result_shm_offset) {
2425    SetHeader();
2426    program = _program;
2427    index = _index;
2428    name_bucket_id = _name_bucket_id;
2429    result_shm_id = _result_shm_id;
2430    result_shm_offset = _result_shm_offset;
2431  }
2432
2433  void* Set(void* cmd,
2434            GLuint _program,
2435            GLuint _index,
2436            uint32_t _name_bucket_id,
2437            uint32_t _result_shm_id,
2438            uint32_t _result_shm_offset) {
2439    static_cast<ValueType*>(cmd)->Init(
2440        _program, _index, _name_bucket_id, _result_shm_id, _result_shm_offset);
2441    return NextCmdAddress<ValueType>(cmd);
2442  }
2443
2444  gpu::CommandHeader header;
2445  uint32_t program;
2446  uint32_t index;
2447  uint32_t name_bucket_id;
2448  uint32_t result_shm_id;
2449  uint32_t result_shm_offset;
2450};
2451
2452COMPILE_ASSERT(sizeof(GetActiveAttrib) == 24, Sizeof_GetActiveAttrib_is_not_24);
2453COMPILE_ASSERT(offsetof(GetActiveAttrib, header) == 0,
2454               OffsetOf_GetActiveAttrib_header_not_0);
2455COMPILE_ASSERT(offsetof(GetActiveAttrib, program) == 4,
2456               OffsetOf_GetActiveAttrib_program_not_4);
2457COMPILE_ASSERT(offsetof(GetActiveAttrib, index) == 8,
2458               OffsetOf_GetActiveAttrib_index_not_8);
2459COMPILE_ASSERT(offsetof(GetActiveAttrib, name_bucket_id) == 12,
2460               OffsetOf_GetActiveAttrib_name_bucket_id_not_12);
2461COMPILE_ASSERT(offsetof(GetActiveAttrib, result_shm_id) == 16,
2462               OffsetOf_GetActiveAttrib_result_shm_id_not_16);
2463COMPILE_ASSERT(offsetof(GetActiveAttrib, result_shm_offset) == 20,
2464               OffsetOf_GetActiveAttrib_result_shm_offset_not_20);
2465COMPILE_ASSERT(offsetof(GetActiveAttrib::Result, success) == 0,
2466               OffsetOf_GetActiveAttrib_Result_success_not_0);
2467COMPILE_ASSERT(offsetof(GetActiveAttrib::Result, size) == 4,
2468               OffsetOf_GetActiveAttrib_Result_size_not_4);
2469COMPILE_ASSERT(offsetof(GetActiveAttrib::Result, type) == 8,
2470               OffsetOf_GetActiveAttrib_Result_type_not_8);
2471
2472struct GetActiveUniform {
2473  typedef GetActiveUniform ValueType;
2474  static const CommandId kCmdId = kGetActiveUniform;
2475  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2476  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2477
2478  struct Result {
2479    int32_t success;
2480    int32_t size;
2481    uint32_t type;
2482  };
2483
2484  static uint32_t ComputeSize() {
2485    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2486  }
2487
2488  void SetHeader() { header.SetCmd<ValueType>(); }
2489
2490  void Init(GLuint _program,
2491            GLuint _index,
2492            uint32_t _name_bucket_id,
2493            uint32_t _result_shm_id,
2494            uint32_t _result_shm_offset) {
2495    SetHeader();
2496    program = _program;
2497    index = _index;
2498    name_bucket_id = _name_bucket_id;
2499    result_shm_id = _result_shm_id;
2500    result_shm_offset = _result_shm_offset;
2501  }
2502
2503  void* Set(void* cmd,
2504            GLuint _program,
2505            GLuint _index,
2506            uint32_t _name_bucket_id,
2507            uint32_t _result_shm_id,
2508            uint32_t _result_shm_offset) {
2509    static_cast<ValueType*>(cmd)->Init(
2510        _program, _index, _name_bucket_id, _result_shm_id, _result_shm_offset);
2511    return NextCmdAddress<ValueType>(cmd);
2512  }
2513
2514  gpu::CommandHeader header;
2515  uint32_t program;
2516  uint32_t index;
2517  uint32_t name_bucket_id;
2518  uint32_t result_shm_id;
2519  uint32_t result_shm_offset;
2520};
2521
2522COMPILE_ASSERT(sizeof(GetActiveUniform) == 24,
2523               Sizeof_GetActiveUniform_is_not_24);
2524COMPILE_ASSERT(offsetof(GetActiveUniform, header) == 0,
2525               OffsetOf_GetActiveUniform_header_not_0);
2526COMPILE_ASSERT(offsetof(GetActiveUniform, program) == 4,
2527               OffsetOf_GetActiveUniform_program_not_4);
2528COMPILE_ASSERT(offsetof(GetActiveUniform, index) == 8,
2529               OffsetOf_GetActiveUniform_index_not_8);
2530COMPILE_ASSERT(offsetof(GetActiveUniform, name_bucket_id) == 12,
2531               OffsetOf_GetActiveUniform_name_bucket_id_not_12);
2532COMPILE_ASSERT(offsetof(GetActiveUniform, result_shm_id) == 16,
2533               OffsetOf_GetActiveUniform_result_shm_id_not_16);
2534COMPILE_ASSERT(offsetof(GetActiveUniform, result_shm_offset) == 20,
2535               OffsetOf_GetActiveUniform_result_shm_offset_not_20);
2536COMPILE_ASSERT(offsetof(GetActiveUniform::Result, success) == 0,
2537               OffsetOf_GetActiveUniform_Result_success_not_0);
2538COMPILE_ASSERT(offsetof(GetActiveUniform::Result, size) == 4,
2539               OffsetOf_GetActiveUniform_Result_size_not_4);
2540COMPILE_ASSERT(offsetof(GetActiveUniform::Result, type) == 8,
2541               OffsetOf_GetActiveUniform_Result_type_not_8);
2542
2543struct GetAttachedShaders {
2544  typedef GetAttachedShaders ValueType;
2545  static const CommandId kCmdId = kGetAttachedShaders;
2546  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2547  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2548
2549  typedef SizedResult<GLuint> Result;
2550
2551  static uint32_t ComputeSize() {
2552    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2553  }
2554
2555  void SetHeader() { header.SetCmd<ValueType>(); }
2556
2557  void Init(GLuint _program,
2558            uint32_t _result_shm_id,
2559            uint32_t _result_shm_offset,
2560            uint32_t _result_size) {
2561    SetHeader();
2562    program = _program;
2563    result_shm_id = _result_shm_id;
2564    result_shm_offset = _result_shm_offset;
2565    result_size = _result_size;
2566  }
2567
2568  void* Set(void* cmd,
2569            GLuint _program,
2570            uint32_t _result_shm_id,
2571            uint32_t _result_shm_offset,
2572            uint32_t _result_size) {
2573    static_cast<ValueType*>(cmd)
2574        ->Init(_program, _result_shm_id, _result_shm_offset, _result_size);
2575    return NextCmdAddress<ValueType>(cmd);
2576  }
2577
2578  gpu::CommandHeader header;
2579  uint32_t program;
2580  uint32_t result_shm_id;
2581  uint32_t result_shm_offset;
2582  uint32_t result_size;
2583};
2584
2585COMPILE_ASSERT(sizeof(GetAttachedShaders) == 20,
2586               Sizeof_GetAttachedShaders_is_not_20);
2587COMPILE_ASSERT(offsetof(GetAttachedShaders, header) == 0,
2588               OffsetOf_GetAttachedShaders_header_not_0);
2589COMPILE_ASSERT(offsetof(GetAttachedShaders, program) == 4,
2590               OffsetOf_GetAttachedShaders_program_not_4);
2591COMPILE_ASSERT(offsetof(GetAttachedShaders, result_shm_id) == 8,
2592               OffsetOf_GetAttachedShaders_result_shm_id_not_8);
2593COMPILE_ASSERT(offsetof(GetAttachedShaders, result_shm_offset) == 12,
2594               OffsetOf_GetAttachedShaders_result_shm_offset_not_12);
2595COMPILE_ASSERT(offsetof(GetAttachedShaders, result_size) == 16,
2596               OffsetOf_GetAttachedShaders_result_size_not_16);
2597
2598struct GetAttribLocation {
2599  typedef GetAttribLocation ValueType;
2600  static const CommandId kCmdId = kGetAttribLocation;
2601  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2602  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2603
2604  typedef GLint Result;
2605
2606  static uint32_t ComputeSize() {
2607    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2608  }
2609
2610  void SetHeader() { header.SetCmd<ValueType>(); }
2611
2612  void Init(GLuint _program,
2613            uint32_t _name_bucket_id,
2614            uint32_t _location_shm_id,
2615            uint32_t _location_shm_offset) {
2616    SetHeader();
2617    program = _program;
2618    name_bucket_id = _name_bucket_id;
2619    location_shm_id = _location_shm_id;
2620    location_shm_offset = _location_shm_offset;
2621  }
2622
2623  void* Set(void* cmd,
2624            GLuint _program,
2625            uint32_t _name_bucket_id,
2626            uint32_t _location_shm_id,
2627            uint32_t _location_shm_offset) {
2628    static_cast<ValueType*>(cmd)->Init(
2629        _program, _name_bucket_id, _location_shm_id, _location_shm_offset);
2630    return NextCmdAddress<ValueType>(cmd);
2631  }
2632
2633  gpu::CommandHeader header;
2634  uint32_t program;
2635  uint32_t name_bucket_id;
2636  uint32_t location_shm_id;
2637  uint32_t location_shm_offset;
2638};
2639
2640COMPILE_ASSERT(sizeof(GetAttribLocation) == 20,
2641               Sizeof_GetAttribLocation_is_not_20);
2642COMPILE_ASSERT(offsetof(GetAttribLocation, header) == 0,
2643               OffsetOf_GetAttribLocation_header_not_0);
2644COMPILE_ASSERT(offsetof(GetAttribLocation, program) == 4,
2645               OffsetOf_GetAttribLocation_program_not_4);
2646COMPILE_ASSERT(offsetof(GetAttribLocation, name_bucket_id) == 8,
2647               OffsetOf_GetAttribLocation_name_bucket_id_not_8);
2648COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_id) == 12,
2649               OffsetOf_GetAttribLocation_location_shm_id_not_12);
2650COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_offset) == 16,
2651               OffsetOf_GetAttribLocation_location_shm_offset_not_16);
2652
2653struct GetBooleanv {
2654  typedef GetBooleanv ValueType;
2655  static const CommandId kCmdId = kGetBooleanv;
2656  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2657  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2658
2659  typedef SizedResult<GLboolean> Result;
2660
2661  static uint32_t ComputeSize() {
2662    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2663  }
2664
2665  void SetHeader() { header.SetCmd<ValueType>(); }
2666
2667  void Init(GLenum _pname,
2668            uint32_t _params_shm_id,
2669            uint32_t _params_shm_offset) {
2670    SetHeader();
2671    pname = _pname;
2672    params_shm_id = _params_shm_id;
2673    params_shm_offset = _params_shm_offset;
2674  }
2675
2676  void* Set(void* cmd,
2677            GLenum _pname,
2678            uint32_t _params_shm_id,
2679            uint32_t _params_shm_offset) {
2680    static_cast<ValueType*>(cmd)
2681        ->Init(_pname, _params_shm_id, _params_shm_offset);
2682    return NextCmdAddress<ValueType>(cmd);
2683  }
2684
2685  gpu::CommandHeader header;
2686  uint32_t pname;
2687  uint32_t params_shm_id;
2688  uint32_t params_shm_offset;
2689};
2690
2691COMPILE_ASSERT(sizeof(GetBooleanv) == 16, Sizeof_GetBooleanv_is_not_16);
2692COMPILE_ASSERT(offsetof(GetBooleanv, header) == 0,
2693               OffsetOf_GetBooleanv_header_not_0);
2694COMPILE_ASSERT(offsetof(GetBooleanv, pname) == 4,
2695               OffsetOf_GetBooleanv_pname_not_4);
2696COMPILE_ASSERT(offsetof(GetBooleanv, params_shm_id) == 8,
2697               OffsetOf_GetBooleanv_params_shm_id_not_8);
2698COMPILE_ASSERT(offsetof(GetBooleanv, params_shm_offset) == 12,
2699               OffsetOf_GetBooleanv_params_shm_offset_not_12);
2700
2701struct GetBufferParameteriv {
2702  typedef GetBufferParameteriv ValueType;
2703  static const CommandId kCmdId = kGetBufferParameteriv;
2704  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2705  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2706
2707  typedef SizedResult<GLint> Result;
2708
2709  static uint32_t ComputeSize() {
2710    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2711  }
2712
2713  void SetHeader() { header.SetCmd<ValueType>(); }
2714
2715  void Init(GLenum _target,
2716            GLenum _pname,
2717            uint32_t _params_shm_id,
2718            uint32_t _params_shm_offset) {
2719    SetHeader();
2720    target = _target;
2721    pname = _pname;
2722    params_shm_id = _params_shm_id;
2723    params_shm_offset = _params_shm_offset;
2724  }
2725
2726  void* Set(void* cmd,
2727            GLenum _target,
2728            GLenum _pname,
2729            uint32_t _params_shm_id,
2730            uint32_t _params_shm_offset) {
2731    static_cast<ValueType*>(cmd)
2732        ->Init(_target, _pname, _params_shm_id, _params_shm_offset);
2733    return NextCmdAddress<ValueType>(cmd);
2734  }
2735
2736  gpu::CommandHeader header;
2737  uint32_t target;
2738  uint32_t pname;
2739  uint32_t params_shm_id;
2740  uint32_t params_shm_offset;
2741};
2742
2743COMPILE_ASSERT(sizeof(GetBufferParameteriv) == 20,
2744               Sizeof_GetBufferParameteriv_is_not_20);
2745COMPILE_ASSERT(offsetof(GetBufferParameteriv, header) == 0,
2746               OffsetOf_GetBufferParameteriv_header_not_0);
2747COMPILE_ASSERT(offsetof(GetBufferParameteriv, target) == 4,
2748               OffsetOf_GetBufferParameteriv_target_not_4);
2749COMPILE_ASSERT(offsetof(GetBufferParameteriv, pname) == 8,
2750               OffsetOf_GetBufferParameteriv_pname_not_8);
2751COMPILE_ASSERT(offsetof(GetBufferParameteriv, params_shm_id) == 12,
2752               OffsetOf_GetBufferParameteriv_params_shm_id_not_12);
2753COMPILE_ASSERT(offsetof(GetBufferParameteriv, params_shm_offset) == 16,
2754               OffsetOf_GetBufferParameteriv_params_shm_offset_not_16);
2755
2756struct GetError {
2757  typedef GetError ValueType;
2758  static const CommandId kCmdId = kGetError;
2759  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2760  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2761
2762  typedef GLenum Result;
2763
2764  static uint32_t ComputeSize() {
2765    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2766  }
2767
2768  void SetHeader() { header.SetCmd<ValueType>(); }
2769
2770  void Init(uint32_t _result_shm_id, uint32_t _result_shm_offset) {
2771    SetHeader();
2772    result_shm_id = _result_shm_id;
2773    result_shm_offset = _result_shm_offset;
2774  }
2775
2776  void* Set(void* cmd, uint32_t _result_shm_id, uint32_t _result_shm_offset) {
2777    static_cast<ValueType*>(cmd)->Init(_result_shm_id, _result_shm_offset);
2778    return NextCmdAddress<ValueType>(cmd);
2779  }
2780
2781  gpu::CommandHeader header;
2782  uint32_t result_shm_id;
2783  uint32_t result_shm_offset;
2784};
2785
2786COMPILE_ASSERT(sizeof(GetError) == 12, Sizeof_GetError_is_not_12);
2787COMPILE_ASSERT(offsetof(GetError, header) == 0, OffsetOf_GetError_header_not_0);
2788COMPILE_ASSERT(offsetof(GetError, result_shm_id) == 4,
2789               OffsetOf_GetError_result_shm_id_not_4);
2790COMPILE_ASSERT(offsetof(GetError, result_shm_offset) == 8,
2791               OffsetOf_GetError_result_shm_offset_not_8);
2792
2793struct GetFloatv {
2794  typedef GetFloatv ValueType;
2795  static const CommandId kCmdId = kGetFloatv;
2796  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2797  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2798
2799  typedef SizedResult<GLfloat> Result;
2800
2801  static uint32_t ComputeSize() {
2802    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2803  }
2804
2805  void SetHeader() { header.SetCmd<ValueType>(); }
2806
2807  void Init(GLenum _pname,
2808            uint32_t _params_shm_id,
2809            uint32_t _params_shm_offset) {
2810    SetHeader();
2811    pname = _pname;
2812    params_shm_id = _params_shm_id;
2813    params_shm_offset = _params_shm_offset;
2814  }
2815
2816  void* Set(void* cmd,
2817            GLenum _pname,
2818            uint32_t _params_shm_id,
2819            uint32_t _params_shm_offset) {
2820    static_cast<ValueType*>(cmd)
2821        ->Init(_pname, _params_shm_id, _params_shm_offset);
2822    return NextCmdAddress<ValueType>(cmd);
2823  }
2824
2825  gpu::CommandHeader header;
2826  uint32_t pname;
2827  uint32_t params_shm_id;
2828  uint32_t params_shm_offset;
2829};
2830
2831COMPILE_ASSERT(sizeof(GetFloatv) == 16, Sizeof_GetFloatv_is_not_16);
2832COMPILE_ASSERT(offsetof(GetFloatv, header) == 0,
2833               OffsetOf_GetFloatv_header_not_0);
2834COMPILE_ASSERT(offsetof(GetFloatv, pname) == 4, OffsetOf_GetFloatv_pname_not_4);
2835COMPILE_ASSERT(offsetof(GetFloatv, params_shm_id) == 8,
2836               OffsetOf_GetFloatv_params_shm_id_not_8);
2837COMPILE_ASSERT(offsetof(GetFloatv, params_shm_offset) == 12,
2838               OffsetOf_GetFloatv_params_shm_offset_not_12);
2839
2840struct GetFramebufferAttachmentParameteriv {
2841  typedef GetFramebufferAttachmentParameteriv ValueType;
2842  static const CommandId kCmdId = kGetFramebufferAttachmentParameteriv;
2843  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2844  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2845
2846  typedef SizedResult<GLint> Result;
2847
2848  static uint32_t ComputeSize() {
2849    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2850  }
2851
2852  void SetHeader() { header.SetCmd<ValueType>(); }
2853
2854  void Init(GLenum _target,
2855            GLenum _attachment,
2856            GLenum _pname,
2857            uint32_t _params_shm_id,
2858            uint32_t _params_shm_offset) {
2859    SetHeader();
2860    target = _target;
2861    attachment = _attachment;
2862    pname = _pname;
2863    params_shm_id = _params_shm_id;
2864    params_shm_offset = _params_shm_offset;
2865  }
2866
2867  void* Set(void* cmd,
2868            GLenum _target,
2869            GLenum _attachment,
2870            GLenum _pname,
2871            uint32_t _params_shm_id,
2872            uint32_t _params_shm_offset) {
2873    static_cast<ValueType*>(cmd)->Init(
2874        _target, _attachment, _pname, _params_shm_id, _params_shm_offset);
2875    return NextCmdAddress<ValueType>(cmd);
2876  }
2877
2878  gpu::CommandHeader header;
2879  uint32_t target;
2880  uint32_t attachment;
2881  uint32_t pname;
2882  uint32_t params_shm_id;
2883  uint32_t params_shm_offset;
2884};
2885
2886COMPILE_ASSERT(sizeof(GetFramebufferAttachmentParameteriv) == 24,
2887               Sizeof_GetFramebufferAttachmentParameteriv_is_not_24);
2888COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, header) == 0,
2889               OffsetOf_GetFramebufferAttachmentParameteriv_header_not_0);
2890COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, target) == 4,
2891               OffsetOf_GetFramebufferAttachmentParameteriv_target_not_4);
2892COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, attachment) == 8,
2893               OffsetOf_GetFramebufferAttachmentParameteriv_attachment_not_8);
2894COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, pname) == 12,
2895               OffsetOf_GetFramebufferAttachmentParameteriv_pname_not_12);
2896COMPILE_ASSERT(
2897    offsetof(GetFramebufferAttachmentParameteriv, params_shm_id) == 16,
2898    OffsetOf_GetFramebufferAttachmentParameteriv_params_shm_id_not_16);
2899COMPILE_ASSERT(
2900    offsetof(GetFramebufferAttachmentParameteriv, params_shm_offset) == 20,
2901    OffsetOf_GetFramebufferAttachmentParameteriv_params_shm_offset_not_20);
2902
2903struct GetIntegerv {
2904  typedef GetIntegerv ValueType;
2905  static const CommandId kCmdId = kGetIntegerv;
2906  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2907  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2908
2909  typedef SizedResult<GLint> Result;
2910
2911  static uint32_t ComputeSize() {
2912    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2913  }
2914
2915  void SetHeader() { header.SetCmd<ValueType>(); }
2916
2917  void Init(GLenum _pname,
2918            uint32_t _params_shm_id,
2919            uint32_t _params_shm_offset) {
2920    SetHeader();
2921    pname = _pname;
2922    params_shm_id = _params_shm_id;
2923    params_shm_offset = _params_shm_offset;
2924  }
2925
2926  void* Set(void* cmd,
2927            GLenum _pname,
2928            uint32_t _params_shm_id,
2929            uint32_t _params_shm_offset) {
2930    static_cast<ValueType*>(cmd)
2931        ->Init(_pname, _params_shm_id, _params_shm_offset);
2932    return NextCmdAddress<ValueType>(cmd);
2933  }
2934
2935  gpu::CommandHeader header;
2936  uint32_t pname;
2937  uint32_t params_shm_id;
2938  uint32_t params_shm_offset;
2939};
2940
2941COMPILE_ASSERT(sizeof(GetIntegerv) == 16, Sizeof_GetIntegerv_is_not_16);
2942COMPILE_ASSERT(offsetof(GetIntegerv, header) == 0,
2943               OffsetOf_GetIntegerv_header_not_0);
2944COMPILE_ASSERT(offsetof(GetIntegerv, pname) == 4,
2945               OffsetOf_GetIntegerv_pname_not_4);
2946COMPILE_ASSERT(offsetof(GetIntegerv, params_shm_id) == 8,
2947               OffsetOf_GetIntegerv_params_shm_id_not_8);
2948COMPILE_ASSERT(offsetof(GetIntegerv, params_shm_offset) == 12,
2949               OffsetOf_GetIntegerv_params_shm_offset_not_12);
2950
2951struct GetProgramiv {
2952  typedef GetProgramiv ValueType;
2953  static const CommandId kCmdId = kGetProgramiv;
2954  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
2955  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
2956
2957  typedef SizedResult<GLint> Result;
2958
2959  static uint32_t ComputeSize() {
2960    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
2961  }
2962
2963  void SetHeader() { header.SetCmd<ValueType>(); }
2964
2965  void Init(GLuint _program,
2966            GLenum _pname,
2967            uint32_t _params_shm_id,
2968            uint32_t _params_shm_offset) {
2969    SetHeader();
2970    program = _program;
2971    pname = _pname;
2972    params_shm_id = _params_shm_id;
2973    params_shm_offset = _params_shm_offset;
2974  }
2975
2976  void* Set(void* cmd,
2977            GLuint _program,
2978            GLenum _pname,
2979            uint32_t _params_shm_id,
2980            uint32_t _params_shm_offset) {
2981    static_cast<ValueType*>(cmd)
2982        ->Init(_program, _pname, _params_shm_id, _params_shm_offset);
2983    return NextCmdAddress<ValueType>(cmd);
2984  }
2985
2986  gpu::CommandHeader header;
2987  uint32_t program;
2988  uint32_t pname;
2989  uint32_t params_shm_id;
2990  uint32_t params_shm_offset;
2991};
2992
2993COMPILE_ASSERT(sizeof(GetProgramiv) == 20, Sizeof_GetProgramiv_is_not_20);
2994COMPILE_ASSERT(offsetof(GetProgramiv, header) == 0,
2995               OffsetOf_GetProgramiv_header_not_0);
2996COMPILE_ASSERT(offsetof(GetProgramiv, program) == 4,
2997               OffsetOf_GetProgramiv_program_not_4);
2998COMPILE_ASSERT(offsetof(GetProgramiv, pname) == 8,
2999               OffsetOf_GetProgramiv_pname_not_8);
3000COMPILE_ASSERT(offsetof(GetProgramiv, params_shm_id) == 12,
3001               OffsetOf_GetProgramiv_params_shm_id_not_12);
3002COMPILE_ASSERT(offsetof(GetProgramiv, params_shm_offset) == 16,
3003               OffsetOf_GetProgramiv_params_shm_offset_not_16);
3004
3005struct GetProgramInfoLog {
3006  typedef GetProgramInfoLog ValueType;
3007  static const CommandId kCmdId = kGetProgramInfoLog;
3008  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3009  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3010
3011  static uint32_t ComputeSize() {
3012    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3013  }
3014
3015  void SetHeader() { header.SetCmd<ValueType>(); }
3016
3017  void Init(GLuint _program, uint32_t _bucket_id) {
3018    SetHeader();
3019    program = _program;
3020    bucket_id = _bucket_id;
3021  }
3022
3023  void* Set(void* cmd, GLuint _program, uint32_t _bucket_id) {
3024    static_cast<ValueType*>(cmd)->Init(_program, _bucket_id);
3025    return NextCmdAddress<ValueType>(cmd);
3026  }
3027
3028  gpu::CommandHeader header;
3029  uint32_t program;
3030  uint32_t bucket_id;
3031};
3032
3033COMPILE_ASSERT(sizeof(GetProgramInfoLog) == 12,
3034               Sizeof_GetProgramInfoLog_is_not_12);
3035COMPILE_ASSERT(offsetof(GetProgramInfoLog, header) == 0,
3036               OffsetOf_GetProgramInfoLog_header_not_0);
3037COMPILE_ASSERT(offsetof(GetProgramInfoLog, program) == 4,
3038               OffsetOf_GetProgramInfoLog_program_not_4);
3039COMPILE_ASSERT(offsetof(GetProgramInfoLog, bucket_id) == 8,
3040               OffsetOf_GetProgramInfoLog_bucket_id_not_8);
3041
3042struct GetRenderbufferParameteriv {
3043  typedef GetRenderbufferParameteriv ValueType;
3044  static const CommandId kCmdId = kGetRenderbufferParameteriv;
3045  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3046  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3047
3048  typedef SizedResult<GLint> Result;
3049
3050  static uint32_t ComputeSize() {
3051    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3052  }
3053
3054  void SetHeader() { header.SetCmd<ValueType>(); }
3055
3056  void Init(GLenum _target,
3057            GLenum _pname,
3058            uint32_t _params_shm_id,
3059            uint32_t _params_shm_offset) {
3060    SetHeader();
3061    target = _target;
3062    pname = _pname;
3063    params_shm_id = _params_shm_id;
3064    params_shm_offset = _params_shm_offset;
3065  }
3066
3067  void* Set(void* cmd,
3068            GLenum _target,
3069            GLenum _pname,
3070            uint32_t _params_shm_id,
3071            uint32_t _params_shm_offset) {
3072    static_cast<ValueType*>(cmd)
3073        ->Init(_target, _pname, _params_shm_id, _params_shm_offset);
3074    return NextCmdAddress<ValueType>(cmd);
3075  }
3076
3077  gpu::CommandHeader header;
3078  uint32_t target;
3079  uint32_t pname;
3080  uint32_t params_shm_id;
3081  uint32_t params_shm_offset;
3082};
3083
3084COMPILE_ASSERT(sizeof(GetRenderbufferParameteriv) == 20,
3085               Sizeof_GetRenderbufferParameteriv_is_not_20);
3086COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, header) == 0,
3087               OffsetOf_GetRenderbufferParameteriv_header_not_0);
3088COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, target) == 4,
3089               OffsetOf_GetRenderbufferParameteriv_target_not_4);
3090COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, pname) == 8,
3091               OffsetOf_GetRenderbufferParameteriv_pname_not_8);
3092COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, params_shm_id) == 12,
3093               OffsetOf_GetRenderbufferParameteriv_params_shm_id_not_12);
3094COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, params_shm_offset) == 16,
3095               OffsetOf_GetRenderbufferParameteriv_params_shm_offset_not_16);
3096
3097struct GetShaderiv {
3098  typedef GetShaderiv ValueType;
3099  static const CommandId kCmdId = kGetShaderiv;
3100  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3101  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3102
3103  typedef SizedResult<GLint> Result;
3104
3105  static uint32_t ComputeSize() {
3106    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3107  }
3108
3109  void SetHeader() { header.SetCmd<ValueType>(); }
3110
3111  void Init(GLuint _shader,
3112            GLenum _pname,
3113            uint32_t _params_shm_id,
3114            uint32_t _params_shm_offset) {
3115    SetHeader();
3116    shader = _shader;
3117    pname = _pname;
3118    params_shm_id = _params_shm_id;
3119    params_shm_offset = _params_shm_offset;
3120  }
3121
3122  void* Set(void* cmd,
3123            GLuint _shader,
3124            GLenum _pname,
3125            uint32_t _params_shm_id,
3126            uint32_t _params_shm_offset) {
3127    static_cast<ValueType*>(cmd)
3128        ->Init(_shader, _pname, _params_shm_id, _params_shm_offset);
3129    return NextCmdAddress<ValueType>(cmd);
3130  }
3131
3132  gpu::CommandHeader header;
3133  uint32_t shader;
3134  uint32_t pname;
3135  uint32_t params_shm_id;
3136  uint32_t params_shm_offset;
3137};
3138
3139COMPILE_ASSERT(sizeof(GetShaderiv) == 20, Sizeof_GetShaderiv_is_not_20);
3140COMPILE_ASSERT(offsetof(GetShaderiv, header) == 0,
3141               OffsetOf_GetShaderiv_header_not_0);
3142COMPILE_ASSERT(offsetof(GetShaderiv, shader) == 4,
3143               OffsetOf_GetShaderiv_shader_not_4);
3144COMPILE_ASSERT(offsetof(GetShaderiv, pname) == 8,
3145               OffsetOf_GetShaderiv_pname_not_8);
3146COMPILE_ASSERT(offsetof(GetShaderiv, params_shm_id) == 12,
3147               OffsetOf_GetShaderiv_params_shm_id_not_12);
3148COMPILE_ASSERT(offsetof(GetShaderiv, params_shm_offset) == 16,
3149               OffsetOf_GetShaderiv_params_shm_offset_not_16);
3150
3151struct GetShaderInfoLog {
3152  typedef GetShaderInfoLog ValueType;
3153  static const CommandId kCmdId = kGetShaderInfoLog;
3154  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3155  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3156
3157  static uint32_t ComputeSize() {
3158    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3159  }
3160
3161  void SetHeader() { header.SetCmd<ValueType>(); }
3162
3163  void Init(GLuint _shader, uint32_t _bucket_id) {
3164    SetHeader();
3165    shader = _shader;
3166    bucket_id = _bucket_id;
3167  }
3168
3169  void* Set(void* cmd, GLuint _shader, uint32_t _bucket_id) {
3170    static_cast<ValueType*>(cmd)->Init(_shader, _bucket_id);
3171    return NextCmdAddress<ValueType>(cmd);
3172  }
3173
3174  gpu::CommandHeader header;
3175  uint32_t shader;
3176  uint32_t bucket_id;
3177};
3178
3179COMPILE_ASSERT(sizeof(GetShaderInfoLog) == 12,
3180               Sizeof_GetShaderInfoLog_is_not_12);
3181COMPILE_ASSERT(offsetof(GetShaderInfoLog, header) == 0,
3182               OffsetOf_GetShaderInfoLog_header_not_0);
3183COMPILE_ASSERT(offsetof(GetShaderInfoLog, shader) == 4,
3184               OffsetOf_GetShaderInfoLog_shader_not_4);
3185COMPILE_ASSERT(offsetof(GetShaderInfoLog, bucket_id) == 8,
3186               OffsetOf_GetShaderInfoLog_bucket_id_not_8);
3187
3188struct GetShaderPrecisionFormat {
3189  typedef GetShaderPrecisionFormat ValueType;
3190  static const CommandId kCmdId = kGetShaderPrecisionFormat;
3191  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3192  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3193
3194  struct Result {
3195    int32_t success;
3196    int32_t min_range;
3197    int32_t max_range;
3198    int32_t precision;
3199  };
3200
3201  static uint32_t ComputeSize() {
3202    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3203  }
3204
3205  void SetHeader() { header.SetCmd<ValueType>(); }
3206
3207  void Init(GLenum _shadertype,
3208            GLenum _precisiontype,
3209            uint32_t _result_shm_id,
3210            uint32_t _result_shm_offset) {
3211    SetHeader();
3212    shadertype = _shadertype;
3213    precisiontype = _precisiontype;
3214    result_shm_id = _result_shm_id;
3215    result_shm_offset = _result_shm_offset;
3216  }
3217
3218  void* Set(void* cmd,
3219            GLenum _shadertype,
3220            GLenum _precisiontype,
3221            uint32_t _result_shm_id,
3222            uint32_t _result_shm_offset) {
3223    static_cast<ValueType*>(cmd)
3224        ->Init(_shadertype, _precisiontype, _result_shm_id, _result_shm_offset);
3225    return NextCmdAddress<ValueType>(cmd);
3226  }
3227
3228  gpu::CommandHeader header;
3229  uint32_t shadertype;
3230  uint32_t precisiontype;
3231  uint32_t result_shm_id;
3232  uint32_t result_shm_offset;
3233};
3234
3235COMPILE_ASSERT(sizeof(GetShaderPrecisionFormat) == 20,
3236               Sizeof_GetShaderPrecisionFormat_is_not_20);
3237COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, header) == 0,
3238               OffsetOf_GetShaderPrecisionFormat_header_not_0);
3239COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, shadertype) == 4,
3240               OffsetOf_GetShaderPrecisionFormat_shadertype_not_4);
3241COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, precisiontype) == 8,
3242               OffsetOf_GetShaderPrecisionFormat_precisiontype_not_8);
3243COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, result_shm_id) == 12,
3244               OffsetOf_GetShaderPrecisionFormat_result_shm_id_not_12);
3245COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, result_shm_offset) == 16,
3246               OffsetOf_GetShaderPrecisionFormat_result_shm_offset_not_16);
3247COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, success) == 0,
3248               OffsetOf_GetShaderPrecisionFormat_Result_success_not_0);
3249COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, min_range) == 4,
3250               OffsetOf_GetShaderPrecisionFormat_Result_min_range_not_4);
3251COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, max_range) == 8,
3252               OffsetOf_GetShaderPrecisionFormat_Result_max_range_not_8);
3253COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, precision) == 12,
3254               OffsetOf_GetShaderPrecisionFormat_Result_precision_not_12);
3255
3256struct GetShaderSource {
3257  typedef GetShaderSource ValueType;
3258  static const CommandId kCmdId = kGetShaderSource;
3259  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3260  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3261
3262  static uint32_t ComputeSize() {
3263    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3264  }
3265
3266  void SetHeader() { header.SetCmd<ValueType>(); }
3267
3268  void Init(GLuint _shader, uint32_t _bucket_id) {
3269    SetHeader();
3270    shader = _shader;
3271    bucket_id = _bucket_id;
3272  }
3273
3274  void* Set(void* cmd, GLuint _shader, uint32_t _bucket_id) {
3275    static_cast<ValueType*>(cmd)->Init(_shader, _bucket_id);
3276    return NextCmdAddress<ValueType>(cmd);
3277  }
3278
3279  gpu::CommandHeader header;
3280  uint32_t shader;
3281  uint32_t bucket_id;
3282};
3283
3284COMPILE_ASSERT(sizeof(GetShaderSource) == 12, Sizeof_GetShaderSource_is_not_12);
3285COMPILE_ASSERT(offsetof(GetShaderSource, header) == 0,
3286               OffsetOf_GetShaderSource_header_not_0);
3287COMPILE_ASSERT(offsetof(GetShaderSource, shader) == 4,
3288               OffsetOf_GetShaderSource_shader_not_4);
3289COMPILE_ASSERT(offsetof(GetShaderSource, bucket_id) == 8,
3290               OffsetOf_GetShaderSource_bucket_id_not_8);
3291
3292struct GetString {
3293  typedef GetString ValueType;
3294  static const CommandId kCmdId = kGetString;
3295  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3296  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3297
3298  static uint32_t ComputeSize() {
3299    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3300  }
3301
3302  void SetHeader() { header.SetCmd<ValueType>(); }
3303
3304  void Init(GLenum _name, uint32_t _bucket_id) {
3305    SetHeader();
3306    name = _name;
3307    bucket_id = _bucket_id;
3308  }
3309
3310  void* Set(void* cmd, GLenum _name, uint32_t _bucket_id) {
3311    static_cast<ValueType*>(cmd)->Init(_name, _bucket_id);
3312    return NextCmdAddress<ValueType>(cmd);
3313  }
3314
3315  gpu::CommandHeader header;
3316  uint32_t name;
3317  uint32_t bucket_id;
3318};
3319
3320COMPILE_ASSERT(sizeof(GetString) == 12, Sizeof_GetString_is_not_12);
3321COMPILE_ASSERT(offsetof(GetString, header) == 0,
3322               OffsetOf_GetString_header_not_0);
3323COMPILE_ASSERT(offsetof(GetString, name) == 4, OffsetOf_GetString_name_not_4);
3324COMPILE_ASSERT(offsetof(GetString, bucket_id) == 8,
3325               OffsetOf_GetString_bucket_id_not_8);
3326
3327struct GetTexParameterfv {
3328  typedef GetTexParameterfv ValueType;
3329  static const CommandId kCmdId = kGetTexParameterfv;
3330  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3331  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3332
3333  typedef SizedResult<GLfloat> Result;
3334
3335  static uint32_t ComputeSize() {
3336    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3337  }
3338
3339  void SetHeader() { header.SetCmd<ValueType>(); }
3340
3341  void Init(GLenum _target,
3342            GLenum _pname,
3343            uint32_t _params_shm_id,
3344            uint32_t _params_shm_offset) {
3345    SetHeader();
3346    target = _target;
3347    pname = _pname;
3348    params_shm_id = _params_shm_id;
3349    params_shm_offset = _params_shm_offset;
3350  }
3351
3352  void* Set(void* cmd,
3353            GLenum _target,
3354            GLenum _pname,
3355            uint32_t _params_shm_id,
3356            uint32_t _params_shm_offset) {
3357    static_cast<ValueType*>(cmd)
3358        ->Init(_target, _pname, _params_shm_id, _params_shm_offset);
3359    return NextCmdAddress<ValueType>(cmd);
3360  }
3361
3362  gpu::CommandHeader header;
3363  uint32_t target;
3364  uint32_t pname;
3365  uint32_t params_shm_id;
3366  uint32_t params_shm_offset;
3367};
3368
3369COMPILE_ASSERT(sizeof(GetTexParameterfv) == 20,
3370               Sizeof_GetTexParameterfv_is_not_20);
3371COMPILE_ASSERT(offsetof(GetTexParameterfv, header) == 0,
3372               OffsetOf_GetTexParameterfv_header_not_0);
3373COMPILE_ASSERT(offsetof(GetTexParameterfv, target) == 4,
3374               OffsetOf_GetTexParameterfv_target_not_4);
3375COMPILE_ASSERT(offsetof(GetTexParameterfv, pname) == 8,
3376               OffsetOf_GetTexParameterfv_pname_not_8);
3377COMPILE_ASSERT(offsetof(GetTexParameterfv, params_shm_id) == 12,
3378               OffsetOf_GetTexParameterfv_params_shm_id_not_12);
3379COMPILE_ASSERT(offsetof(GetTexParameterfv, params_shm_offset) == 16,
3380               OffsetOf_GetTexParameterfv_params_shm_offset_not_16);
3381
3382struct GetTexParameteriv {
3383  typedef GetTexParameteriv ValueType;
3384  static const CommandId kCmdId = kGetTexParameteriv;
3385  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3386  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3387
3388  typedef SizedResult<GLint> Result;
3389
3390  static uint32_t ComputeSize() {
3391    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3392  }
3393
3394  void SetHeader() { header.SetCmd<ValueType>(); }
3395
3396  void Init(GLenum _target,
3397            GLenum _pname,
3398            uint32_t _params_shm_id,
3399            uint32_t _params_shm_offset) {
3400    SetHeader();
3401    target = _target;
3402    pname = _pname;
3403    params_shm_id = _params_shm_id;
3404    params_shm_offset = _params_shm_offset;
3405  }
3406
3407  void* Set(void* cmd,
3408            GLenum _target,
3409            GLenum _pname,
3410            uint32_t _params_shm_id,
3411            uint32_t _params_shm_offset) {
3412    static_cast<ValueType*>(cmd)
3413        ->Init(_target, _pname, _params_shm_id, _params_shm_offset);
3414    return NextCmdAddress<ValueType>(cmd);
3415  }
3416
3417  gpu::CommandHeader header;
3418  uint32_t target;
3419  uint32_t pname;
3420  uint32_t params_shm_id;
3421  uint32_t params_shm_offset;
3422};
3423
3424COMPILE_ASSERT(sizeof(GetTexParameteriv) == 20,
3425               Sizeof_GetTexParameteriv_is_not_20);
3426COMPILE_ASSERT(offsetof(GetTexParameteriv, header) == 0,
3427               OffsetOf_GetTexParameteriv_header_not_0);
3428COMPILE_ASSERT(offsetof(GetTexParameteriv, target) == 4,
3429               OffsetOf_GetTexParameteriv_target_not_4);
3430COMPILE_ASSERT(offsetof(GetTexParameteriv, pname) == 8,
3431               OffsetOf_GetTexParameteriv_pname_not_8);
3432COMPILE_ASSERT(offsetof(GetTexParameteriv, params_shm_id) == 12,
3433               OffsetOf_GetTexParameteriv_params_shm_id_not_12);
3434COMPILE_ASSERT(offsetof(GetTexParameteriv, params_shm_offset) == 16,
3435               OffsetOf_GetTexParameteriv_params_shm_offset_not_16);
3436
3437struct GetUniformfv {
3438  typedef GetUniformfv ValueType;
3439  static const CommandId kCmdId = kGetUniformfv;
3440  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3441  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3442
3443  typedef SizedResult<GLfloat> Result;
3444
3445  static uint32_t ComputeSize() {
3446    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3447  }
3448
3449  void SetHeader() { header.SetCmd<ValueType>(); }
3450
3451  void Init(GLuint _program,
3452            GLint _location,
3453            uint32_t _params_shm_id,
3454            uint32_t _params_shm_offset) {
3455    SetHeader();
3456    program = _program;
3457    location = _location;
3458    params_shm_id = _params_shm_id;
3459    params_shm_offset = _params_shm_offset;
3460  }
3461
3462  void* Set(void* cmd,
3463            GLuint _program,
3464            GLint _location,
3465            uint32_t _params_shm_id,
3466            uint32_t _params_shm_offset) {
3467    static_cast<ValueType*>(cmd)
3468        ->Init(_program, _location, _params_shm_id, _params_shm_offset);
3469    return NextCmdAddress<ValueType>(cmd);
3470  }
3471
3472  gpu::CommandHeader header;
3473  uint32_t program;
3474  int32_t location;
3475  uint32_t params_shm_id;
3476  uint32_t params_shm_offset;
3477};
3478
3479COMPILE_ASSERT(sizeof(GetUniformfv) == 20, Sizeof_GetUniformfv_is_not_20);
3480COMPILE_ASSERT(offsetof(GetUniformfv, header) == 0,
3481               OffsetOf_GetUniformfv_header_not_0);
3482COMPILE_ASSERT(offsetof(GetUniformfv, program) == 4,
3483               OffsetOf_GetUniformfv_program_not_4);
3484COMPILE_ASSERT(offsetof(GetUniformfv, location) == 8,
3485               OffsetOf_GetUniformfv_location_not_8);
3486COMPILE_ASSERT(offsetof(GetUniformfv, params_shm_id) == 12,
3487               OffsetOf_GetUniformfv_params_shm_id_not_12);
3488COMPILE_ASSERT(offsetof(GetUniformfv, params_shm_offset) == 16,
3489               OffsetOf_GetUniformfv_params_shm_offset_not_16);
3490
3491struct GetUniformiv {
3492  typedef GetUniformiv ValueType;
3493  static const CommandId kCmdId = kGetUniformiv;
3494  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3495  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3496
3497  typedef SizedResult<GLint> Result;
3498
3499  static uint32_t ComputeSize() {
3500    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3501  }
3502
3503  void SetHeader() { header.SetCmd<ValueType>(); }
3504
3505  void Init(GLuint _program,
3506            GLint _location,
3507            uint32_t _params_shm_id,
3508            uint32_t _params_shm_offset) {
3509    SetHeader();
3510    program = _program;
3511    location = _location;
3512    params_shm_id = _params_shm_id;
3513    params_shm_offset = _params_shm_offset;
3514  }
3515
3516  void* Set(void* cmd,
3517            GLuint _program,
3518            GLint _location,
3519            uint32_t _params_shm_id,
3520            uint32_t _params_shm_offset) {
3521    static_cast<ValueType*>(cmd)
3522        ->Init(_program, _location, _params_shm_id, _params_shm_offset);
3523    return NextCmdAddress<ValueType>(cmd);
3524  }
3525
3526  gpu::CommandHeader header;
3527  uint32_t program;
3528  int32_t location;
3529  uint32_t params_shm_id;
3530  uint32_t params_shm_offset;
3531};
3532
3533COMPILE_ASSERT(sizeof(GetUniformiv) == 20, Sizeof_GetUniformiv_is_not_20);
3534COMPILE_ASSERT(offsetof(GetUniformiv, header) == 0,
3535               OffsetOf_GetUniformiv_header_not_0);
3536COMPILE_ASSERT(offsetof(GetUniformiv, program) == 4,
3537               OffsetOf_GetUniformiv_program_not_4);
3538COMPILE_ASSERT(offsetof(GetUniformiv, location) == 8,
3539               OffsetOf_GetUniformiv_location_not_8);
3540COMPILE_ASSERT(offsetof(GetUniformiv, params_shm_id) == 12,
3541               OffsetOf_GetUniformiv_params_shm_id_not_12);
3542COMPILE_ASSERT(offsetof(GetUniformiv, params_shm_offset) == 16,
3543               OffsetOf_GetUniformiv_params_shm_offset_not_16);
3544
3545struct GetUniformLocation {
3546  typedef GetUniformLocation ValueType;
3547  static const CommandId kCmdId = kGetUniformLocation;
3548  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3549  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3550
3551  typedef GLint Result;
3552
3553  static uint32_t ComputeSize() {
3554    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3555  }
3556
3557  void SetHeader() { header.SetCmd<ValueType>(); }
3558
3559  void Init(GLuint _program,
3560            uint32_t _name_bucket_id,
3561            uint32_t _location_shm_id,
3562            uint32_t _location_shm_offset) {
3563    SetHeader();
3564    program = _program;
3565    name_bucket_id = _name_bucket_id;
3566    location_shm_id = _location_shm_id;
3567    location_shm_offset = _location_shm_offset;
3568  }
3569
3570  void* Set(void* cmd,
3571            GLuint _program,
3572            uint32_t _name_bucket_id,
3573            uint32_t _location_shm_id,
3574            uint32_t _location_shm_offset) {
3575    static_cast<ValueType*>(cmd)->Init(
3576        _program, _name_bucket_id, _location_shm_id, _location_shm_offset);
3577    return NextCmdAddress<ValueType>(cmd);
3578  }
3579
3580  gpu::CommandHeader header;
3581  uint32_t program;
3582  uint32_t name_bucket_id;
3583  uint32_t location_shm_id;
3584  uint32_t location_shm_offset;
3585};
3586
3587COMPILE_ASSERT(sizeof(GetUniformLocation) == 20,
3588               Sizeof_GetUniformLocation_is_not_20);
3589COMPILE_ASSERT(offsetof(GetUniformLocation, header) == 0,
3590               OffsetOf_GetUniformLocation_header_not_0);
3591COMPILE_ASSERT(offsetof(GetUniformLocation, program) == 4,
3592               OffsetOf_GetUniformLocation_program_not_4);
3593COMPILE_ASSERT(offsetof(GetUniformLocation, name_bucket_id) == 8,
3594               OffsetOf_GetUniformLocation_name_bucket_id_not_8);
3595COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_id) == 12,
3596               OffsetOf_GetUniformLocation_location_shm_id_not_12);
3597COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_offset) == 16,
3598               OffsetOf_GetUniformLocation_location_shm_offset_not_16);
3599
3600struct GetVertexAttribfv {
3601  typedef GetVertexAttribfv ValueType;
3602  static const CommandId kCmdId = kGetVertexAttribfv;
3603  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3604  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3605
3606  typedef SizedResult<GLfloat> Result;
3607
3608  static uint32_t ComputeSize() {
3609    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3610  }
3611
3612  void SetHeader() { header.SetCmd<ValueType>(); }
3613
3614  void Init(GLuint _index,
3615            GLenum _pname,
3616            uint32_t _params_shm_id,
3617            uint32_t _params_shm_offset) {
3618    SetHeader();
3619    index = _index;
3620    pname = _pname;
3621    params_shm_id = _params_shm_id;
3622    params_shm_offset = _params_shm_offset;
3623  }
3624
3625  void* Set(void* cmd,
3626            GLuint _index,
3627            GLenum _pname,
3628            uint32_t _params_shm_id,
3629            uint32_t _params_shm_offset) {
3630    static_cast<ValueType*>(cmd)
3631        ->Init(_index, _pname, _params_shm_id, _params_shm_offset);
3632    return NextCmdAddress<ValueType>(cmd);
3633  }
3634
3635  gpu::CommandHeader header;
3636  uint32_t index;
3637  uint32_t pname;
3638  uint32_t params_shm_id;
3639  uint32_t params_shm_offset;
3640};
3641
3642COMPILE_ASSERT(sizeof(GetVertexAttribfv) == 20,
3643               Sizeof_GetVertexAttribfv_is_not_20);
3644COMPILE_ASSERT(offsetof(GetVertexAttribfv, header) == 0,
3645               OffsetOf_GetVertexAttribfv_header_not_0);
3646COMPILE_ASSERT(offsetof(GetVertexAttribfv, index) == 4,
3647               OffsetOf_GetVertexAttribfv_index_not_4);
3648COMPILE_ASSERT(offsetof(GetVertexAttribfv, pname) == 8,
3649               OffsetOf_GetVertexAttribfv_pname_not_8);
3650COMPILE_ASSERT(offsetof(GetVertexAttribfv, params_shm_id) == 12,
3651               OffsetOf_GetVertexAttribfv_params_shm_id_not_12);
3652COMPILE_ASSERT(offsetof(GetVertexAttribfv, params_shm_offset) == 16,
3653               OffsetOf_GetVertexAttribfv_params_shm_offset_not_16);
3654
3655struct GetVertexAttribiv {
3656  typedef GetVertexAttribiv ValueType;
3657  static const CommandId kCmdId = kGetVertexAttribiv;
3658  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3659  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3660
3661  typedef SizedResult<GLint> Result;
3662
3663  static uint32_t ComputeSize() {
3664    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3665  }
3666
3667  void SetHeader() { header.SetCmd<ValueType>(); }
3668
3669  void Init(GLuint _index,
3670            GLenum _pname,
3671            uint32_t _params_shm_id,
3672            uint32_t _params_shm_offset) {
3673    SetHeader();
3674    index = _index;
3675    pname = _pname;
3676    params_shm_id = _params_shm_id;
3677    params_shm_offset = _params_shm_offset;
3678  }
3679
3680  void* Set(void* cmd,
3681            GLuint _index,
3682            GLenum _pname,
3683            uint32_t _params_shm_id,
3684            uint32_t _params_shm_offset) {
3685    static_cast<ValueType*>(cmd)
3686        ->Init(_index, _pname, _params_shm_id, _params_shm_offset);
3687    return NextCmdAddress<ValueType>(cmd);
3688  }
3689
3690  gpu::CommandHeader header;
3691  uint32_t index;
3692  uint32_t pname;
3693  uint32_t params_shm_id;
3694  uint32_t params_shm_offset;
3695};
3696
3697COMPILE_ASSERT(sizeof(GetVertexAttribiv) == 20,
3698               Sizeof_GetVertexAttribiv_is_not_20);
3699COMPILE_ASSERT(offsetof(GetVertexAttribiv, header) == 0,
3700               OffsetOf_GetVertexAttribiv_header_not_0);
3701COMPILE_ASSERT(offsetof(GetVertexAttribiv, index) == 4,
3702               OffsetOf_GetVertexAttribiv_index_not_4);
3703COMPILE_ASSERT(offsetof(GetVertexAttribiv, pname) == 8,
3704               OffsetOf_GetVertexAttribiv_pname_not_8);
3705COMPILE_ASSERT(offsetof(GetVertexAttribiv, params_shm_id) == 12,
3706               OffsetOf_GetVertexAttribiv_params_shm_id_not_12);
3707COMPILE_ASSERT(offsetof(GetVertexAttribiv, params_shm_offset) == 16,
3708               OffsetOf_GetVertexAttribiv_params_shm_offset_not_16);
3709
3710struct GetVertexAttribPointerv {
3711  typedef GetVertexAttribPointerv ValueType;
3712  static const CommandId kCmdId = kGetVertexAttribPointerv;
3713  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3714  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3715
3716  typedef SizedResult<GLuint> Result;
3717
3718  static uint32_t ComputeSize() {
3719    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3720  }
3721
3722  void SetHeader() { header.SetCmd<ValueType>(); }
3723
3724  void Init(GLuint _index,
3725            GLenum _pname,
3726            uint32_t _pointer_shm_id,
3727            uint32_t _pointer_shm_offset) {
3728    SetHeader();
3729    index = _index;
3730    pname = _pname;
3731    pointer_shm_id = _pointer_shm_id;
3732    pointer_shm_offset = _pointer_shm_offset;
3733  }
3734
3735  void* Set(void* cmd,
3736            GLuint _index,
3737            GLenum _pname,
3738            uint32_t _pointer_shm_id,
3739            uint32_t _pointer_shm_offset) {
3740    static_cast<ValueType*>(cmd)
3741        ->Init(_index, _pname, _pointer_shm_id, _pointer_shm_offset);
3742    return NextCmdAddress<ValueType>(cmd);
3743  }
3744
3745  gpu::CommandHeader header;
3746  uint32_t index;
3747  uint32_t pname;
3748  uint32_t pointer_shm_id;
3749  uint32_t pointer_shm_offset;
3750};
3751
3752COMPILE_ASSERT(sizeof(GetVertexAttribPointerv) == 20,
3753               Sizeof_GetVertexAttribPointerv_is_not_20);
3754COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, header) == 0,
3755               OffsetOf_GetVertexAttribPointerv_header_not_0);
3756COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, index) == 4,
3757               OffsetOf_GetVertexAttribPointerv_index_not_4);
3758COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, pname) == 8,
3759               OffsetOf_GetVertexAttribPointerv_pname_not_8);
3760COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, pointer_shm_id) == 12,
3761               OffsetOf_GetVertexAttribPointerv_pointer_shm_id_not_12);
3762COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, pointer_shm_offset) == 16,
3763               OffsetOf_GetVertexAttribPointerv_pointer_shm_offset_not_16);
3764
3765struct Hint {
3766  typedef Hint ValueType;
3767  static const CommandId kCmdId = kHint;
3768  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3769  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3770
3771  static uint32_t ComputeSize() {
3772    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3773  }
3774
3775  void SetHeader() { header.SetCmd<ValueType>(); }
3776
3777  void Init(GLenum _target, GLenum _mode) {
3778    SetHeader();
3779    target = _target;
3780    mode = _mode;
3781  }
3782
3783  void* Set(void* cmd, GLenum _target, GLenum _mode) {
3784    static_cast<ValueType*>(cmd)->Init(_target, _mode);
3785    return NextCmdAddress<ValueType>(cmd);
3786  }
3787
3788  gpu::CommandHeader header;
3789  uint32_t target;
3790  uint32_t mode;
3791};
3792
3793COMPILE_ASSERT(sizeof(Hint) == 12, Sizeof_Hint_is_not_12);
3794COMPILE_ASSERT(offsetof(Hint, header) == 0, OffsetOf_Hint_header_not_0);
3795COMPILE_ASSERT(offsetof(Hint, target) == 4, OffsetOf_Hint_target_not_4);
3796COMPILE_ASSERT(offsetof(Hint, mode) == 8, OffsetOf_Hint_mode_not_8);
3797
3798struct IsBuffer {
3799  typedef IsBuffer ValueType;
3800  static const CommandId kCmdId = kIsBuffer;
3801  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3802  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3803
3804  typedef uint32_t Result;
3805
3806  static uint32_t ComputeSize() {
3807    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3808  }
3809
3810  void SetHeader() { header.SetCmd<ValueType>(); }
3811
3812  void Init(GLuint _buffer,
3813            uint32_t _result_shm_id,
3814            uint32_t _result_shm_offset) {
3815    SetHeader();
3816    buffer = _buffer;
3817    result_shm_id = _result_shm_id;
3818    result_shm_offset = _result_shm_offset;
3819  }
3820
3821  void* Set(void* cmd,
3822            GLuint _buffer,
3823            uint32_t _result_shm_id,
3824            uint32_t _result_shm_offset) {
3825    static_cast<ValueType*>(cmd)
3826        ->Init(_buffer, _result_shm_id, _result_shm_offset);
3827    return NextCmdAddress<ValueType>(cmd);
3828  }
3829
3830  gpu::CommandHeader header;
3831  uint32_t buffer;
3832  uint32_t result_shm_id;
3833  uint32_t result_shm_offset;
3834};
3835
3836COMPILE_ASSERT(sizeof(IsBuffer) == 16, Sizeof_IsBuffer_is_not_16);
3837COMPILE_ASSERT(offsetof(IsBuffer, header) == 0, OffsetOf_IsBuffer_header_not_0);
3838COMPILE_ASSERT(offsetof(IsBuffer, buffer) == 4, OffsetOf_IsBuffer_buffer_not_4);
3839COMPILE_ASSERT(offsetof(IsBuffer, result_shm_id) == 8,
3840               OffsetOf_IsBuffer_result_shm_id_not_8);
3841COMPILE_ASSERT(offsetof(IsBuffer, result_shm_offset) == 12,
3842               OffsetOf_IsBuffer_result_shm_offset_not_12);
3843
3844struct IsEnabled {
3845  typedef IsEnabled ValueType;
3846  static const CommandId kCmdId = kIsEnabled;
3847  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3848  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3849
3850  typedef uint32_t Result;
3851
3852  static uint32_t ComputeSize() {
3853    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3854  }
3855
3856  void SetHeader() { header.SetCmd<ValueType>(); }
3857
3858  void Init(GLenum _cap, uint32_t _result_shm_id, uint32_t _result_shm_offset) {
3859    SetHeader();
3860    cap = _cap;
3861    result_shm_id = _result_shm_id;
3862    result_shm_offset = _result_shm_offset;
3863  }
3864
3865  void* Set(void* cmd,
3866            GLenum _cap,
3867            uint32_t _result_shm_id,
3868            uint32_t _result_shm_offset) {
3869    static_cast<ValueType*>(cmd)
3870        ->Init(_cap, _result_shm_id, _result_shm_offset);
3871    return NextCmdAddress<ValueType>(cmd);
3872  }
3873
3874  gpu::CommandHeader header;
3875  uint32_t cap;
3876  uint32_t result_shm_id;
3877  uint32_t result_shm_offset;
3878};
3879
3880COMPILE_ASSERT(sizeof(IsEnabled) == 16, Sizeof_IsEnabled_is_not_16);
3881COMPILE_ASSERT(offsetof(IsEnabled, header) == 0,
3882               OffsetOf_IsEnabled_header_not_0);
3883COMPILE_ASSERT(offsetof(IsEnabled, cap) == 4, OffsetOf_IsEnabled_cap_not_4);
3884COMPILE_ASSERT(offsetof(IsEnabled, result_shm_id) == 8,
3885               OffsetOf_IsEnabled_result_shm_id_not_8);
3886COMPILE_ASSERT(offsetof(IsEnabled, result_shm_offset) == 12,
3887               OffsetOf_IsEnabled_result_shm_offset_not_12);
3888
3889struct IsFramebuffer {
3890  typedef IsFramebuffer ValueType;
3891  static const CommandId kCmdId = kIsFramebuffer;
3892  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3893  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3894
3895  typedef uint32_t Result;
3896
3897  static uint32_t ComputeSize() {
3898    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3899  }
3900
3901  void SetHeader() { header.SetCmd<ValueType>(); }
3902
3903  void Init(GLuint _framebuffer,
3904            uint32_t _result_shm_id,
3905            uint32_t _result_shm_offset) {
3906    SetHeader();
3907    framebuffer = _framebuffer;
3908    result_shm_id = _result_shm_id;
3909    result_shm_offset = _result_shm_offset;
3910  }
3911
3912  void* Set(void* cmd,
3913            GLuint _framebuffer,
3914            uint32_t _result_shm_id,
3915            uint32_t _result_shm_offset) {
3916    static_cast<ValueType*>(cmd)
3917        ->Init(_framebuffer, _result_shm_id, _result_shm_offset);
3918    return NextCmdAddress<ValueType>(cmd);
3919  }
3920
3921  gpu::CommandHeader header;
3922  uint32_t framebuffer;
3923  uint32_t result_shm_id;
3924  uint32_t result_shm_offset;
3925};
3926
3927COMPILE_ASSERT(sizeof(IsFramebuffer) == 16, Sizeof_IsFramebuffer_is_not_16);
3928COMPILE_ASSERT(offsetof(IsFramebuffer, header) == 0,
3929               OffsetOf_IsFramebuffer_header_not_0);
3930COMPILE_ASSERT(offsetof(IsFramebuffer, framebuffer) == 4,
3931               OffsetOf_IsFramebuffer_framebuffer_not_4);
3932COMPILE_ASSERT(offsetof(IsFramebuffer, result_shm_id) == 8,
3933               OffsetOf_IsFramebuffer_result_shm_id_not_8);
3934COMPILE_ASSERT(offsetof(IsFramebuffer, result_shm_offset) == 12,
3935               OffsetOf_IsFramebuffer_result_shm_offset_not_12);
3936
3937struct IsProgram {
3938  typedef IsProgram ValueType;
3939  static const CommandId kCmdId = kIsProgram;
3940  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3941  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3942
3943  typedef uint32_t Result;
3944
3945  static uint32_t ComputeSize() {
3946    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3947  }
3948
3949  void SetHeader() { header.SetCmd<ValueType>(); }
3950
3951  void Init(GLuint _program,
3952            uint32_t _result_shm_id,
3953            uint32_t _result_shm_offset) {
3954    SetHeader();
3955    program = _program;
3956    result_shm_id = _result_shm_id;
3957    result_shm_offset = _result_shm_offset;
3958  }
3959
3960  void* Set(void* cmd,
3961            GLuint _program,
3962            uint32_t _result_shm_id,
3963            uint32_t _result_shm_offset) {
3964    static_cast<ValueType*>(cmd)
3965        ->Init(_program, _result_shm_id, _result_shm_offset);
3966    return NextCmdAddress<ValueType>(cmd);
3967  }
3968
3969  gpu::CommandHeader header;
3970  uint32_t program;
3971  uint32_t result_shm_id;
3972  uint32_t result_shm_offset;
3973};
3974
3975COMPILE_ASSERT(sizeof(IsProgram) == 16, Sizeof_IsProgram_is_not_16);
3976COMPILE_ASSERT(offsetof(IsProgram, header) == 0,
3977               OffsetOf_IsProgram_header_not_0);
3978COMPILE_ASSERT(offsetof(IsProgram, program) == 4,
3979               OffsetOf_IsProgram_program_not_4);
3980COMPILE_ASSERT(offsetof(IsProgram, result_shm_id) == 8,
3981               OffsetOf_IsProgram_result_shm_id_not_8);
3982COMPILE_ASSERT(offsetof(IsProgram, result_shm_offset) == 12,
3983               OffsetOf_IsProgram_result_shm_offset_not_12);
3984
3985struct IsRenderbuffer {
3986  typedef IsRenderbuffer ValueType;
3987  static const CommandId kCmdId = kIsRenderbuffer;
3988  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3989  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3990
3991  typedef uint32_t Result;
3992
3993  static uint32_t ComputeSize() {
3994    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
3995  }
3996
3997  void SetHeader() { header.SetCmd<ValueType>(); }
3998
3999  void Init(GLuint _renderbuffer,
4000            uint32_t _result_shm_id,
4001            uint32_t _result_shm_offset) {
4002    SetHeader();
4003    renderbuffer = _renderbuffer;
4004    result_shm_id = _result_shm_id;
4005    result_shm_offset = _result_shm_offset;
4006  }
4007
4008  void* Set(void* cmd,
4009            GLuint _renderbuffer,
4010            uint32_t _result_shm_id,
4011            uint32_t _result_shm_offset) {
4012    static_cast<ValueType*>(cmd)
4013        ->Init(_renderbuffer, _result_shm_id, _result_shm_offset);
4014    return NextCmdAddress<ValueType>(cmd);
4015  }
4016
4017  gpu::CommandHeader header;
4018  uint32_t renderbuffer;
4019  uint32_t result_shm_id;
4020  uint32_t result_shm_offset;
4021};
4022
4023COMPILE_ASSERT(sizeof(IsRenderbuffer) == 16, Sizeof_IsRenderbuffer_is_not_16);
4024COMPILE_ASSERT(offsetof(IsRenderbuffer, header) == 0,
4025               OffsetOf_IsRenderbuffer_header_not_0);
4026COMPILE_ASSERT(offsetof(IsRenderbuffer, renderbuffer) == 4,
4027               OffsetOf_IsRenderbuffer_renderbuffer_not_4);
4028COMPILE_ASSERT(offsetof(IsRenderbuffer, result_shm_id) == 8,
4029               OffsetOf_IsRenderbuffer_result_shm_id_not_8);
4030COMPILE_ASSERT(offsetof(IsRenderbuffer, result_shm_offset) == 12,
4031               OffsetOf_IsRenderbuffer_result_shm_offset_not_12);
4032
4033struct IsShader {
4034  typedef IsShader ValueType;
4035  static const CommandId kCmdId = kIsShader;
4036  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4037  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4038
4039  typedef uint32_t Result;
4040
4041  static uint32_t ComputeSize() {
4042    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4043  }
4044
4045  void SetHeader() { header.SetCmd<ValueType>(); }
4046
4047  void Init(GLuint _shader,
4048            uint32_t _result_shm_id,
4049            uint32_t _result_shm_offset) {
4050    SetHeader();
4051    shader = _shader;
4052    result_shm_id = _result_shm_id;
4053    result_shm_offset = _result_shm_offset;
4054  }
4055
4056  void* Set(void* cmd,
4057            GLuint _shader,
4058            uint32_t _result_shm_id,
4059            uint32_t _result_shm_offset) {
4060    static_cast<ValueType*>(cmd)
4061        ->Init(_shader, _result_shm_id, _result_shm_offset);
4062    return NextCmdAddress<ValueType>(cmd);
4063  }
4064
4065  gpu::CommandHeader header;
4066  uint32_t shader;
4067  uint32_t result_shm_id;
4068  uint32_t result_shm_offset;
4069};
4070
4071COMPILE_ASSERT(sizeof(IsShader) == 16, Sizeof_IsShader_is_not_16);
4072COMPILE_ASSERT(offsetof(IsShader, header) == 0, OffsetOf_IsShader_header_not_0);
4073COMPILE_ASSERT(offsetof(IsShader, shader) == 4, OffsetOf_IsShader_shader_not_4);
4074COMPILE_ASSERT(offsetof(IsShader, result_shm_id) == 8,
4075               OffsetOf_IsShader_result_shm_id_not_8);
4076COMPILE_ASSERT(offsetof(IsShader, result_shm_offset) == 12,
4077               OffsetOf_IsShader_result_shm_offset_not_12);
4078
4079struct IsTexture {
4080  typedef IsTexture ValueType;
4081  static const CommandId kCmdId = kIsTexture;
4082  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4083  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4084
4085  typedef uint32_t Result;
4086
4087  static uint32_t ComputeSize() {
4088    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4089  }
4090
4091  void SetHeader() { header.SetCmd<ValueType>(); }
4092
4093  void Init(GLuint _texture,
4094            uint32_t _result_shm_id,
4095            uint32_t _result_shm_offset) {
4096    SetHeader();
4097    texture = _texture;
4098    result_shm_id = _result_shm_id;
4099    result_shm_offset = _result_shm_offset;
4100  }
4101
4102  void* Set(void* cmd,
4103            GLuint _texture,
4104            uint32_t _result_shm_id,
4105            uint32_t _result_shm_offset) {
4106    static_cast<ValueType*>(cmd)
4107        ->Init(_texture, _result_shm_id, _result_shm_offset);
4108    return NextCmdAddress<ValueType>(cmd);
4109  }
4110
4111  gpu::CommandHeader header;
4112  uint32_t texture;
4113  uint32_t result_shm_id;
4114  uint32_t result_shm_offset;
4115};
4116
4117COMPILE_ASSERT(sizeof(IsTexture) == 16, Sizeof_IsTexture_is_not_16);
4118COMPILE_ASSERT(offsetof(IsTexture, header) == 0,
4119               OffsetOf_IsTexture_header_not_0);
4120COMPILE_ASSERT(offsetof(IsTexture, texture) == 4,
4121               OffsetOf_IsTexture_texture_not_4);
4122COMPILE_ASSERT(offsetof(IsTexture, result_shm_id) == 8,
4123               OffsetOf_IsTexture_result_shm_id_not_8);
4124COMPILE_ASSERT(offsetof(IsTexture, result_shm_offset) == 12,
4125               OffsetOf_IsTexture_result_shm_offset_not_12);
4126
4127struct LineWidth {
4128  typedef LineWidth ValueType;
4129  static const CommandId kCmdId = kLineWidth;
4130  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4131  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4132
4133  static uint32_t ComputeSize() {
4134    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4135  }
4136
4137  void SetHeader() { header.SetCmd<ValueType>(); }
4138
4139  void Init(GLfloat _width) {
4140    SetHeader();
4141    width = _width;
4142  }
4143
4144  void* Set(void* cmd, GLfloat _width) {
4145    static_cast<ValueType*>(cmd)->Init(_width);
4146    return NextCmdAddress<ValueType>(cmd);
4147  }
4148
4149  gpu::CommandHeader header;
4150  float width;
4151};
4152
4153COMPILE_ASSERT(sizeof(LineWidth) == 8, Sizeof_LineWidth_is_not_8);
4154COMPILE_ASSERT(offsetof(LineWidth, header) == 0,
4155               OffsetOf_LineWidth_header_not_0);
4156COMPILE_ASSERT(offsetof(LineWidth, width) == 4, OffsetOf_LineWidth_width_not_4);
4157
4158struct LinkProgram {
4159  typedef LinkProgram ValueType;
4160  static const CommandId kCmdId = kLinkProgram;
4161  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4162  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4163
4164  static uint32_t ComputeSize() {
4165    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4166  }
4167
4168  void SetHeader() { header.SetCmd<ValueType>(); }
4169
4170  void Init(GLuint _program) {
4171    SetHeader();
4172    program = _program;
4173  }
4174
4175  void* Set(void* cmd, GLuint _program) {
4176    static_cast<ValueType*>(cmd)->Init(_program);
4177    return NextCmdAddress<ValueType>(cmd);
4178  }
4179
4180  gpu::CommandHeader header;
4181  uint32_t program;
4182};
4183
4184COMPILE_ASSERT(sizeof(LinkProgram) == 8, Sizeof_LinkProgram_is_not_8);
4185COMPILE_ASSERT(offsetof(LinkProgram, header) == 0,
4186               OffsetOf_LinkProgram_header_not_0);
4187COMPILE_ASSERT(offsetof(LinkProgram, program) == 4,
4188               OffsetOf_LinkProgram_program_not_4);
4189
4190struct PixelStorei {
4191  typedef PixelStorei ValueType;
4192  static const CommandId kCmdId = kPixelStorei;
4193  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4194  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4195
4196  static uint32_t ComputeSize() {
4197    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4198  }
4199
4200  void SetHeader() { header.SetCmd<ValueType>(); }
4201
4202  void Init(GLenum _pname, GLint _param) {
4203    SetHeader();
4204    pname = _pname;
4205    param = _param;
4206  }
4207
4208  void* Set(void* cmd, GLenum _pname, GLint _param) {
4209    static_cast<ValueType*>(cmd)->Init(_pname, _param);
4210    return NextCmdAddress<ValueType>(cmd);
4211  }
4212
4213  gpu::CommandHeader header;
4214  uint32_t pname;
4215  int32_t param;
4216};
4217
4218COMPILE_ASSERT(sizeof(PixelStorei) == 12, Sizeof_PixelStorei_is_not_12);
4219COMPILE_ASSERT(offsetof(PixelStorei, header) == 0,
4220               OffsetOf_PixelStorei_header_not_0);
4221COMPILE_ASSERT(offsetof(PixelStorei, pname) == 4,
4222               OffsetOf_PixelStorei_pname_not_4);
4223COMPILE_ASSERT(offsetof(PixelStorei, param) == 8,
4224               OffsetOf_PixelStorei_param_not_8);
4225
4226struct PolygonOffset {
4227  typedef PolygonOffset ValueType;
4228  static const CommandId kCmdId = kPolygonOffset;
4229  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4230  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4231
4232  static uint32_t ComputeSize() {
4233    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4234  }
4235
4236  void SetHeader() { header.SetCmd<ValueType>(); }
4237
4238  void Init(GLfloat _factor, GLfloat _units) {
4239    SetHeader();
4240    factor = _factor;
4241    units = _units;
4242  }
4243
4244  void* Set(void* cmd, GLfloat _factor, GLfloat _units) {
4245    static_cast<ValueType*>(cmd)->Init(_factor, _units);
4246    return NextCmdAddress<ValueType>(cmd);
4247  }
4248
4249  gpu::CommandHeader header;
4250  float factor;
4251  float units;
4252};
4253
4254COMPILE_ASSERT(sizeof(PolygonOffset) == 12, Sizeof_PolygonOffset_is_not_12);
4255COMPILE_ASSERT(offsetof(PolygonOffset, header) == 0,
4256               OffsetOf_PolygonOffset_header_not_0);
4257COMPILE_ASSERT(offsetof(PolygonOffset, factor) == 4,
4258               OffsetOf_PolygonOffset_factor_not_4);
4259COMPILE_ASSERT(offsetof(PolygonOffset, units) == 8,
4260               OffsetOf_PolygonOffset_units_not_8);
4261
4262// ReadPixels has the result separated from the pixel buffer so that
4263// it is easier to specify the result going to some specific place
4264// that exactly fits the rectangle of pixels.
4265struct ReadPixels {
4266  typedef ReadPixels ValueType;
4267  static const CommandId kCmdId = kReadPixels;
4268  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4269  static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4270
4271  typedef uint32_t Result;
4272
4273  static uint32_t ComputeSize() {
4274    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
4275  }
4276
4277  void SetHeader() { header.SetCmd<ValueType>(); }
4278
4279  void Init(GLint _x,
4280            GLint _y,
4281            GLsizei _width,
4282            GLsizei _height,
4283            GLenum _format,
4284            GLenum _type,
4285            uint32_t _pixels_shm_id,
4286            uint32_t _pixels_shm_offset,
4287            uint32_t _result_shm_id,
4288            uint32_t _result_shm_offset,
4289            GLboolean _async) {
4290    SetHeader();
4291    x = _x;
4292    y = _y;
4293    width = _width;
4294    height = _height;
4295