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 14 struct 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 40 COMPILE_ASSERT(sizeof(ActiveTexture) == 8, Sizeof_ActiveTexture_is_not_8); 41 COMPILE_ASSERT(offsetof(ActiveTexture, header) == 0, 42 OffsetOf_ActiveTexture_header_not_0); 43 COMPILE_ASSERT(offsetof(ActiveTexture, texture) == 4, 44 OffsetOf_ActiveTexture_texture_not_4); 45 46 struct 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 74 COMPILE_ASSERT(sizeof(AttachShader) == 12, Sizeof_AttachShader_is_not_12); 75 COMPILE_ASSERT(offsetof(AttachShader, header) == 0, 76 OffsetOf_AttachShader_header_not_0); 77 COMPILE_ASSERT(offsetof(AttachShader, program) == 4, 78 OffsetOf_AttachShader_program_not_4); 79 COMPILE_ASSERT(offsetof(AttachShader, shader) == 8, 80 OffsetOf_AttachShader_shader_not_8); 81 82 struct 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 115 COMPILE_ASSERT(sizeof(BindAttribLocationBucket) == 16, 116 Sizeof_BindAttribLocationBucket_is_not_16); 117 COMPILE_ASSERT(offsetof(BindAttribLocationBucket, header) == 0, 118 OffsetOf_BindAttribLocationBucket_header_not_0); 119 COMPILE_ASSERT(offsetof(BindAttribLocationBucket, program) == 4, 120 OffsetOf_BindAttribLocationBucket_program_not_4); 121 COMPILE_ASSERT(offsetof(BindAttribLocationBucket, index) == 8, 122 OffsetOf_BindAttribLocationBucket_index_not_8); 123 COMPILE_ASSERT(offsetof(BindAttribLocationBucket, name_bucket_id) == 12, 124 OffsetOf_BindAttribLocationBucket_name_bucket_id_not_12); 125 126 struct 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 154 COMPILE_ASSERT(sizeof(BindBuffer) == 12, Sizeof_BindBuffer_is_not_12); 155 COMPILE_ASSERT(offsetof(BindBuffer, header) == 0, 156 OffsetOf_BindBuffer_header_not_0); 157 COMPILE_ASSERT(offsetof(BindBuffer, target) == 4, 158 OffsetOf_BindBuffer_target_not_4); 159 COMPILE_ASSERT(offsetof(BindBuffer, buffer) == 8, 160 OffsetOf_BindBuffer_buffer_not_8); 161 162 struct 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 190 COMPILE_ASSERT(sizeof(BindFramebuffer) == 12, Sizeof_BindFramebuffer_is_not_12); 191 COMPILE_ASSERT(offsetof(BindFramebuffer, header) == 0, 192 OffsetOf_BindFramebuffer_header_not_0); 193 COMPILE_ASSERT(offsetof(BindFramebuffer, target) == 4, 194 OffsetOf_BindFramebuffer_target_not_4); 195 COMPILE_ASSERT(offsetof(BindFramebuffer, framebuffer) == 8, 196 OffsetOf_BindFramebuffer_framebuffer_not_8); 197 198 struct 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 226 COMPILE_ASSERT(sizeof(BindRenderbuffer) == 12, 227 Sizeof_BindRenderbuffer_is_not_12); 228 COMPILE_ASSERT(offsetof(BindRenderbuffer, header) == 0, 229 OffsetOf_BindRenderbuffer_header_not_0); 230 COMPILE_ASSERT(offsetof(BindRenderbuffer, target) == 4, 231 OffsetOf_BindRenderbuffer_target_not_4); 232 COMPILE_ASSERT(offsetof(BindRenderbuffer, renderbuffer) == 8, 233 OffsetOf_BindRenderbuffer_renderbuffer_not_8); 234 235 struct 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 263 COMPILE_ASSERT(sizeof(BindTexture) == 12, Sizeof_BindTexture_is_not_12); 264 COMPILE_ASSERT(offsetof(BindTexture, header) == 0, 265 OffsetOf_BindTexture_header_not_0); 266 COMPILE_ASSERT(offsetof(BindTexture, target) == 4, 267 OffsetOf_BindTexture_target_not_4); 268 COMPILE_ASSERT(offsetof(BindTexture, texture) == 8, 269 OffsetOf_BindTexture_texture_not_8); 270 271 struct 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 307 COMPILE_ASSERT(sizeof(BlendColor) == 20, Sizeof_BlendColor_is_not_20); 308 COMPILE_ASSERT(offsetof(BlendColor, header) == 0, 309 OffsetOf_BlendColor_header_not_0); 310 COMPILE_ASSERT(offsetof(BlendColor, red) == 4, OffsetOf_BlendColor_red_not_4); 311 COMPILE_ASSERT(offsetof(BlendColor, green) == 8, 312 OffsetOf_BlendColor_green_not_8); 313 COMPILE_ASSERT(offsetof(BlendColor, blue) == 12, 314 OffsetOf_BlendColor_blue_not_12); 315 COMPILE_ASSERT(offsetof(BlendColor, alpha) == 16, 316 OffsetOf_BlendColor_alpha_not_16); 317 318 struct 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 344 COMPILE_ASSERT(sizeof(BlendEquation) == 8, Sizeof_BlendEquation_is_not_8); 345 COMPILE_ASSERT(offsetof(BlendEquation, header) == 0, 346 OffsetOf_BlendEquation_header_not_0); 347 COMPILE_ASSERT(offsetof(BlendEquation, mode) == 4, 348 OffsetOf_BlendEquation_mode_not_4); 349 350 struct 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 378 COMPILE_ASSERT(sizeof(BlendEquationSeparate) == 12, 379 Sizeof_BlendEquationSeparate_is_not_12); 380 COMPILE_ASSERT(offsetof(BlendEquationSeparate, header) == 0, 381 OffsetOf_BlendEquationSeparate_header_not_0); 382 COMPILE_ASSERT(offsetof(BlendEquationSeparate, modeRGB) == 4, 383 OffsetOf_BlendEquationSeparate_modeRGB_not_4); 384 COMPILE_ASSERT(offsetof(BlendEquationSeparate, modeAlpha) == 8, 385 OffsetOf_BlendEquationSeparate_modeAlpha_not_8); 386 387 struct 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 415 COMPILE_ASSERT(sizeof(BlendFunc) == 12, Sizeof_BlendFunc_is_not_12); 416 COMPILE_ASSERT(offsetof(BlendFunc, header) == 0, 417 OffsetOf_BlendFunc_header_not_0); 418 COMPILE_ASSERT(offsetof(BlendFunc, sfactor) == 4, 419 OffsetOf_BlendFunc_sfactor_not_4); 420 COMPILE_ASSERT(offsetof(BlendFunc, dfactor) == 8, 421 OffsetOf_BlendFunc_dfactor_not_8); 422 423 struct 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 462 COMPILE_ASSERT(sizeof(BlendFuncSeparate) == 20, 463 Sizeof_BlendFuncSeparate_is_not_20); 464 COMPILE_ASSERT(offsetof(BlendFuncSeparate, header) == 0, 465 OffsetOf_BlendFuncSeparate_header_not_0); 466 COMPILE_ASSERT(offsetof(BlendFuncSeparate, srcRGB) == 4, 467 OffsetOf_BlendFuncSeparate_srcRGB_not_4); 468 COMPILE_ASSERT(offsetof(BlendFuncSeparate, dstRGB) == 8, 469 OffsetOf_BlendFuncSeparate_dstRGB_not_8); 470 COMPILE_ASSERT(offsetof(BlendFuncSeparate, srcAlpha) == 12, 471 OffsetOf_BlendFuncSeparate_srcAlpha_not_12); 472 COMPILE_ASSERT(offsetof(BlendFuncSeparate, dstAlpha) == 16, 473 OffsetOf_BlendFuncSeparate_dstAlpha_not_16); 474 475 struct 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 519 COMPILE_ASSERT(sizeof(BufferData) == 24, Sizeof_BufferData_is_not_24); 520 COMPILE_ASSERT(offsetof(BufferData, header) == 0, 521 OffsetOf_BufferData_header_not_0); 522 COMPILE_ASSERT(offsetof(BufferData, target) == 4, 523 OffsetOf_BufferData_target_not_4); 524 COMPILE_ASSERT(offsetof(BufferData, size) == 8, OffsetOf_BufferData_size_not_8); 525 COMPILE_ASSERT(offsetof(BufferData, data_shm_id) == 12, 526 OffsetOf_BufferData_data_shm_id_not_12); 527 COMPILE_ASSERT(offsetof(BufferData, data_shm_offset) == 16, 528 OffsetOf_BufferData_data_shm_offset_not_16); 529 COMPILE_ASSERT(offsetof(BufferData, usage) == 20, 530 OffsetOf_BufferData_usage_not_20); 531 532 struct 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 576 COMPILE_ASSERT(sizeof(BufferSubData) == 24, Sizeof_BufferSubData_is_not_24); 577 COMPILE_ASSERT(offsetof(BufferSubData, header) == 0, 578 OffsetOf_BufferSubData_header_not_0); 579 COMPILE_ASSERT(offsetof(BufferSubData, target) == 4, 580 OffsetOf_BufferSubData_target_not_4); 581 COMPILE_ASSERT(offsetof(BufferSubData, offset) == 8, 582 OffsetOf_BufferSubData_offset_not_8); 583 COMPILE_ASSERT(offsetof(BufferSubData, size) == 12, 584 OffsetOf_BufferSubData_size_not_12); 585 COMPILE_ASSERT(offsetof(BufferSubData, data_shm_id) == 16, 586 OffsetOf_BufferSubData_data_shm_id_not_16); 587 COMPILE_ASSERT(offsetof(BufferSubData, data_shm_offset) == 20, 588 OffsetOf_BufferSubData_data_shm_offset_not_20); 589 590 struct 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 628 COMPILE_ASSERT(sizeof(CheckFramebufferStatus) == 16, 629 Sizeof_CheckFramebufferStatus_is_not_16); 630 COMPILE_ASSERT(offsetof(CheckFramebufferStatus, header) == 0, 631 OffsetOf_CheckFramebufferStatus_header_not_0); 632 COMPILE_ASSERT(offsetof(CheckFramebufferStatus, target) == 4, 633 OffsetOf_CheckFramebufferStatus_target_not_4); 634 COMPILE_ASSERT(offsetof(CheckFramebufferStatus, result_shm_id) == 8, 635 OffsetOf_CheckFramebufferStatus_result_shm_id_not_8); 636 COMPILE_ASSERT(offsetof(CheckFramebufferStatus, result_shm_offset) == 12, 637 OffsetOf_CheckFramebufferStatus_result_shm_offset_not_12); 638 639 struct 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 665 COMPILE_ASSERT(sizeof(Clear) == 8, Sizeof_Clear_is_not_8); 666 COMPILE_ASSERT(offsetof(Clear, header) == 0, OffsetOf_Clear_header_not_0); 667 COMPILE_ASSERT(offsetof(Clear, mask) == 4, OffsetOf_Clear_mask_not_4); 668 669 struct 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 705 COMPILE_ASSERT(sizeof(ClearColor) == 20, Sizeof_ClearColor_is_not_20); 706 COMPILE_ASSERT(offsetof(ClearColor, header) == 0, 707 OffsetOf_ClearColor_header_not_0); 708 COMPILE_ASSERT(offsetof(ClearColor, red) == 4, OffsetOf_ClearColor_red_not_4); 709 COMPILE_ASSERT(offsetof(ClearColor, green) == 8, 710 OffsetOf_ClearColor_green_not_8); 711 COMPILE_ASSERT(offsetof(ClearColor, blue) == 12, 712 OffsetOf_ClearColor_blue_not_12); 713 COMPILE_ASSERT(offsetof(ClearColor, alpha) == 16, 714 OffsetOf_ClearColor_alpha_not_16); 715 716 struct 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 742 COMPILE_ASSERT(sizeof(ClearDepthf) == 8, Sizeof_ClearDepthf_is_not_8); 743 COMPILE_ASSERT(offsetof(ClearDepthf, header) == 0, 744 OffsetOf_ClearDepthf_header_not_0); 745 COMPILE_ASSERT(offsetof(ClearDepthf, depth) == 4, 746 OffsetOf_ClearDepthf_depth_not_4); 747 748 struct 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 774 COMPILE_ASSERT(sizeof(ClearStencil) == 8, Sizeof_ClearStencil_is_not_8); 775 COMPILE_ASSERT(offsetof(ClearStencil, header) == 0, 776 OffsetOf_ClearStencil_header_not_0); 777 COMPILE_ASSERT(offsetof(ClearStencil, s) == 4, OffsetOf_ClearStencil_s_not_4); 778 779 struct 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 818 COMPILE_ASSERT(sizeof(ColorMask) == 20, Sizeof_ColorMask_is_not_20); 819 COMPILE_ASSERT(offsetof(ColorMask, header) == 0, 820 OffsetOf_ColorMask_header_not_0); 821 COMPILE_ASSERT(offsetof(ColorMask, red) == 4, OffsetOf_ColorMask_red_not_4); 822 COMPILE_ASSERT(offsetof(ColorMask, green) == 8, OffsetOf_ColorMask_green_not_8); 823 COMPILE_ASSERT(offsetof(ColorMask, blue) == 12, OffsetOf_ColorMask_blue_not_12); 824 COMPILE_ASSERT(offsetof(ColorMask, alpha) == 16, 825 OffsetOf_ColorMask_alpha_not_16); 826 827 struct 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 853 COMPILE_ASSERT(sizeof(CompileShader) == 8, Sizeof_CompileShader_is_not_8); 854 COMPILE_ASSERT(offsetof(CompileShader, header) == 0, 855 OffsetOf_CompileShader_header_not_0); 856 COMPILE_ASSERT(offsetof(CompileShader, shader) == 4, 857 OffsetOf_CompileShader_shader_not_4); 858 859 struct 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 908 COMPILE_ASSERT(sizeof(CompressedTexImage2DBucket) == 28, 909 Sizeof_CompressedTexImage2DBucket_is_not_28); 910 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, header) == 0, 911 OffsetOf_CompressedTexImage2DBucket_header_not_0); 912 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, target) == 4, 913 OffsetOf_CompressedTexImage2DBucket_target_not_4); 914 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, level) == 8, 915 OffsetOf_CompressedTexImage2DBucket_level_not_8); 916 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, internalformat) == 12, 917 OffsetOf_CompressedTexImage2DBucket_internalformat_not_12); 918 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, width) == 16, 919 OffsetOf_CompressedTexImage2DBucket_width_not_16); 920 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, height) == 20, 921 OffsetOf_CompressedTexImage2DBucket_height_not_20); 922 COMPILE_ASSERT(offsetof(CompressedTexImage2DBucket, bucket_id) == 24, 923 OffsetOf_CompressedTexImage2DBucket_bucket_id_not_24); 924 925 struct 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 988 COMPILE_ASSERT(sizeof(CompressedTexImage2D) == 36, 989 Sizeof_CompressedTexImage2D_is_not_36); 990 COMPILE_ASSERT(offsetof(CompressedTexImage2D, header) == 0, 991 OffsetOf_CompressedTexImage2D_header_not_0); 992 COMPILE_ASSERT(offsetof(CompressedTexImage2D, target) == 4, 993 OffsetOf_CompressedTexImage2D_target_not_4); 994 COMPILE_ASSERT(offsetof(CompressedTexImage2D, level) == 8, 995 OffsetOf_CompressedTexImage2D_level_not_8); 996 COMPILE_ASSERT(offsetof(CompressedTexImage2D, internalformat) == 12, 997 OffsetOf_CompressedTexImage2D_internalformat_not_12); 998 COMPILE_ASSERT(offsetof(CompressedTexImage2D, width) == 16, 999 OffsetOf_CompressedTexImage2D_width_not_16); 1000 COMPILE_ASSERT(offsetof(CompressedTexImage2D, height) == 20, 1001 OffsetOf_CompressedTexImage2D_height_not_20); 1002 COMPILE_ASSERT(offsetof(CompressedTexImage2D, imageSize) == 24, 1003 OffsetOf_CompressedTexImage2D_imageSize_not_24); 1004 COMPILE_ASSERT(offsetof(CompressedTexImage2D, data_shm_id) == 28, 1005 OffsetOf_CompressedTexImage2D_data_shm_id_not_28); 1006 COMPILE_ASSERT(offsetof(CompressedTexImage2D, data_shm_offset) == 32, 1007 OffsetOf_CompressedTexImage2D_data_shm_offset_not_32); 1008 1009 struct 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 1071 COMPILE_ASSERT(sizeof(CompressedTexSubImage2DBucket) == 36, 1072 Sizeof_CompressedTexSubImage2DBucket_is_not_36); 1073 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, header) == 0, 1074 OffsetOf_CompressedTexSubImage2DBucket_header_not_0); 1075 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, target) == 4, 1076 OffsetOf_CompressedTexSubImage2DBucket_target_not_4); 1077 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, level) == 8, 1078 OffsetOf_CompressedTexSubImage2DBucket_level_not_8); 1079 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, xoffset) == 12, 1080 OffsetOf_CompressedTexSubImage2DBucket_xoffset_not_12); 1081 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, yoffset) == 16, 1082 OffsetOf_CompressedTexSubImage2DBucket_yoffset_not_16); 1083 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, width) == 20, 1084 OffsetOf_CompressedTexSubImage2DBucket_width_not_20); 1085 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, height) == 24, 1086 OffsetOf_CompressedTexSubImage2DBucket_height_not_24); 1087 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, format) == 28, 1088 OffsetOf_CompressedTexSubImage2DBucket_format_not_28); 1089 COMPILE_ASSERT(offsetof(CompressedTexSubImage2DBucket, bucket_id) == 32, 1090 OffsetOf_CompressedTexSubImage2DBucket_bucket_id_not_32); 1091 1092 struct 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 1164 COMPILE_ASSERT(sizeof(CompressedTexSubImage2D) == 44, 1165 Sizeof_CompressedTexSubImage2D_is_not_44); 1166 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, header) == 0, 1167 OffsetOf_CompressedTexSubImage2D_header_not_0); 1168 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, target) == 4, 1169 OffsetOf_CompressedTexSubImage2D_target_not_4); 1170 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, level) == 8, 1171 OffsetOf_CompressedTexSubImage2D_level_not_8); 1172 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, xoffset) == 12, 1173 OffsetOf_CompressedTexSubImage2D_xoffset_not_12); 1174 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, yoffset) == 16, 1175 OffsetOf_CompressedTexSubImage2D_yoffset_not_16); 1176 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, width) == 20, 1177 OffsetOf_CompressedTexSubImage2D_width_not_20); 1178 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, height) == 24, 1179 OffsetOf_CompressedTexSubImage2D_height_not_24); 1180 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, format) == 28, 1181 OffsetOf_CompressedTexSubImage2D_format_not_28); 1182 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, imageSize) == 32, 1183 OffsetOf_CompressedTexSubImage2D_imageSize_not_32); 1184 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, data_shm_id) == 36, 1185 OffsetOf_CompressedTexSubImage2D_data_shm_id_not_36); 1186 COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, data_shm_offset) == 40, 1187 OffsetOf_CompressedTexSubImage2D_data_shm_offset_not_40); 1188 1189 struct 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 1242 COMPILE_ASSERT(sizeof(CopyTexImage2D) == 32, Sizeof_CopyTexImage2D_is_not_32); 1243 COMPILE_ASSERT(offsetof(CopyTexImage2D, header) == 0, 1244 OffsetOf_CopyTexImage2D_header_not_0); 1245 COMPILE_ASSERT(offsetof(CopyTexImage2D, target) == 4, 1246 OffsetOf_CopyTexImage2D_target_not_4); 1247 COMPILE_ASSERT(offsetof(CopyTexImage2D, level) == 8, 1248 OffsetOf_CopyTexImage2D_level_not_8); 1249 COMPILE_ASSERT(offsetof(CopyTexImage2D, internalformat) == 12, 1250 OffsetOf_CopyTexImage2D_internalformat_not_12); 1251 COMPILE_ASSERT(offsetof(CopyTexImage2D, x) == 16, 1252 OffsetOf_CopyTexImage2D_x_not_16); 1253 COMPILE_ASSERT(offsetof(CopyTexImage2D, y) == 20, 1254 OffsetOf_CopyTexImage2D_y_not_20); 1255 COMPILE_ASSERT(offsetof(CopyTexImage2D, width) == 24, 1256 OffsetOf_CopyTexImage2D_width_not_24); 1257 COMPILE_ASSERT(offsetof(CopyTexImage2D, height) == 28, 1258 OffsetOf_CopyTexImage2D_height_not_28); 1259 1260 struct 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 1316 COMPILE_ASSERT(sizeof(CopyTexSubImage2D) == 36, 1317 Sizeof_CopyTexSubImage2D_is_not_36); 1318 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, header) == 0, 1319 OffsetOf_CopyTexSubImage2D_header_not_0); 1320 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, target) == 4, 1321 OffsetOf_CopyTexSubImage2D_target_not_4); 1322 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, level) == 8, 1323 OffsetOf_CopyTexSubImage2D_level_not_8); 1324 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, xoffset) == 12, 1325 OffsetOf_CopyTexSubImage2D_xoffset_not_12); 1326 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, yoffset) == 16, 1327 OffsetOf_CopyTexSubImage2D_yoffset_not_16); 1328 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, x) == 20, 1329 OffsetOf_CopyTexSubImage2D_x_not_20); 1330 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, y) == 24, 1331 OffsetOf_CopyTexSubImage2D_y_not_24); 1332 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, width) == 28, 1333 OffsetOf_CopyTexSubImage2D_width_not_28); 1334 COMPILE_ASSERT(offsetof(CopyTexSubImage2D, height) == 32, 1335 OffsetOf_CopyTexSubImage2D_height_not_32); 1336 1337 struct 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 1363 COMPILE_ASSERT(sizeof(CreateProgram) == 8, Sizeof_CreateProgram_is_not_8); 1364 COMPILE_ASSERT(offsetof(CreateProgram, header) == 0, 1365 OffsetOf_CreateProgram_header_not_0); 1366 COMPILE_ASSERT(offsetof(CreateProgram, client_id) == 4, 1367 OffsetOf_CreateProgram_client_id_not_4); 1368 1369 struct 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 1397 COMPILE_ASSERT(sizeof(CreateShader) == 12, Sizeof_CreateShader_is_not_12); 1398 COMPILE_ASSERT(offsetof(CreateShader, header) == 0, 1399 OffsetOf_CreateShader_header_not_0); 1400 COMPILE_ASSERT(offsetof(CreateShader, type) == 4, 1401 OffsetOf_CreateShader_type_not_4); 1402 COMPILE_ASSERT(offsetof(CreateShader, client_id) == 8, 1403 OffsetOf_CreateShader_client_id_not_8); 1404 1405 struct 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 1431 COMPILE_ASSERT(sizeof(CullFace) == 8, Sizeof_CullFace_is_not_8); 1432 COMPILE_ASSERT(offsetof(CullFace, header) == 0, OffsetOf_CullFace_header_not_0); 1433 COMPILE_ASSERT(offsetof(CullFace, mode) == 4, OffsetOf_CullFace_mode_not_4); 1434 1435 struct 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 1470 COMPILE_ASSERT(sizeof(DeleteBuffersImmediate) == 8, 1471 Sizeof_DeleteBuffersImmediate_is_not_8); 1472 COMPILE_ASSERT(offsetof(DeleteBuffersImmediate, header) == 0, 1473 OffsetOf_DeleteBuffersImmediate_header_not_0); 1474 COMPILE_ASSERT(offsetof(DeleteBuffersImmediate, n) == 4, 1475 OffsetOf_DeleteBuffersImmediate_n_not_4); 1476 1477 struct 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 1512 COMPILE_ASSERT(sizeof(DeleteFramebuffersImmediate) == 8, 1513 Sizeof_DeleteFramebuffersImmediate_is_not_8); 1514 COMPILE_ASSERT(offsetof(DeleteFramebuffersImmediate, header) == 0, 1515 OffsetOf_DeleteFramebuffersImmediate_header_not_0); 1516 COMPILE_ASSERT(offsetof(DeleteFramebuffersImmediate, n) == 4, 1517 OffsetOf_DeleteFramebuffersImmediate_n_not_4); 1518 1519 struct 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 1545 COMPILE_ASSERT(sizeof(DeleteProgram) == 8, Sizeof_DeleteProgram_is_not_8); 1546 COMPILE_ASSERT(offsetof(DeleteProgram, header) == 0, 1547 OffsetOf_DeleteProgram_header_not_0); 1548 COMPILE_ASSERT(offsetof(DeleteProgram, program) == 4, 1549 OffsetOf_DeleteProgram_program_not_4); 1550 1551 struct 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 1586 COMPILE_ASSERT(sizeof(DeleteRenderbuffersImmediate) == 8, 1587 Sizeof_DeleteRenderbuffersImmediate_is_not_8); 1588 COMPILE_ASSERT(offsetof(DeleteRenderbuffersImmediate, header) == 0, 1589 OffsetOf_DeleteRenderbuffersImmediate_header_not_0); 1590 COMPILE_ASSERT(offsetof(DeleteRenderbuffersImmediate, n) == 4, 1591 OffsetOf_DeleteRenderbuffersImmediate_n_not_4); 1592 1593 struct 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 1619 COMPILE_ASSERT(sizeof(DeleteShader) == 8, Sizeof_DeleteShader_is_not_8); 1620 COMPILE_ASSERT(offsetof(DeleteShader, header) == 0, 1621 OffsetOf_DeleteShader_header_not_0); 1622 COMPILE_ASSERT(offsetof(DeleteShader, shader) == 4, 1623 OffsetOf_DeleteShader_shader_not_4); 1624 1625 struct 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 1660 COMPILE_ASSERT(sizeof(DeleteTexturesImmediate) == 8, 1661 Sizeof_DeleteTexturesImmediate_is_not_8); 1662 COMPILE_ASSERT(offsetof(DeleteTexturesImmediate, header) == 0, 1663 OffsetOf_DeleteTexturesImmediate_header_not_0); 1664 COMPILE_ASSERT(offsetof(DeleteTexturesImmediate, n) == 4, 1665 OffsetOf_DeleteTexturesImmediate_n_not_4); 1666 1667 struct 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 1693 COMPILE_ASSERT(sizeof(DepthFunc) == 8, Sizeof_DepthFunc_is_not_8); 1694 COMPILE_ASSERT(offsetof(DepthFunc, header) == 0, 1695 OffsetOf_DepthFunc_header_not_0); 1696 COMPILE_ASSERT(offsetof(DepthFunc, func) == 4, OffsetOf_DepthFunc_func_not_4); 1697 1698 struct 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 1724 COMPILE_ASSERT(sizeof(DepthMask) == 8, Sizeof_DepthMask_is_not_8); 1725 COMPILE_ASSERT(offsetof(DepthMask, header) == 0, 1726 OffsetOf_DepthMask_header_not_0); 1727 COMPILE_ASSERT(offsetof(DepthMask, flag) == 4, OffsetOf_DepthMask_flag_not_4); 1728 1729 struct 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 1757 COMPILE_ASSERT(sizeof(DepthRangef) == 12, Sizeof_DepthRangef_is_not_12); 1758 COMPILE_ASSERT(offsetof(DepthRangef, header) == 0, 1759 OffsetOf_DepthRangef_header_not_0); 1760 COMPILE_ASSERT(offsetof(DepthRangef, zNear) == 4, 1761 OffsetOf_DepthRangef_zNear_not_4); 1762 COMPILE_ASSERT(offsetof(DepthRangef, zFar) == 8, 1763 OffsetOf_DepthRangef_zFar_not_8); 1764 1765 struct 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 1793 COMPILE_ASSERT(sizeof(DetachShader) == 12, Sizeof_DetachShader_is_not_12); 1794 COMPILE_ASSERT(offsetof(DetachShader, header) == 0, 1795 OffsetOf_DetachShader_header_not_0); 1796 COMPILE_ASSERT(offsetof(DetachShader, program) == 4, 1797 OffsetOf_DetachShader_program_not_4); 1798 COMPILE_ASSERT(offsetof(DetachShader, shader) == 8, 1799 OffsetOf_DetachShader_shader_not_8); 1800 1801 struct 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 1827 COMPILE_ASSERT(sizeof(Disable) == 8, Sizeof_Disable_is_not_8); 1828 COMPILE_ASSERT(offsetof(Disable, header) == 0, OffsetOf_Disable_header_not_0); 1829 COMPILE_ASSERT(offsetof(Disable, cap) == 4, OffsetOf_Disable_cap_not_4); 1830 1831 struct 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 1857 COMPILE_ASSERT(sizeof(DisableVertexAttribArray) == 8, 1858 Sizeof_DisableVertexAttribArray_is_not_8); 1859 COMPILE_ASSERT(offsetof(DisableVertexAttribArray, header) == 0, 1860 OffsetOf_DisableVertexAttribArray_header_not_0); 1861 COMPILE_ASSERT(offsetof(DisableVertexAttribArray, index) == 4, 1862 OffsetOf_DisableVertexAttribArray_index_not_4); 1863 1864 struct 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 1894 COMPILE_ASSERT(sizeof(DrawArrays) == 16, Sizeof_DrawArrays_is_not_16); 1895 COMPILE_ASSERT(offsetof(DrawArrays, header) == 0, 1896 OffsetOf_DrawArrays_header_not_0); 1897 COMPILE_ASSERT(offsetof(DrawArrays, mode) == 4, OffsetOf_DrawArrays_mode_not_4); 1898 COMPILE_ASSERT(offsetof(DrawArrays, first) == 8, 1899 OffsetOf_DrawArrays_first_not_8); 1900 COMPILE_ASSERT(offsetof(DrawArrays, count) == 12, 1901 OffsetOf_DrawArrays_count_not_12); 1902 1903 struct 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 1939 COMPILE_ASSERT(sizeof(DrawElements) == 20, Sizeof_DrawElements_is_not_20); 1940 COMPILE_ASSERT(offsetof(DrawElements, header) == 0, 1941 OffsetOf_DrawElements_header_not_0); 1942 COMPILE_ASSERT(offsetof(DrawElements, mode) == 4, 1943 OffsetOf_DrawElements_mode_not_4); 1944 COMPILE_ASSERT(offsetof(DrawElements, count) == 8, 1945 OffsetOf_DrawElements_count_not_8); 1946 COMPILE_ASSERT(offsetof(DrawElements, type) == 12, 1947 OffsetOf_DrawElements_type_not_12); 1948 COMPILE_ASSERT(offsetof(DrawElements, index_offset) == 16, 1949 OffsetOf_DrawElements_index_offset_not_16); 1950 1951 struct 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 1977 COMPILE_ASSERT(sizeof(Enable) == 8, Sizeof_Enable_is_not_8); 1978 COMPILE_ASSERT(offsetof(Enable, header) == 0, OffsetOf_Enable_header_not_0); 1979 COMPILE_ASSERT(offsetof(Enable, cap) == 4, OffsetOf_Enable_cap_not_4); 1980 1981 struct 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 2007 COMPILE_ASSERT(sizeof(EnableVertexAttribArray) == 8, 2008 Sizeof_EnableVertexAttribArray_is_not_8); 2009 COMPILE_ASSERT(offsetof(EnableVertexAttribArray, header) == 0, 2010 OffsetOf_EnableVertexAttribArray_header_not_0); 2011 COMPILE_ASSERT(offsetof(EnableVertexAttribArray, index) == 4, 2012 OffsetOf_EnableVertexAttribArray_index_not_4); 2013 2014 struct 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 2036 COMPILE_ASSERT(sizeof(Finish) == 4, Sizeof_Finish_is_not_4); 2037 COMPILE_ASSERT(offsetof(Finish, header) == 0, OffsetOf_Finish_header_not_0); 2038 2039 struct 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 2061 COMPILE_ASSERT(sizeof(Flush) == 4, Sizeof_Flush_is_not_4); 2062 COMPILE_ASSERT(offsetof(Flush, header) == 0, OffsetOf_Flush_header_not_0); 2063 2064 struct 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 2104 COMPILE_ASSERT(sizeof(FramebufferRenderbuffer) == 20, 2105 Sizeof_FramebufferRenderbuffer_is_not_20); 2106 COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, header) == 0, 2107 OffsetOf_FramebufferRenderbuffer_header_not_0); 2108 COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, target) == 4, 2109 OffsetOf_FramebufferRenderbuffer_target_not_4); 2110 COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, attachment) == 8, 2111 OffsetOf_FramebufferRenderbuffer_attachment_not_8); 2112 COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, renderbuffertarget) == 12, 2113 OffsetOf_FramebufferRenderbuffer_renderbuffertarget_not_12); 2114 COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, renderbuffer) == 16, 2115 OffsetOf_FramebufferRenderbuffer_renderbuffer_not_16); 2116 2117 struct 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 2158 COMPILE_ASSERT(sizeof(FramebufferTexture2D) == 20, 2159 Sizeof_FramebufferTexture2D_is_not_20); 2160 COMPILE_ASSERT(offsetof(FramebufferTexture2D, header) == 0, 2161 OffsetOf_FramebufferTexture2D_header_not_0); 2162 COMPILE_ASSERT(offsetof(FramebufferTexture2D, target) == 4, 2163 OffsetOf_FramebufferTexture2D_target_not_4); 2164 COMPILE_ASSERT(offsetof(FramebufferTexture2D, attachment) == 8, 2165 OffsetOf_FramebufferTexture2D_attachment_not_8); 2166 COMPILE_ASSERT(offsetof(FramebufferTexture2D, textarget) == 12, 2167 OffsetOf_FramebufferTexture2D_textarget_not_12); 2168 COMPILE_ASSERT(offsetof(FramebufferTexture2D, texture) == 16, 2169 OffsetOf_FramebufferTexture2D_texture_not_16); 2170 2171 struct 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 2197 COMPILE_ASSERT(sizeof(FrontFace) == 8, Sizeof_FrontFace_is_not_8); 2198 COMPILE_ASSERT(offsetof(FrontFace, header) == 0, 2199 OffsetOf_FrontFace_header_not_0); 2200 COMPILE_ASSERT(offsetof(FrontFace, mode) == 4, OffsetOf_FrontFace_mode_not_4); 2201 2202 struct 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 2237 COMPILE_ASSERT(sizeof(GenBuffersImmediate) == 8, 2238 Sizeof_GenBuffersImmediate_is_not_8); 2239 COMPILE_ASSERT(offsetof(GenBuffersImmediate, header) == 0, 2240 OffsetOf_GenBuffersImmediate_header_not_0); 2241 COMPILE_ASSERT(offsetof(GenBuffersImmediate, n) == 4, 2242 OffsetOf_GenBuffersImmediate_n_not_4); 2243 2244 struct 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 2270 COMPILE_ASSERT(sizeof(GenerateMipmap) == 8, Sizeof_GenerateMipmap_is_not_8); 2271 COMPILE_ASSERT(offsetof(GenerateMipmap, header) == 0, 2272 OffsetOf_GenerateMipmap_header_not_0); 2273 COMPILE_ASSERT(offsetof(GenerateMipmap, target) == 4, 2274 OffsetOf_GenerateMipmap_target_not_4); 2275 2276 struct 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 2311 COMPILE_ASSERT(sizeof(GenFramebuffersImmediate) == 8, 2312 Sizeof_GenFramebuffersImmediate_is_not_8); 2313 COMPILE_ASSERT(offsetof(GenFramebuffersImmediate, header) == 0, 2314 OffsetOf_GenFramebuffersImmediate_header_not_0); 2315 COMPILE_ASSERT(offsetof(GenFramebuffersImmediate, n) == 4, 2316 OffsetOf_GenFramebuffersImmediate_n_not_4); 2317 2318 struct 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 2353 COMPILE_ASSERT(sizeof(GenRenderbuffersImmediate) == 8, 2354 Sizeof_GenRenderbuffersImmediate_is_not_8); 2355 COMPILE_ASSERT(offsetof(GenRenderbuffersImmediate, header) == 0, 2356 OffsetOf_GenRenderbuffersImmediate_header_not_0); 2357 COMPILE_ASSERT(offsetof(GenRenderbuffersImmediate, n) == 4, 2358 OffsetOf_GenRenderbuffersImmediate_n_not_4); 2359 2360 struct 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 2395 COMPILE_ASSERT(sizeof(GenTexturesImmediate) == 8, 2396 Sizeof_GenTexturesImmediate_is_not_8); 2397 COMPILE_ASSERT(offsetof(GenTexturesImmediate, header) == 0, 2398 OffsetOf_GenTexturesImmediate_header_not_0); 2399 COMPILE_ASSERT(offsetof(GenTexturesImmediate, n) == 4, 2400 OffsetOf_GenTexturesImmediate_n_not_4); 2401 2402 struct 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 2452 COMPILE_ASSERT(sizeof(GetActiveAttrib) == 24, Sizeof_GetActiveAttrib_is_not_24); 2453 COMPILE_ASSERT(offsetof(GetActiveAttrib, header) == 0, 2454 OffsetOf_GetActiveAttrib_header_not_0); 2455 COMPILE_ASSERT(offsetof(GetActiveAttrib, program) == 4, 2456 OffsetOf_GetActiveAttrib_program_not_4); 2457 COMPILE_ASSERT(offsetof(GetActiveAttrib, index) == 8, 2458 OffsetOf_GetActiveAttrib_index_not_8); 2459 COMPILE_ASSERT(offsetof(GetActiveAttrib, name_bucket_id) == 12, 2460 OffsetOf_GetActiveAttrib_name_bucket_id_not_12); 2461 COMPILE_ASSERT(offsetof(GetActiveAttrib, result_shm_id) == 16, 2462 OffsetOf_GetActiveAttrib_result_shm_id_not_16); 2463 COMPILE_ASSERT(offsetof(GetActiveAttrib, result_shm_offset) == 20, 2464 OffsetOf_GetActiveAttrib_result_shm_offset_not_20); 2465 COMPILE_ASSERT(offsetof(GetActiveAttrib::Result, success) == 0, 2466 OffsetOf_GetActiveAttrib_Result_success_not_0); 2467 COMPILE_ASSERT(offsetof(GetActiveAttrib::Result, size) == 4, 2468 OffsetOf_GetActiveAttrib_Result_size_not_4); 2469 COMPILE_ASSERT(offsetof(GetActiveAttrib::Result, type) == 8, 2470 OffsetOf_GetActiveAttrib_Result_type_not_8); 2471 2472 struct 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 2522 COMPILE_ASSERT(sizeof(GetActiveUniform) == 24, 2523 Sizeof_GetActiveUniform_is_not_24); 2524 COMPILE_ASSERT(offsetof(GetActiveUniform, header) == 0, 2525 OffsetOf_GetActiveUniform_header_not_0); 2526 COMPILE_ASSERT(offsetof(GetActiveUniform, program) == 4, 2527 OffsetOf_GetActiveUniform_program_not_4); 2528 COMPILE_ASSERT(offsetof(GetActiveUniform, index) == 8, 2529 OffsetOf_GetActiveUniform_index_not_8); 2530 COMPILE_ASSERT(offsetof(GetActiveUniform, name_bucket_id) == 12, 2531 OffsetOf_GetActiveUniform_name_bucket_id_not_12); 2532 COMPILE_ASSERT(offsetof(GetActiveUniform, result_shm_id) == 16, 2533 OffsetOf_GetActiveUniform_result_shm_id_not_16); 2534 COMPILE_ASSERT(offsetof(GetActiveUniform, result_shm_offset) == 20, 2535 OffsetOf_GetActiveUniform_result_shm_offset_not_20); 2536 COMPILE_ASSERT(offsetof(GetActiveUniform::Result, success) == 0, 2537 OffsetOf_GetActiveUniform_Result_success_not_0); 2538 COMPILE_ASSERT(offsetof(GetActiveUniform::Result, size) == 4, 2539 OffsetOf_GetActiveUniform_Result_size_not_4); 2540 COMPILE_ASSERT(offsetof(GetActiveUniform::Result, type) == 8, 2541 OffsetOf_GetActiveUniform_Result_type_not_8); 2542 2543 struct 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 2585 COMPILE_ASSERT(sizeof(GetAttachedShaders) == 20, 2586 Sizeof_GetAttachedShaders_is_not_20); 2587 COMPILE_ASSERT(offsetof(GetAttachedShaders, header) == 0, 2588 OffsetOf_GetAttachedShaders_header_not_0); 2589 COMPILE_ASSERT(offsetof(GetAttachedShaders, program) == 4, 2590 OffsetOf_GetAttachedShaders_program_not_4); 2591 COMPILE_ASSERT(offsetof(GetAttachedShaders, result_shm_id) == 8, 2592 OffsetOf_GetAttachedShaders_result_shm_id_not_8); 2593 COMPILE_ASSERT(offsetof(GetAttachedShaders, result_shm_offset) == 12, 2594 OffsetOf_GetAttachedShaders_result_shm_offset_not_12); 2595 COMPILE_ASSERT(offsetof(GetAttachedShaders, result_size) == 16, 2596 OffsetOf_GetAttachedShaders_result_size_not_16); 2597 2598 struct 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 2640 COMPILE_ASSERT(sizeof(GetAttribLocation) == 20, 2641 Sizeof_GetAttribLocation_is_not_20); 2642 COMPILE_ASSERT(offsetof(GetAttribLocation, header) == 0, 2643 OffsetOf_GetAttribLocation_header_not_0); 2644 COMPILE_ASSERT(offsetof(GetAttribLocation, program) == 4, 2645 OffsetOf_GetAttribLocation_program_not_4); 2646 COMPILE_ASSERT(offsetof(GetAttribLocation, name_bucket_id) == 8, 2647 OffsetOf_GetAttribLocation_name_bucket_id_not_8); 2648 COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_id) == 12, 2649 OffsetOf_GetAttribLocation_location_shm_id_not_12); 2650 COMPILE_ASSERT(offsetof(GetAttribLocation, location_shm_offset) == 16, 2651 OffsetOf_GetAttribLocation_location_shm_offset_not_16); 2652 2653 struct 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 2691 COMPILE_ASSERT(sizeof(GetBooleanv) == 16, Sizeof_GetBooleanv_is_not_16); 2692 COMPILE_ASSERT(offsetof(GetBooleanv, header) == 0, 2693 OffsetOf_GetBooleanv_header_not_0); 2694 COMPILE_ASSERT(offsetof(GetBooleanv, pname) == 4, 2695 OffsetOf_GetBooleanv_pname_not_4); 2696 COMPILE_ASSERT(offsetof(GetBooleanv, params_shm_id) == 8, 2697 OffsetOf_GetBooleanv_params_shm_id_not_8); 2698 COMPILE_ASSERT(offsetof(GetBooleanv, params_shm_offset) == 12, 2699 OffsetOf_GetBooleanv_params_shm_offset_not_12); 2700 2701 struct 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 2743 COMPILE_ASSERT(sizeof(GetBufferParameteriv) == 20, 2744 Sizeof_GetBufferParameteriv_is_not_20); 2745 COMPILE_ASSERT(offsetof(GetBufferParameteriv, header) == 0, 2746 OffsetOf_GetBufferParameteriv_header_not_0); 2747 COMPILE_ASSERT(offsetof(GetBufferParameteriv, target) == 4, 2748 OffsetOf_GetBufferParameteriv_target_not_4); 2749 COMPILE_ASSERT(offsetof(GetBufferParameteriv, pname) == 8, 2750 OffsetOf_GetBufferParameteriv_pname_not_8); 2751 COMPILE_ASSERT(offsetof(GetBufferParameteriv, params_shm_id) == 12, 2752 OffsetOf_GetBufferParameteriv_params_shm_id_not_12); 2753 COMPILE_ASSERT(offsetof(GetBufferParameteriv, params_shm_offset) == 16, 2754 OffsetOf_GetBufferParameteriv_params_shm_offset_not_16); 2755 2756 struct 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 2786 COMPILE_ASSERT(sizeof(GetError) == 12, Sizeof_GetError_is_not_12); 2787 COMPILE_ASSERT(offsetof(GetError, header) == 0, OffsetOf_GetError_header_not_0); 2788 COMPILE_ASSERT(offsetof(GetError, result_shm_id) == 4, 2789 OffsetOf_GetError_result_shm_id_not_4); 2790 COMPILE_ASSERT(offsetof(GetError, result_shm_offset) == 8, 2791 OffsetOf_GetError_result_shm_offset_not_8); 2792 2793 struct 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 2831 COMPILE_ASSERT(sizeof(GetFloatv) == 16, Sizeof_GetFloatv_is_not_16); 2832 COMPILE_ASSERT(offsetof(GetFloatv, header) == 0, 2833 OffsetOf_GetFloatv_header_not_0); 2834 COMPILE_ASSERT(offsetof(GetFloatv, pname) == 4, OffsetOf_GetFloatv_pname_not_4); 2835 COMPILE_ASSERT(offsetof(GetFloatv, params_shm_id) == 8, 2836 OffsetOf_GetFloatv_params_shm_id_not_8); 2837 COMPILE_ASSERT(offsetof(GetFloatv, params_shm_offset) == 12, 2838 OffsetOf_GetFloatv_params_shm_offset_not_12); 2839 2840 struct 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 2886 COMPILE_ASSERT(sizeof(GetFramebufferAttachmentParameteriv) == 24, 2887 Sizeof_GetFramebufferAttachmentParameteriv_is_not_24); 2888 COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, header) == 0, 2889 OffsetOf_GetFramebufferAttachmentParameteriv_header_not_0); 2890 COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, target) == 4, 2891 OffsetOf_GetFramebufferAttachmentParameteriv_target_not_4); 2892 COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, attachment) == 8, 2893 OffsetOf_GetFramebufferAttachmentParameteriv_attachment_not_8); 2894 COMPILE_ASSERT(offsetof(GetFramebufferAttachmentParameteriv, pname) == 12, 2895 OffsetOf_GetFramebufferAttachmentParameteriv_pname_not_12); 2896 COMPILE_ASSERT( 2897 offsetof(GetFramebufferAttachmentParameteriv, params_shm_id) == 16, 2898 OffsetOf_GetFramebufferAttachmentParameteriv_params_shm_id_not_16); 2899 COMPILE_ASSERT( 2900 offsetof(GetFramebufferAttachmentParameteriv, params_shm_offset) == 20, 2901 OffsetOf_GetFramebufferAttachmentParameteriv_params_shm_offset_not_20); 2902 2903 struct 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 2941 COMPILE_ASSERT(sizeof(GetIntegerv) == 16, Sizeof_GetIntegerv_is_not_16); 2942 COMPILE_ASSERT(offsetof(GetIntegerv, header) == 0, 2943 OffsetOf_GetIntegerv_header_not_0); 2944 COMPILE_ASSERT(offsetof(GetIntegerv, pname) == 4, 2945 OffsetOf_GetIntegerv_pname_not_4); 2946 COMPILE_ASSERT(offsetof(GetIntegerv, params_shm_id) == 8, 2947 OffsetOf_GetIntegerv_params_shm_id_not_8); 2948 COMPILE_ASSERT(offsetof(GetIntegerv, params_shm_offset) == 12, 2949 OffsetOf_GetIntegerv_params_shm_offset_not_12); 2950 2951 struct 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 2993 COMPILE_ASSERT(sizeof(GetProgramiv) == 20, Sizeof_GetProgramiv_is_not_20); 2994 COMPILE_ASSERT(offsetof(GetProgramiv, header) == 0, 2995 OffsetOf_GetProgramiv_header_not_0); 2996 COMPILE_ASSERT(offsetof(GetProgramiv, program) == 4, 2997 OffsetOf_GetProgramiv_program_not_4); 2998 COMPILE_ASSERT(offsetof(GetProgramiv, pname) == 8, 2999 OffsetOf_GetProgramiv_pname_not_8); 3000 COMPILE_ASSERT(offsetof(GetProgramiv, params_shm_id) == 12, 3001 OffsetOf_GetProgramiv_params_shm_id_not_12); 3002 COMPILE_ASSERT(offsetof(GetProgramiv, params_shm_offset) == 16, 3003 OffsetOf_GetProgramiv_params_shm_offset_not_16); 3004 3005 struct 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 3033 COMPILE_ASSERT(sizeof(GetProgramInfoLog) == 12, 3034 Sizeof_GetProgramInfoLog_is_not_12); 3035 COMPILE_ASSERT(offsetof(GetProgramInfoLog, header) == 0, 3036 OffsetOf_GetProgramInfoLog_header_not_0); 3037 COMPILE_ASSERT(offsetof(GetProgramInfoLog, program) == 4, 3038 OffsetOf_GetProgramInfoLog_program_not_4); 3039 COMPILE_ASSERT(offsetof(GetProgramInfoLog, bucket_id) == 8, 3040 OffsetOf_GetProgramInfoLog_bucket_id_not_8); 3041 3042 struct 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 3084 COMPILE_ASSERT(sizeof(GetRenderbufferParameteriv) == 20, 3085 Sizeof_GetRenderbufferParameteriv_is_not_20); 3086 COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, header) == 0, 3087 OffsetOf_GetRenderbufferParameteriv_header_not_0); 3088 COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, target) == 4, 3089 OffsetOf_GetRenderbufferParameteriv_target_not_4); 3090 COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, pname) == 8, 3091 OffsetOf_GetRenderbufferParameteriv_pname_not_8); 3092 COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, params_shm_id) == 12, 3093 OffsetOf_GetRenderbufferParameteriv_params_shm_id_not_12); 3094 COMPILE_ASSERT(offsetof(GetRenderbufferParameteriv, params_shm_offset) == 16, 3095 OffsetOf_GetRenderbufferParameteriv_params_shm_offset_not_16); 3096 3097 struct 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 3139 COMPILE_ASSERT(sizeof(GetShaderiv) == 20, Sizeof_GetShaderiv_is_not_20); 3140 COMPILE_ASSERT(offsetof(GetShaderiv, header) == 0, 3141 OffsetOf_GetShaderiv_header_not_0); 3142 COMPILE_ASSERT(offsetof(GetShaderiv, shader) == 4, 3143 OffsetOf_GetShaderiv_shader_not_4); 3144 COMPILE_ASSERT(offsetof(GetShaderiv, pname) == 8, 3145 OffsetOf_GetShaderiv_pname_not_8); 3146 COMPILE_ASSERT(offsetof(GetShaderiv, params_shm_id) == 12, 3147 OffsetOf_GetShaderiv_params_shm_id_not_12); 3148 COMPILE_ASSERT(offsetof(GetShaderiv, params_shm_offset) == 16, 3149 OffsetOf_GetShaderiv_params_shm_offset_not_16); 3150 3151 struct 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 3179 COMPILE_ASSERT(sizeof(GetShaderInfoLog) == 12, 3180 Sizeof_GetShaderInfoLog_is_not_12); 3181 COMPILE_ASSERT(offsetof(GetShaderInfoLog, header) == 0, 3182 OffsetOf_GetShaderInfoLog_header_not_0); 3183 COMPILE_ASSERT(offsetof(GetShaderInfoLog, shader) == 4, 3184 OffsetOf_GetShaderInfoLog_shader_not_4); 3185 COMPILE_ASSERT(offsetof(GetShaderInfoLog, bucket_id) == 8, 3186 OffsetOf_GetShaderInfoLog_bucket_id_not_8); 3187 3188 struct 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 3235 COMPILE_ASSERT(sizeof(GetShaderPrecisionFormat) == 20, 3236 Sizeof_GetShaderPrecisionFormat_is_not_20); 3237 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, header) == 0, 3238 OffsetOf_GetShaderPrecisionFormat_header_not_0); 3239 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, shadertype) == 4, 3240 OffsetOf_GetShaderPrecisionFormat_shadertype_not_4); 3241 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, precisiontype) == 8, 3242 OffsetOf_GetShaderPrecisionFormat_precisiontype_not_8); 3243 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, result_shm_id) == 12, 3244 OffsetOf_GetShaderPrecisionFormat_result_shm_id_not_12); 3245 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat, result_shm_offset) == 16, 3246 OffsetOf_GetShaderPrecisionFormat_result_shm_offset_not_16); 3247 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, success) == 0, 3248 OffsetOf_GetShaderPrecisionFormat_Result_success_not_0); 3249 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, min_range) == 4, 3250 OffsetOf_GetShaderPrecisionFormat_Result_min_range_not_4); 3251 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, max_range) == 8, 3252 OffsetOf_GetShaderPrecisionFormat_Result_max_range_not_8); 3253 COMPILE_ASSERT(offsetof(GetShaderPrecisionFormat::Result, precision) == 12, 3254 OffsetOf_GetShaderPrecisionFormat_Result_precision_not_12); 3255 3256 struct 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 3284 COMPILE_ASSERT(sizeof(GetShaderSource) == 12, Sizeof_GetShaderSource_is_not_12); 3285 COMPILE_ASSERT(offsetof(GetShaderSource, header) == 0, 3286 OffsetOf_GetShaderSource_header_not_0); 3287 COMPILE_ASSERT(offsetof(GetShaderSource, shader) == 4, 3288 OffsetOf_GetShaderSource_shader_not_4); 3289 COMPILE_ASSERT(offsetof(GetShaderSource, bucket_id) == 8, 3290 OffsetOf_GetShaderSource_bucket_id_not_8); 3291 3292 struct 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 3320 COMPILE_ASSERT(sizeof(GetString) == 12, Sizeof_GetString_is_not_12); 3321 COMPILE_ASSERT(offsetof(GetString, header) == 0, 3322 OffsetOf_GetString_header_not_0); 3323 COMPILE_ASSERT(offsetof(GetString, name) == 4, OffsetOf_GetString_name_not_4); 3324 COMPILE_ASSERT(offsetof(GetString, bucket_id) == 8, 3325 OffsetOf_GetString_bucket_id_not_8); 3326 3327 struct 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 3369 COMPILE_ASSERT(sizeof(GetTexParameterfv) == 20, 3370 Sizeof_GetTexParameterfv_is_not_20); 3371 COMPILE_ASSERT(offsetof(GetTexParameterfv, header) == 0, 3372 OffsetOf_GetTexParameterfv_header_not_0); 3373 COMPILE_ASSERT(offsetof(GetTexParameterfv, target) == 4, 3374 OffsetOf_GetTexParameterfv_target_not_4); 3375 COMPILE_ASSERT(offsetof(GetTexParameterfv, pname) == 8, 3376 OffsetOf_GetTexParameterfv_pname_not_8); 3377 COMPILE_ASSERT(offsetof(GetTexParameterfv, params_shm_id) == 12, 3378 OffsetOf_GetTexParameterfv_params_shm_id_not_12); 3379 COMPILE_ASSERT(offsetof(GetTexParameterfv, params_shm_offset) == 16, 3380 OffsetOf_GetTexParameterfv_params_shm_offset_not_16); 3381 3382 struct 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 3424 COMPILE_ASSERT(sizeof(GetTexParameteriv) == 20, 3425 Sizeof_GetTexParameteriv_is_not_20); 3426 COMPILE_ASSERT(offsetof(GetTexParameteriv, header) == 0, 3427 OffsetOf_GetTexParameteriv_header_not_0); 3428 COMPILE_ASSERT(offsetof(GetTexParameteriv, target) == 4, 3429 OffsetOf_GetTexParameteriv_target_not_4); 3430 COMPILE_ASSERT(offsetof(GetTexParameteriv, pname) == 8, 3431 OffsetOf_GetTexParameteriv_pname_not_8); 3432 COMPILE_ASSERT(offsetof(GetTexParameteriv, params_shm_id) == 12, 3433 OffsetOf_GetTexParameteriv_params_shm_id_not_12); 3434 COMPILE_ASSERT(offsetof(GetTexParameteriv, params_shm_offset) == 16, 3435 OffsetOf_GetTexParameteriv_params_shm_offset_not_16); 3436 3437 struct 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 3479 COMPILE_ASSERT(sizeof(GetUniformfv) == 20, Sizeof_GetUniformfv_is_not_20); 3480 COMPILE_ASSERT(offsetof(GetUniformfv, header) == 0, 3481 OffsetOf_GetUniformfv_header_not_0); 3482 COMPILE_ASSERT(offsetof(GetUniformfv, program) == 4, 3483 OffsetOf_GetUniformfv_program_not_4); 3484 COMPILE_ASSERT(offsetof(GetUniformfv, location) == 8, 3485 OffsetOf_GetUniformfv_location_not_8); 3486 COMPILE_ASSERT(offsetof(GetUniformfv, params_shm_id) == 12, 3487 OffsetOf_GetUniformfv_params_shm_id_not_12); 3488 COMPILE_ASSERT(offsetof(GetUniformfv, params_shm_offset) == 16, 3489 OffsetOf_GetUniformfv_params_shm_offset_not_16); 3490 3491 struct 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 3533 COMPILE_ASSERT(sizeof(GetUniformiv) == 20, Sizeof_GetUniformiv_is_not_20); 3534 COMPILE_ASSERT(offsetof(GetUniformiv, header) == 0, 3535 OffsetOf_GetUniformiv_header_not_0); 3536 COMPILE_ASSERT(offsetof(GetUniformiv, program) == 4, 3537 OffsetOf_GetUniformiv_program_not_4); 3538 COMPILE_ASSERT(offsetof(GetUniformiv, location) == 8, 3539 OffsetOf_GetUniformiv_location_not_8); 3540 COMPILE_ASSERT(offsetof(GetUniformiv, params_shm_id) == 12, 3541 OffsetOf_GetUniformiv_params_shm_id_not_12); 3542 COMPILE_ASSERT(offsetof(GetUniformiv, params_shm_offset) == 16, 3543 OffsetOf_GetUniformiv_params_shm_offset_not_16); 3544 3545 struct 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 3587 COMPILE_ASSERT(sizeof(GetUniformLocation) == 20, 3588 Sizeof_GetUniformLocation_is_not_20); 3589 COMPILE_ASSERT(offsetof(GetUniformLocation, header) == 0, 3590 OffsetOf_GetUniformLocation_header_not_0); 3591 COMPILE_ASSERT(offsetof(GetUniformLocation, program) == 4, 3592 OffsetOf_GetUniformLocation_program_not_4); 3593 COMPILE_ASSERT(offsetof(GetUniformLocation, name_bucket_id) == 8, 3594 OffsetOf_GetUniformLocation_name_bucket_id_not_8); 3595 COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_id) == 12, 3596 OffsetOf_GetUniformLocation_location_shm_id_not_12); 3597 COMPILE_ASSERT(offsetof(GetUniformLocation, location_shm_offset) == 16, 3598 OffsetOf_GetUniformLocation_location_shm_offset_not_16); 3599 3600 struct 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 3642 COMPILE_ASSERT(sizeof(GetVertexAttribfv) == 20, 3643 Sizeof_GetVertexAttribfv_is_not_20); 3644 COMPILE_ASSERT(offsetof(GetVertexAttribfv, header) == 0, 3645 OffsetOf_GetVertexAttribfv_header_not_0); 3646 COMPILE_ASSERT(offsetof(GetVertexAttribfv, index) == 4, 3647 OffsetOf_GetVertexAttribfv_index_not_4); 3648 COMPILE_ASSERT(offsetof(GetVertexAttribfv, pname) == 8, 3649 OffsetOf_GetVertexAttribfv_pname_not_8); 3650 COMPILE_ASSERT(offsetof(GetVertexAttribfv, params_shm_id) == 12, 3651 OffsetOf_GetVertexAttribfv_params_shm_id_not_12); 3652 COMPILE_ASSERT(offsetof(GetVertexAttribfv, params_shm_offset) == 16, 3653 OffsetOf_GetVertexAttribfv_params_shm_offset_not_16); 3654 3655 struct 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 3697 COMPILE_ASSERT(sizeof(GetVertexAttribiv) == 20, 3698 Sizeof_GetVertexAttribiv_is_not_20); 3699 COMPILE_ASSERT(offsetof(GetVertexAttribiv, header) == 0, 3700 OffsetOf_GetVertexAttribiv_header_not_0); 3701 COMPILE_ASSERT(offsetof(GetVertexAttribiv, index) == 4, 3702 OffsetOf_GetVertexAttribiv_index_not_4); 3703 COMPILE_ASSERT(offsetof(GetVertexAttribiv, pname) == 8, 3704 OffsetOf_GetVertexAttribiv_pname_not_8); 3705 COMPILE_ASSERT(offsetof(GetVertexAttribiv, params_shm_id) == 12, 3706 OffsetOf_GetVertexAttribiv_params_shm_id_not_12); 3707 COMPILE_ASSERT(offsetof(GetVertexAttribiv, params_shm_offset) == 16, 3708 OffsetOf_GetVertexAttribiv_params_shm_offset_not_16); 3709 3710 struct 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 3752 COMPILE_ASSERT(sizeof(GetVertexAttribPointerv) == 20, 3753 Sizeof_GetVertexAttribPointerv_is_not_20); 3754 COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, header) == 0, 3755 OffsetOf_GetVertexAttribPointerv_header_not_0); 3756 COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, index) == 4, 3757 OffsetOf_GetVertexAttribPointerv_index_not_4); 3758 COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, pname) == 8, 3759 OffsetOf_GetVertexAttribPointerv_pname_not_8); 3760 COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, pointer_shm_id) == 12, 3761 OffsetOf_GetVertexAttribPointerv_pointer_shm_id_not_12); 3762 COMPILE_ASSERT(offsetof(GetVertexAttribPointerv, pointer_shm_offset) == 16, 3763 OffsetOf_GetVertexAttribPointerv_pointer_shm_offset_not_16); 3764 3765 struct 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 3793 COMPILE_ASSERT(sizeof(Hint) == 12, Sizeof_Hint_is_not_12); 3794 COMPILE_ASSERT(offsetof(Hint, header) == 0, OffsetOf_Hint_header_not_0); 3795 COMPILE_ASSERT(offsetof(Hint, target) == 4, OffsetOf_Hint_target_not_4); 3796 COMPILE_ASSERT(offsetof(Hint, mode) == 8, OffsetOf_Hint_mode_not_8); 3797 3798 struct 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 3836 COMPILE_ASSERT(sizeof(IsBuffer) == 16, Sizeof_IsBuffer_is_not_16); 3837 COMPILE_ASSERT(offsetof(IsBuffer, header) == 0, OffsetOf_IsBuffer_header_not_0); 3838 COMPILE_ASSERT(offsetof(IsBuffer, buffer) == 4, OffsetOf_IsBuffer_buffer_not_4); 3839 COMPILE_ASSERT(offsetof(IsBuffer, result_shm_id) == 8, 3840 OffsetOf_IsBuffer_result_shm_id_not_8); 3841 COMPILE_ASSERT(offsetof(IsBuffer, result_shm_offset) == 12, 3842 OffsetOf_IsBuffer_result_shm_offset_not_12); 3843 3844 struct 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 3880 COMPILE_ASSERT(sizeof(IsEnabled) == 16, Sizeof_IsEnabled_is_not_16); 3881 COMPILE_ASSERT(offsetof(IsEnabled, header) == 0, 3882 OffsetOf_IsEnabled_header_not_0); 3883 COMPILE_ASSERT(offsetof(IsEnabled, cap) == 4, OffsetOf_IsEnabled_cap_not_4); 3884 COMPILE_ASSERT(offsetof(IsEnabled, result_shm_id) == 8, 3885 OffsetOf_IsEnabled_result_shm_id_not_8); 3886 COMPILE_ASSERT(offsetof(IsEnabled, result_shm_offset) == 12, 3887 OffsetOf_IsEnabled_result_shm_offset_not_12); 3888 3889 struct 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 3927 COMPILE_ASSERT(sizeof(IsFramebuffer) == 16, Sizeof_IsFramebuffer_is_not_16); 3928 COMPILE_ASSERT(offsetof(IsFramebuffer, header) == 0, 3929 OffsetOf_IsFramebuffer_header_not_0); 3930 COMPILE_ASSERT(offsetof(IsFramebuffer, framebuffer) == 4, 3931 OffsetOf_IsFramebuffer_framebuffer_not_4); 3932 COMPILE_ASSERT(offsetof(IsFramebuffer, result_shm_id) == 8, 3933 OffsetOf_IsFramebuffer_result_shm_id_not_8); 3934 COMPILE_ASSERT(offsetof(IsFramebuffer, result_shm_offset) == 12, 3935 OffsetOf_IsFramebuffer_result_shm_offset_not_12); 3936 3937 struct 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 3975 COMPILE_ASSERT(sizeof(IsProgram) == 16, Sizeof_IsProgram_is_not_16); 3976 COMPILE_ASSERT(offsetof(IsProgram, header) == 0, 3977 OffsetOf_IsProgram_header_not_0); 3978 COMPILE_ASSERT(offsetof(IsProgram, program) == 4, 3979 OffsetOf_IsProgram_program_not_4); 3980 COMPILE_ASSERT(offsetof(IsProgram, result_shm_id) == 8, 3981 OffsetOf_IsProgram_result_shm_id_not_8); 3982 COMPILE_ASSERT(offsetof(IsProgram, result_shm_offset) == 12, 3983 OffsetOf_IsProgram_result_shm_offset_not_12); 3984 3985 struct 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 4023 COMPILE_ASSERT(sizeof(IsRenderbuffer) == 16, Sizeof_IsRenderbuffer_is_not_16); 4024 COMPILE_ASSERT(offsetof(IsRenderbuffer, header) == 0, 4025 OffsetOf_IsRenderbuffer_header_not_0); 4026 COMPILE_ASSERT(offsetof(IsRenderbuffer, renderbuffer) == 4, 4027 OffsetOf_IsRenderbuffer_renderbuffer_not_4); 4028 COMPILE_ASSERT(offsetof(IsRenderbuffer, result_shm_id) == 8, 4029 OffsetOf_IsRenderbuffer_result_shm_id_not_8); 4030 COMPILE_ASSERT(offsetof(IsRenderbuffer, result_shm_offset) == 12, 4031 OffsetOf_IsRenderbuffer_result_shm_offset_not_12); 4032 4033 struct 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 4071 COMPILE_ASSERT(sizeof(IsShader) == 16, Sizeof_IsShader_is_not_16); 4072 COMPILE_ASSERT(offsetof(IsShader, header) == 0, OffsetOf_IsShader_header_not_0); 4073 COMPILE_ASSERT(offsetof(IsShader, shader) == 4, OffsetOf_IsShader_shader_not_4); 4074 COMPILE_ASSERT(offsetof(IsShader, result_shm_id) == 8, 4075 OffsetOf_IsShader_result_shm_id_not_8); 4076 COMPILE_ASSERT(offsetof(IsShader, result_shm_offset) == 12, 4077 OffsetOf_IsShader_result_shm_offset_not_12); 4078 4079 struct 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 4117 COMPILE_ASSERT(sizeof(IsTexture) == 16, Sizeof_IsTexture_is_not_16); 4118 COMPILE_ASSERT(offsetof(IsTexture, header) == 0, 4119 OffsetOf_IsTexture_header_not_0); 4120 COMPILE_ASSERT(offsetof(IsTexture, texture) == 4, 4121 OffsetOf_IsTexture_texture_not_4); 4122 COMPILE_ASSERT(offsetof(IsTexture, result_shm_id) == 8, 4123 OffsetOf_IsTexture_result_shm_id_not_8); 4124 COMPILE_ASSERT(offsetof(IsTexture, result_shm_offset) == 12, 4125 OffsetOf_IsTexture_result_shm_offset_not_12); 4126 4127 struct 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 4153 COMPILE_ASSERT(sizeof(LineWidth) == 8, Sizeof_LineWidth_is_not_8); 4154 COMPILE_ASSERT(offsetof(LineWidth, header) == 0, 4155 OffsetOf_LineWidth_header_not_0); 4156 COMPILE_ASSERT(offsetof(LineWidth, width) == 4, OffsetOf_LineWidth_width_not_4); 4157 4158 struct 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 4184 COMPILE_ASSERT(sizeof(LinkProgram) == 8, Sizeof_LinkProgram_is_not_8); 4185 COMPILE_ASSERT(offsetof(LinkProgram, header) == 0, 4186 OffsetOf_LinkProgram_header_not_0); 4187 COMPILE_ASSERT(offsetof(LinkProgram, program) == 4, 4188 OffsetOf_LinkProgram_program_not_4); 4189 4190 struct 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 4218 COMPILE_ASSERT(sizeof(PixelStorei) == 12, Sizeof_PixelStorei_is_not_12); 4219 COMPILE_ASSERT(offsetof(PixelStorei, header) == 0, 4220 OffsetOf_PixelStorei_header_not_0); 4221 COMPILE_ASSERT(offsetof(PixelStorei, pname) == 4, 4222 OffsetOf_PixelStorei_pname_not_4); 4223 COMPILE_ASSERT(offsetof(PixelStorei, param) == 8, 4224 OffsetOf_PixelStorei_param_not_8); 4225 4226 struct 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 4254 COMPILE_ASSERT(sizeof(PolygonOffset) == 12, Sizeof_PolygonOffset_is_not_12); 4255 COMPILE_ASSERT(offsetof(PolygonOffset, header) == 0, 4256 OffsetOf_PolygonOffset_header_not_0); 4257 COMPILE_ASSERT(offsetof(PolygonOffset, factor) == 4, 4258 OffsetOf_PolygonOffset_factor_not_4); 4259 COMPILE_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. 4265 struct 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 format = _format; 4296 type = _type; 4297 pixels_shm_id = _pixels_shm_id; 4298 pixels_shm_offset = _pixels_shm_offset; 4299 result_shm_id = _result_shm_id; 4300 result_shm_offset = _result_shm_offset; 4301 async = _async; 4302 } 4303 4304 void* Set(void* cmd, 4305 GLint _x, 4306 GLint _y, 4307 GLsizei _width, 4308 GLsizei _height, 4309 GLenum _format, 4310 GLenum _type, 4311 uint32_t _pixels_shm_id, 4312 uint32_t _pixels_shm_offset, 4313 uint32_t _result_shm_id, 4314 uint32_t _result_shm_offset, 4315 GLboolean _async) { 4316 static_cast<ValueType*>(cmd)->Init(_x, 4317 _y, 4318 _width, 4319 _height, 4320 _format, 4321 _type, 4322 _pixels_shm_id, 4323 _pixels_shm_offset, 4324 _result_shm_id, 4325 _result_shm_offset, 4326 _async); 4327 return NextCmdAddress<ValueType>(cmd); 4328 } 4329 4330 gpu::CommandHeader header; 4331 int32_t x; 4332 int32_t y; 4333 int32_t width; 4334 int32_t height; 4335 uint32_t format; 4336 uint32_t type; 4337 uint32_t pixels_shm_id; 4338 uint32_t pixels_shm_offset; 4339 uint32_t result_shm_id; 4340 uint32_t result_shm_offset; 4341 uint32_t async; 4342 }; 4343 4344 COMPILE_ASSERT(sizeof(ReadPixels) == 48, Sizeof_ReadPixels_is_not_48); 4345 COMPILE_ASSERT(offsetof(ReadPixels, header) == 0, 4346 OffsetOf_ReadPixels_header_not_0); 4347 COMPILE_ASSERT(offsetof(ReadPixels, x) == 4, OffsetOf_ReadPixels_x_not_4); 4348 COMPILE_ASSERT(offsetof(ReadPixels, y) == 8, OffsetOf_ReadPixels_y_not_8); 4349 COMPILE_ASSERT(offsetof(ReadPixels, width) == 12, 4350 OffsetOf_ReadPixels_width_not_12); 4351 COMPILE_ASSERT(offsetof(ReadPixels, height) == 16, 4352 OffsetOf_ReadPixels_height_not_16); 4353 COMPILE_ASSERT(offsetof(ReadPixels, format) == 20, 4354 OffsetOf_ReadPixels_format_not_20); 4355 COMPILE_ASSERT(offsetof(ReadPixels, type) == 24, 4356 OffsetOf_ReadPixels_type_not_24); 4357 COMPILE_ASSERT(offsetof(ReadPixels, pixels_shm_id) == 28, 4358 OffsetOf_ReadPixels_pixels_shm_id_not_28); 4359 COMPILE_ASSERT(offsetof(ReadPixels, pixels_shm_offset) == 32, 4360 OffsetOf_ReadPixels_pixels_shm_offset_not_32); 4361 COMPILE_ASSERT(offsetof(ReadPixels, result_shm_id) == 36, 4362 OffsetOf_ReadPixels_result_shm_id_not_36); 4363 COMPILE_ASSERT(offsetof(ReadPixels, result_shm_offset) == 40, 4364 OffsetOf_ReadPixels_result_shm_offset_not_40); 4365 COMPILE_ASSERT(offsetof(ReadPixels, async) == 44, 4366 OffsetOf_ReadPixels_async_not_44); 4367 4368 struct ReleaseShaderCompiler { 4369 typedef ReleaseShaderCompiler ValueType; 4370 static const CommandId kCmdId = kReleaseShaderCompiler; 4371 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4372 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4373 4374 static uint32_t ComputeSize() { 4375 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4376 } 4377 4378 void SetHeader() { header.SetCmd<ValueType>(); } 4379 4380 void Init() { SetHeader(); } 4381 4382 void* Set(void* cmd) { 4383 static_cast<ValueType*>(cmd)->Init(); 4384 return NextCmdAddress<ValueType>(cmd); 4385 } 4386 4387 gpu::CommandHeader header; 4388 }; 4389 4390 COMPILE_ASSERT(sizeof(ReleaseShaderCompiler) == 4, 4391 Sizeof_ReleaseShaderCompiler_is_not_4); 4392 COMPILE_ASSERT(offsetof(ReleaseShaderCompiler, header) == 0, 4393 OffsetOf_ReleaseShaderCompiler_header_not_0); 4394 4395 struct RenderbufferStorage { 4396 typedef RenderbufferStorage ValueType; 4397 static const CommandId kCmdId = kRenderbufferStorage; 4398 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4399 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4400 4401 static uint32_t ComputeSize() { 4402 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4403 } 4404 4405 void SetHeader() { header.SetCmd<ValueType>(); } 4406 4407 void Init(GLenum _target, 4408 GLenum _internalformat, 4409 GLsizei _width, 4410 GLsizei _height) { 4411 SetHeader(); 4412 target = _target; 4413 internalformat = _internalformat; 4414 width = _width; 4415 height = _height; 4416 } 4417 4418 void* Set(void* cmd, 4419 GLenum _target, 4420 GLenum _internalformat, 4421 GLsizei _width, 4422 GLsizei _height) { 4423 static_cast<ValueType*>(cmd) 4424 ->Init(_target, _internalformat, _width, _height); 4425 return NextCmdAddress<ValueType>(cmd); 4426 } 4427 4428 gpu::CommandHeader header; 4429 uint32_t target; 4430 uint32_t internalformat; 4431 int32_t width; 4432 int32_t height; 4433 }; 4434 4435 COMPILE_ASSERT(sizeof(RenderbufferStorage) == 20, 4436 Sizeof_RenderbufferStorage_is_not_20); 4437 COMPILE_ASSERT(offsetof(RenderbufferStorage, header) == 0, 4438 OffsetOf_RenderbufferStorage_header_not_0); 4439 COMPILE_ASSERT(offsetof(RenderbufferStorage, target) == 4, 4440 OffsetOf_RenderbufferStorage_target_not_4); 4441 COMPILE_ASSERT(offsetof(RenderbufferStorage, internalformat) == 8, 4442 OffsetOf_RenderbufferStorage_internalformat_not_8); 4443 COMPILE_ASSERT(offsetof(RenderbufferStorage, width) == 12, 4444 OffsetOf_RenderbufferStorage_width_not_12); 4445 COMPILE_ASSERT(offsetof(RenderbufferStorage, height) == 16, 4446 OffsetOf_RenderbufferStorage_height_not_16); 4447 4448 struct SampleCoverage { 4449 typedef SampleCoverage ValueType; 4450 static const CommandId kCmdId = kSampleCoverage; 4451 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4452 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4453 4454 static uint32_t ComputeSize() { 4455 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4456 } 4457 4458 void SetHeader() { header.SetCmd<ValueType>(); } 4459 4460 void Init(GLclampf _value, GLboolean _invert) { 4461 SetHeader(); 4462 value = _value; 4463 invert = _invert; 4464 } 4465 4466 void* Set(void* cmd, GLclampf _value, GLboolean _invert) { 4467 static_cast<ValueType*>(cmd)->Init(_value, _invert); 4468 return NextCmdAddress<ValueType>(cmd); 4469 } 4470 4471 gpu::CommandHeader header; 4472 float value; 4473 uint32_t invert; 4474 }; 4475 4476 COMPILE_ASSERT(sizeof(SampleCoverage) == 12, Sizeof_SampleCoverage_is_not_12); 4477 COMPILE_ASSERT(offsetof(SampleCoverage, header) == 0, 4478 OffsetOf_SampleCoverage_header_not_0); 4479 COMPILE_ASSERT(offsetof(SampleCoverage, value) == 4, 4480 OffsetOf_SampleCoverage_value_not_4); 4481 COMPILE_ASSERT(offsetof(SampleCoverage, invert) == 8, 4482 OffsetOf_SampleCoverage_invert_not_8); 4483 4484 struct Scissor { 4485 typedef Scissor ValueType; 4486 static const CommandId kCmdId = kScissor; 4487 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4488 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4489 4490 static uint32_t ComputeSize() { 4491 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4492 } 4493 4494 void SetHeader() { header.SetCmd<ValueType>(); } 4495 4496 void Init(GLint _x, GLint _y, GLsizei _width, GLsizei _height) { 4497 SetHeader(); 4498 x = _x; 4499 y = _y; 4500 width = _width; 4501 height = _height; 4502 } 4503 4504 void* Set(void* cmd, GLint _x, GLint _y, GLsizei _width, GLsizei _height) { 4505 static_cast<ValueType*>(cmd)->Init(_x, _y, _width, _height); 4506 return NextCmdAddress<ValueType>(cmd); 4507 } 4508 4509 gpu::CommandHeader header; 4510 int32_t x; 4511 int32_t y; 4512 int32_t width; 4513 int32_t height; 4514 }; 4515 4516 COMPILE_ASSERT(sizeof(Scissor) == 20, Sizeof_Scissor_is_not_20); 4517 COMPILE_ASSERT(offsetof(Scissor, header) == 0, OffsetOf_Scissor_header_not_0); 4518 COMPILE_ASSERT(offsetof(Scissor, x) == 4, OffsetOf_Scissor_x_not_4); 4519 COMPILE_ASSERT(offsetof(Scissor, y) == 8, OffsetOf_Scissor_y_not_8); 4520 COMPILE_ASSERT(offsetof(Scissor, width) == 12, OffsetOf_Scissor_width_not_12); 4521 COMPILE_ASSERT(offsetof(Scissor, height) == 16, OffsetOf_Scissor_height_not_16); 4522 4523 struct ShaderBinary { 4524 typedef ShaderBinary ValueType; 4525 static const CommandId kCmdId = kShaderBinary; 4526 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4527 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4528 4529 static uint32_t ComputeSize() { 4530 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4531 } 4532 4533 void SetHeader() { header.SetCmd<ValueType>(); } 4534 4535 void Init(GLsizei _n, 4536 uint32_t _shaders_shm_id, 4537 uint32_t _shaders_shm_offset, 4538 GLenum _binaryformat, 4539 uint32_t _binary_shm_id, 4540 uint32_t _binary_shm_offset, 4541 GLsizei _length) { 4542 SetHeader(); 4543 n = _n; 4544 shaders_shm_id = _shaders_shm_id; 4545 shaders_shm_offset = _shaders_shm_offset; 4546 binaryformat = _binaryformat; 4547 binary_shm_id = _binary_shm_id; 4548 binary_shm_offset = _binary_shm_offset; 4549 length = _length; 4550 } 4551 4552 void* Set(void* cmd, 4553 GLsizei _n, 4554 uint32_t _shaders_shm_id, 4555 uint32_t _shaders_shm_offset, 4556 GLenum _binaryformat, 4557 uint32_t _binary_shm_id, 4558 uint32_t _binary_shm_offset, 4559 GLsizei _length) { 4560 static_cast<ValueType*>(cmd)->Init(_n, 4561 _shaders_shm_id, 4562 _shaders_shm_offset, 4563 _binaryformat, 4564 _binary_shm_id, 4565 _binary_shm_offset, 4566 _length); 4567 return NextCmdAddress<ValueType>(cmd); 4568 } 4569 4570 gpu::CommandHeader header; 4571 int32_t n; 4572 uint32_t shaders_shm_id; 4573 uint32_t shaders_shm_offset; 4574 uint32_t binaryformat; 4575 uint32_t binary_shm_id; 4576 uint32_t binary_shm_offset; 4577 int32_t length; 4578 }; 4579 4580 COMPILE_ASSERT(sizeof(ShaderBinary) == 32, Sizeof_ShaderBinary_is_not_32); 4581 COMPILE_ASSERT(offsetof(ShaderBinary, header) == 0, 4582 OffsetOf_ShaderBinary_header_not_0); 4583 COMPILE_ASSERT(offsetof(ShaderBinary, n) == 4, OffsetOf_ShaderBinary_n_not_4); 4584 COMPILE_ASSERT(offsetof(ShaderBinary, shaders_shm_id) == 8, 4585 OffsetOf_ShaderBinary_shaders_shm_id_not_8); 4586 COMPILE_ASSERT(offsetof(ShaderBinary, shaders_shm_offset) == 12, 4587 OffsetOf_ShaderBinary_shaders_shm_offset_not_12); 4588 COMPILE_ASSERT(offsetof(ShaderBinary, binaryformat) == 16, 4589 OffsetOf_ShaderBinary_binaryformat_not_16); 4590 COMPILE_ASSERT(offsetof(ShaderBinary, binary_shm_id) == 20, 4591 OffsetOf_ShaderBinary_binary_shm_id_not_20); 4592 COMPILE_ASSERT(offsetof(ShaderBinary, binary_shm_offset) == 24, 4593 OffsetOf_ShaderBinary_binary_shm_offset_not_24); 4594 COMPILE_ASSERT(offsetof(ShaderBinary, length) == 28, 4595 OffsetOf_ShaderBinary_length_not_28); 4596 4597 struct ShaderSourceBucket { 4598 typedef ShaderSourceBucket ValueType; 4599 static const CommandId kCmdId = kShaderSourceBucket; 4600 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4601 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4602 4603 static uint32_t ComputeSize() { 4604 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4605 } 4606 4607 void SetHeader() { header.SetCmd<ValueType>(); } 4608 4609 void Init(GLuint _shader, uint32_t _data_bucket_id) { 4610 SetHeader(); 4611 shader = _shader; 4612 data_bucket_id = _data_bucket_id; 4613 } 4614 4615 void* Set(void* cmd, GLuint _shader, uint32_t _data_bucket_id) { 4616 static_cast<ValueType*>(cmd)->Init(_shader, _data_bucket_id); 4617 return NextCmdAddress<ValueType>(cmd); 4618 } 4619 4620 gpu::CommandHeader header; 4621 uint32_t shader; 4622 uint32_t data_bucket_id; 4623 }; 4624 4625 COMPILE_ASSERT(sizeof(ShaderSourceBucket) == 12, 4626 Sizeof_ShaderSourceBucket_is_not_12); 4627 COMPILE_ASSERT(offsetof(ShaderSourceBucket, header) == 0, 4628 OffsetOf_ShaderSourceBucket_header_not_0); 4629 COMPILE_ASSERT(offsetof(ShaderSourceBucket, shader) == 4, 4630 OffsetOf_ShaderSourceBucket_shader_not_4); 4631 COMPILE_ASSERT(offsetof(ShaderSourceBucket, data_bucket_id) == 8, 4632 OffsetOf_ShaderSourceBucket_data_bucket_id_not_8); 4633 4634 struct StencilFunc { 4635 typedef StencilFunc ValueType; 4636 static const CommandId kCmdId = kStencilFunc; 4637 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4638 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4639 4640 static uint32_t ComputeSize() { 4641 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4642 } 4643 4644 void SetHeader() { header.SetCmd<ValueType>(); } 4645 4646 void Init(GLenum _func, GLint _ref, GLuint _mask) { 4647 SetHeader(); 4648 func = _func; 4649 ref = _ref; 4650 mask = _mask; 4651 } 4652 4653 void* Set(void* cmd, GLenum _func, GLint _ref, GLuint _mask) { 4654 static_cast<ValueType*>(cmd)->Init(_func, _ref, _mask); 4655 return NextCmdAddress<ValueType>(cmd); 4656 } 4657 4658 gpu::CommandHeader header; 4659 uint32_t func; 4660 int32_t ref; 4661 uint32_t mask; 4662 }; 4663 4664 COMPILE_ASSERT(sizeof(StencilFunc) == 16, Sizeof_StencilFunc_is_not_16); 4665 COMPILE_ASSERT(offsetof(StencilFunc, header) == 0, 4666 OffsetOf_StencilFunc_header_not_0); 4667 COMPILE_ASSERT(offsetof(StencilFunc, func) == 4, 4668 OffsetOf_StencilFunc_func_not_4); 4669 COMPILE_ASSERT(offsetof(StencilFunc, ref) == 8, OffsetOf_StencilFunc_ref_not_8); 4670 COMPILE_ASSERT(offsetof(StencilFunc, mask) == 12, 4671 OffsetOf_StencilFunc_mask_not_12); 4672 4673 struct StencilFuncSeparate { 4674 typedef StencilFuncSeparate ValueType; 4675 static const CommandId kCmdId = kStencilFuncSeparate; 4676 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4677 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4678 4679 static uint32_t ComputeSize() { 4680 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4681 } 4682 4683 void SetHeader() { header.SetCmd<ValueType>(); } 4684 4685 void Init(GLenum _face, GLenum _func, GLint _ref, GLuint _mask) { 4686 SetHeader(); 4687 face = _face; 4688 func = _func; 4689 ref = _ref; 4690 mask = _mask; 4691 } 4692 4693 void* Set(void* cmd, GLenum _face, GLenum _func, GLint _ref, GLuint _mask) { 4694 static_cast<ValueType*>(cmd)->Init(_face, _func, _ref, _mask); 4695 return NextCmdAddress<ValueType>(cmd); 4696 } 4697 4698 gpu::CommandHeader header; 4699 uint32_t face; 4700 uint32_t func; 4701 int32_t ref; 4702 uint32_t mask; 4703 }; 4704 4705 COMPILE_ASSERT(sizeof(StencilFuncSeparate) == 20, 4706 Sizeof_StencilFuncSeparate_is_not_20); 4707 COMPILE_ASSERT(offsetof(StencilFuncSeparate, header) == 0, 4708 OffsetOf_StencilFuncSeparate_header_not_0); 4709 COMPILE_ASSERT(offsetof(StencilFuncSeparate, face) == 4, 4710 OffsetOf_StencilFuncSeparate_face_not_4); 4711 COMPILE_ASSERT(offsetof(StencilFuncSeparate, func) == 8, 4712 OffsetOf_StencilFuncSeparate_func_not_8); 4713 COMPILE_ASSERT(offsetof(StencilFuncSeparate, ref) == 12, 4714 OffsetOf_StencilFuncSeparate_ref_not_12); 4715 COMPILE_ASSERT(offsetof(StencilFuncSeparate, mask) == 16, 4716 OffsetOf_StencilFuncSeparate_mask_not_16); 4717 4718 struct StencilMask { 4719 typedef StencilMask ValueType; 4720 static const CommandId kCmdId = kStencilMask; 4721 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4722 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4723 4724 static uint32_t ComputeSize() { 4725 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4726 } 4727 4728 void SetHeader() { header.SetCmd<ValueType>(); } 4729 4730 void Init(GLuint _mask) { 4731 SetHeader(); 4732 mask = _mask; 4733 } 4734 4735 void* Set(void* cmd, GLuint _mask) { 4736 static_cast<ValueType*>(cmd)->Init(_mask); 4737 return NextCmdAddress<ValueType>(cmd); 4738 } 4739 4740 gpu::CommandHeader header; 4741 uint32_t mask; 4742 }; 4743 4744 COMPILE_ASSERT(sizeof(StencilMask) == 8, Sizeof_StencilMask_is_not_8); 4745 COMPILE_ASSERT(offsetof(StencilMask, header) == 0, 4746 OffsetOf_StencilMask_header_not_0); 4747 COMPILE_ASSERT(offsetof(StencilMask, mask) == 4, 4748 OffsetOf_StencilMask_mask_not_4); 4749 4750 struct StencilMaskSeparate { 4751 typedef StencilMaskSeparate ValueType; 4752 static const CommandId kCmdId = kStencilMaskSeparate; 4753 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4754 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4755 4756 static uint32_t ComputeSize() { 4757 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4758 } 4759 4760 void SetHeader() { header.SetCmd<ValueType>(); } 4761 4762 void Init(GLenum _face, GLuint _mask) { 4763 SetHeader(); 4764 face = _face; 4765 mask = _mask; 4766 } 4767 4768 void* Set(void* cmd, GLenum _face, GLuint _mask) { 4769 static_cast<ValueType*>(cmd)->Init(_face, _mask); 4770 return NextCmdAddress<ValueType>(cmd); 4771 } 4772 4773 gpu::CommandHeader header; 4774 uint32_t face; 4775 uint32_t mask; 4776 }; 4777 4778 COMPILE_ASSERT(sizeof(StencilMaskSeparate) == 12, 4779 Sizeof_StencilMaskSeparate_is_not_12); 4780 COMPILE_ASSERT(offsetof(StencilMaskSeparate, header) == 0, 4781 OffsetOf_StencilMaskSeparate_header_not_0); 4782 COMPILE_ASSERT(offsetof(StencilMaskSeparate, face) == 4, 4783 OffsetOf_StencilMaskSeparate_face_not_4); 4784 COMPILE_ASSERT(offsetof(StencilMaskSeparate, mask) == 8, 4785 OffsetOf_StencilMaskSeparate_mask_not_8); 4786 4787 struct StencilOp { 4788 typedef StencilOp ValueType; 4789 static const CommandId kCmdId = kStencilOp; 4790 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4791 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4792 4793 static uint32_t ComputeSize() { 4794 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4795 } 4796 4797 void SetHeader() { header.SetCmd<ValueType>(); } 4798 4799 void Init(GLenum _fail, GLenum _zfail, GLenum _zpass) { 4800 SetHeader(); 4801 fail = _fail; 4802 zfail = _zfail; 4803 zpass = _zpass; 4804 } 4805 4806 void* Set(void* cmd, GLenum _fail, GLenum _zfail, GLenum _zpass) { 4807 static_cast<ValueType*>(cmd)->Init(_fail, _zfail, _zpass); 4808 return NextCmdAddress<ValueType>(cmd); 4809 } 4810 4811 gpu::CommandHeader header; 4812 uint32_t fail; 4813 uint32_t zfail; 4814 uint32_t zpass; 4815 }; 4816 4817 COMPILE_ASSERT(sizeof(StencilOp) == 16, Sizeof_StencilOp_is_not_16); 4818 COMPILE_ASSERT(offsetof(StencilOp, header) == 0, 4819 OffsetOf_StencilOp_header_not_0); 4820 COMPILE_ASSERT(offsetof(StencilOp, fail) == 4, OffsetOf_StencilOp_fail_not_4); 4821 COMPILE_ASSERT(offsetof(StencilOp, zfail) == 8, OffsetOf_StencilOp_zfail_not_8); 4822 COMPILE_ASSERT(offsetof(StencilOp, zpass) == 12, 4823 OffsetOf_StencilOp_zpass_not_12); 4824 4825 struct StencilOpSeparate { 4826 typedef StencilOpSeparate ValueType; 4827 static const CommandId kCmdId = kStencilOpSeparate; 4828 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4829 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4830 4831 static uint32_t ComputeSize() { 4832 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4833 } 4834 4835 void SetHeader() { header.SetCmd<ValueType>(); } 4836 4837 void Init(GLenum _face, GLenum _fail, GLenum _zfail, GLenum _zpass) { 4838 SetHeader(); 4839 face = _face; 4840 fail = _fail; 4841 zfail = _zfail; 4842 zpass = _zpass; 4843 } 4844 4845 void* Set(void* cmd, 4846 GLenum _face, 4847 GLenum _fail, 4848 GLenum _zfail, 4849 GLenum _zpass) { 4850 static_cast<ValueType*>(cmd)->Init(_face, _fail, _zfail, _zpass); 4851 return NextCmdAddress<ValueType>(cmd); 4852 } 4853 4854 gpu::CommandHeader header; 4855 uint32_t face; 4856 uint32_t fail; 4857 uint32_t zfail; 4858 uint32_t zpass; 4859 }; 4860 4861 COMPILE_ASSERT(sizeof(StencilOpSeparate) == 20, 4862 Sizeof_StencilOpSeparate_is_not_20); 4863 COMPILE_ASSERT(offsetof(StencilOpSeparate, header) == 0, 4864 OffsetOf_StencilOpSeparate_header_not_0); 4865 COMPILE_ASSERT(offsetof(StencilOpSeparate, face) == 4, 4866 OffsetOf_StencilOpSeparate_face_not_4); 4867 COMPILE_ASSERT(offsetof(StencilOpSeparate, fail) == 8, 4868 OffsetOf_StencilOpSeparate_fail_not_8); 4869 COMPILE_ASSERT(offsetof(StencilOpSeparate, zfail) == 12, 4870 OffsetOf_StencilOpSeparate_zfail_not_12); 4871 COMPILE_ASSERT(offsetof(StencilOpSeparate, zpass) == 16, 4872 OffsetOf_StencilOpSeparate_zpass_not_16); 4873 4874 struct TexImage2D { 4875 typedef TexImage2D ValueType; 4876 static const CommandId kCmdId = kTexImage2D; 4877 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4878 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4879 4880 static uint32_t ComputeSize() { 4881 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4882 } 4883 4884 void SetHeader() { header.SetCmd<ValueType>(); } 4885 4886 void Init(GLenum _target, 4887 GLint _level, 4888 GLint _internalformat, 4889 GLsizei _width, 4890 GLsizei _height, 4891 GLenum _format, 4892 GLenum _type, 4893 uint32_t _pixels_shm_id, 4894 uint32_t _pixels_shm_offset) { 4895 SetHeader(); 4896 target = _target; 4897 level = _level; 4898 internalformat = _internalformat; 4899 width = _width; 4900 height = _height; 4901 format = _format; 4902 type = _type; 4903 pixels_shm_id = _pixels_shm_id; 4904 pixels_shm_offset = _pixels_shm_offset; 4905 } 4906 4907 void* Set(void* cmd, 4908 GLenum _target, 4909 GLint _level, 4910 GLint _internalformat, 4911 GLsizei _width, 4912 GLsizei _height, 4913 GLenum _format, 4914 GLenum _type, 4915 uint32_t _pixels_shm_id, 4916 uint32_t _pixels_shm_offset) { 4917 static_cast<ValueType*>(cmd)->Init(_target, 4918 _level, 4919 _internalformat, 4920 _width, 4921 _height, 4922 _format, 4923 _type, 4924 _pixels_shm_id, 4925 _pixels_shm_offset); 4926 return NextCmdAddress<ValueType>(cmd); 4927 } 4928 4929 gpu::CommandHeader header; 4930 uint32_t target; 4931 int32_t level; 4932 int32_t internalformat; 4933 int32_t width; 4934 int32_t height; 4935 uint32_t format; 4936 uint32_t type; 4937 uint32_t pixels_shm_id; 4938 uint32_t pixels_shm_offset; 4939 static const int32_t border = 0; 4940 }; 4941 4942 COMPILE_ASSERT(sizeof(TexImage2D) == 40, Sizeof_TexImage2D_is_not_40); 4943 COMPILE_ASSERT(offsetof(TexImage2D, header) == 0, 4944 OffsetOf_TexImage2D_header_not_0); 4945 COMPILE_ASSERT(offsetof(TexImage2D, target) == 4, 4946 OffsetOf_TexImage2D_target_not_4); 4947 COMPILE_ASSERT(offsetof(TexImage2D, level) == 8, 4948 OffsetOf_TexImage2D_level_not_8); 4949 COMPILE_ASSERT(offsetof(TexImage2D, internalformat) == 12, 4950 OffsetOf_TexImage2D_internalformat_not_12); 4951 COMPILE_ASSERT(offsetof(TexImage2D, width) == 16, 4952 OffsetOf_TexImage2D_width_not_16); 4953 COMPILE_ASSERT(offsetof(TexImage2D, height) == 20, 4954 OffsetOf_TexImage2D_height_not_20); 4955 COMPILE_ASSERT(offsetof(TexImage2D, format) == 24, 4956 OffsetOf_TexImage2D_format_not_24); 4957 COMPILE_ASSERT(offsetof(TexImage2D, type) == 28, 4958 OffsetOf_TexImage2D_type_not_28); 4959 COMPILE_ASSERT(offsetof(TexImage2D, pixels_shm_id) == 32, 4960 OffsetOf_TexImage2D_pixels_shm_id_not_32); 4961 COMPILE_ASSERT(offsetof(TexImage2D, pixels_shm_offset) == 36, 4962 OffsetOf_TexImage2D_pixels_shm_offset_not_36); 4963 4964 struct TexParameterf { 4965 typedef TexParameterf ValueType; 4966 static const CommandId kCmdId = kTexParameterf; 4967 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4968 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4969 4970 static uint32_t ComputeSize() { 4971 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4972 } 4973 4974 void SetHeader() { header.SetCmd<ValueType>(); } 4975 4976 void Init(GLenum _target, GLenum _pname, GLfloat _param) { 4977 SetHeader(); 4978 target = _target; 4979 pname = _pname; 4980 param = _param; 4981 } 4982 4983 void* Set(void* cmd, GLenum _target, GLenum _pname, GLfloat _param) { 4984 static_cast<ValueType*>(cmd)->Init(_target, _pname, _param); 4985 return NextCmdAddress<ValueType>(cmd); 4986 } 4987 4988 gpu::CommandHeader header; 4989 uint32_t target; 4990 uint32_t pname; 4991 float param; 4992 }; 4993 4994 COMPILE_ASSERT(sizeof(TexParameterf) == 16, Sizeof_TexParameterf_is_not_16); 4995 COMPILE_ASSERT(offsetof(TexParameterf, header) == 0, 4996 OffsetOf_TexParameterf_header_not_0); 4997 COMPILE_ASSERT(offsetof(TexParameterf, target) == 4, 4998 OffsetOf_TexParameterf_target_not_4); 4999 COMPILE_ASSERT(offsetof(TexParameterf, pname) == 8, 5000 OffsetOf_TexParameterf_pname_not_8); 5001 COMPILE_ASSERT(offsetof(TexParameterf, param) == 12, 5002 OffsetOf_TexParameterf_param_not_12); 5003 5004 struct TexParameterfvImmediate { 5005 typedef TexParameterfvImmediate ValueType; 5006 static const CommandId kCmdId = kTexParameterfvImmediate; 5007 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5008 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5009 5010 static uint32_t ComputeDataSize() { 5011 return static_cast<uint32_t>(sizeof(GLfloat) * 1); // NOLINT 5012 } 5013 5014 static uint32_t ComputeSize() { 5015 return static_cast<uint32_t>(sizeof(ValueType) + 5016 ComputeDataSize()); // NOLINT 5017 } 5018 5019 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 5020 5021 void Init(GLenum _target, GLenum _pname, const GLfloat* _params) { 5022 SetHeader(); 5023 target = _target; 5024 pname = _pname; 5025 memcpy(ImmediateDataAddress(this), _params, ComputeDataSize()); 5026 } 5027 5028 void* Set(void* cmd, GLenum _target, GLenum _pname, const GLfloat* _params) { 5029 static_cast<ValueType*>(cmd)->Init(_target, _pname, _params); 5030 const uint32_t size = ComputeSize(); 5031 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5032 } 5033 5034 gpu::CommandHeader header; 5035 uint32_t target; 5036 uint32_t pname; 5037 }; 5038 5039 COMPILE_ASSERT(sizeof(TexParameterfvImmediate) == 12, 5040 Sizeof_TexParameterfvImmediate_is_not_12); 5041 COMPILE_ASSERT(offsetof(TexParameterfvImmediate, header) == 0, 5042 OffsetOf_TexParameterfvImmediate_header_not_0); 5043 COMPILE_ASSERT(offsetof(TexParameterfvImmediate, target) == 4, 5044 OffsetOf_TexParameterfvImmediate_target_not_4); 5045 COMPILE_ASSERT(offsetof(TexParameterfvImmediate, pname) == 8, 5046 OffsetOf_TexParameterfvImmediate_pname_not_8); 5047 5048 struct TexParameteri { 5049 typedef TexParameteri ValueType; 5050 static const CommandId kCmdId = kTexParameteri; 5051 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5052 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5053 5054 static uint32_t ComputeSize() { 5055 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5056 } 5057 5058 void SetHeader() { header.SetCmd<ValueType>(); } 5059 5060 void Init(GLenum _target, GLenum _pname, GLint _param) { 5061 SetHeader(); 5062 target = _target; 5063 pname = _pname; 5064 param = _param; 5065 } 5066 5067 void* Set(void* cmd, GLenum _target, GLenum _pname, GLint _param) { 5068 static_cast<ValueType*>(cmd)->Init(_target, _pname, _param); 5069 return NextCmdAddress<ValueType>(cmd); 5070 } 5071 5072 gpu::CommandHeader header; 5073 uint32_t target; 5074 uint32_t pname; 5075 int32_t param; 5076 }; 5077 5078 COMPILE_ASSERT(sizeof(TexParameteri) == 16, Sizeof_TexParameteri_is_not_16); 5079 COMPILE_ASSERT(offsetof(TexParameteri, header) == 0, 5080 OffsetOf_TexParameteri_header_not_0); 5081 COMPILE_ASSERT(offsetof(TexParameteri, target) == 4, 5082 OffsetOf_TexParameteri_target_not_4); 5083 COMPILE_ASSERT(offsetof(TexParameteri, pname) == 8, 5084 OffsetOf_TexParameteri_pname_not_8); 5085 COMPILE_ASSERT(offsetof(TexParameteri, param) == 12, 5086 OffsetOf_TexParameteri_param_not_12); 5087 5088 struct TexParameterivImmediate { 5089 typedef TexParameterivImmediate ValueType; 5090 static const CommandId kCmdId = kTexParameterivImmediate; 5091 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5092 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5093 5094 static uint32_t ComputeDataSize() { 5095 return static_cast<uint32_t>(sizeof(GLint) * 1); // NOLINT 5096 } 5097 5098 static uint32_t ComputeSize() { 5099 return static_cast<uint32_t>(sizeof(ValueType) + 5100 ComputeDataSize()); // NOLINT 5101 } 5102 5103 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 5104 5105 void Init(GLenum _target, GLenum _pname, const GLint* _params) { 5106 SetHeader(); 5107 target = _target; 5108 pname = _pname; 5109 memcpy(ImmediateDataAddress(this), _params, ComputeDataSize()); 5110 } 5111 5112 void* Set(void* cmd, GLenum _target, GLenum _pname, const GLint* _params) { 5113 static_cast<ValueType*>(cmd)->Init(_target, _pname, _params); 5114 const uint32_t size = ComputeSize(); 5115 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5116 } 5117 5118 gpu::CommandHeader header; 5119 uint32_t target; 5120 uint32_t pname; 5121 }; 5122 5123 COMPILE_ASSERT(sizeof(TexParameterivImmediate) == 12, 5124 Sizeof_TexParameterivImmediate_is_not_12); 5125 COMPILE_ASSERT(offsetof(TexParameterivImmediate, header) == 0, 5126 OffsetOf_TexParameterivImmediate_header_not_0); 5127 COMPILE_ASSERT(offsetof(TexParameterivImmediate, target) == 4, 5128 OffsetOf_TexParameterivImmediate_target_not_4); 5129 COMPILE_ASSERT(offsetof(TexParameterivImmediate, pname) == 8, 5130 OffsetOf_TexParameterivImmediate_pname_not_8); 5131 5132 struct TexSubImage2D { 5133 typedef TexSubImage2D ValueType; 5134 static const CommandId kCmdId = kTexSubImage2D; 5135 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5136 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5137 5138 static uint32_t ComputeSize() { 5139 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5140 } 5141 5142 void SetHeader() { header.SetCmd<ValueType>(); } 5143 5144 void Init(GLenum _target, 5145 GLint _level, 5146 GLint _xoffset, 5147 GLint _yoffset, 5148 GLsizei _width, 5149 GLsizei _height, 5150 GLenum _format, 5151 GLenum _type, 5152 uint32_t _pixels_shm_id, 5153 uint32_t _pixels_shm_offset, 5154 GLboolean _internal) { 5155 SetHeader(); 5156 target = _target; 5157 level = _level; 5158 xoffset = _xoffset; 5159 yoffset = _yoffset; 5160 width = _width; 5161 height = _height; 5162 format = _format; 5163 type = _type; 5164 pixels_shm_id = _pixels_shm_id; 5165 pixels_shm_offset = _pixels_shm_offset; 5166 internal = _internal; 5167 } 5168 5169 void* Set(void* cmd, 5170 GLenum _target, 5171 GLint _level, 5172 GLint _xoffset, 5173 GLint _yoffset, 5174 GLsizei _width, 5175 GLsizei _height, 5176 GLenum _format, 5177 GLenum _type, 5178 uint32_t _pixels_shm_id, 5179 uint32_t _pixels_shm_offset, 5180 GLboolean _internal) { 5181 static_cast<ValueType*>(cmd)->Init(_target, 5182 _level, 5183 _xoffset, 5184 _yoffset, 5185 _width, 5186 _height, 5187 _format, 5188 _type, 5189 _pixels_shm_id, 5190 _pixels_shm_offset, 5191 _internal); 5192 return NextCmdAddress<ValueType>(cmd); 5193 } 5194 5195 gpu::CommandHeader header; 5196 uint32_t target; 5197 int32_t level; 5198 int32_t xoffset; 5199 int32_t yoffset; 5200 int32_t width; 5201 int32_t height; 5202 uint32_t format; 5203 uint32_t type; 5204 uint32_t pixels_shm_id; 5205 uint32_t pixels_shm_offset; 5206 uint32_t internal; 5207 }; 5208 5209 COMPILE_ASSERT(sizeof(TexSubImage2D) == 48, Sizeof_TexSubImage2D_is_not_48); 5210 COMPILE_ASSERT(offsetof(TexSubImage2D, header) == 0, 5211 OffsetOf_TexSubImage2D_header_not_0); 5212 COMPILE_ASSERT(offsetof(TexSubImage2D, target) == 4, 5213 OffsetOf_TexSubImage2D_target_not_4); 5214 COMPILE_ASSERT(offsetof(TexSubImage2D, level) == 8, 5215 OffsetOf_TexSubImage2D_level_not_8); 5216 COMPILE_ASSERT(offsetof(TexSubImage2D, xoffset) == 12, 5217 OffsetOf_TexSubImage2D_xoffset_not_12); 5218 COMPILE_ASSERT(offsetof(TexSubImage2D, yoffset) == 16, 5219 OffsetOf_TexSubImage2D_yoffset_not_16); 5220 COMPILE_ASSERT(offsetof(TexSubImage2D, width) == 20, 5221 OffsetOf_TexSubImage2D_width_not_20); 5222 COMPILE_ASSERT(offsetof(TexSubImage2D, height) == 24, 5223 OffsetOf_TexSubImage2D_height_not_24); 5224 COMPILE_ASSERT(offsetof(TexSubImage2D, format) == 28, 5225 OffsetOf_TexSubImage2D_format_not_28); 5226 COMPILE_ASSERT(offsetof(TexSubImage2D, type) == 32, 5227 OffsetOf_TexSubImage2D_type_not_32); 5228 COMPILE_ASSERT(offsetof(TexSubImage2D, pixels_shm_id) == 36, 5229 OffsetOf_TexSubImage2D_pixels_shm_id_not_36); 5230 COMPILE_ASSERT(offsetof(TexSubImage2D, pixels_shm_offset) == 40, 5231 OffsetOf_TexSubImage2D_pixels_shm_offset_not_40); 5232 COMPILE_ASSERT(offsetof(TexSubImage2D, internal) == 44, 5233 OffsetOf_TexSubImage2D_internal_not_44); 5234 5235 struct Uniform1f { 5236 typedef Uniform1f ValueType; 5237 static const CommandId kCmdId = kUniform1f; 5238 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5239 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5240 5241 static uint32_t ComputeSize() { 5242 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5243 } 5244 5245 void SetHeader() { header.SetCmd<ValueType>(); } 5246 5247 void Init(GLint _location, GLfloat _x) { 5248 SetHeader(); 5249 location = _location; 5250 x = _x; 5251 } 5252 5253 void* Set(void* cmd, GLint _location, GLfloat _x) { 5254 static_cast<ValueType*>(cmd)->Init(_location, _x); 5255 return NextCmdAddress<ValueType>(cmd); 5256 } 5257 5258 gpu::CommandHeader header; 5259 int32_t location; 5260 float x; 5261 }; 5262 5263 COMPILE_ASSERT(sizeof(Uniform1f) == 12, Sizeof_Uniform1f_is_not_12); 5264 COMPILE_ASSERT(offsetof(Uniform1f, header) == 0, 5265 OffsetOf_Uniform1f_header_not_0); 5266 COMPILE_ASSERT(offsetof(Uniform1f, location) == 4, 5267 OffsetOf_Uniform1f_location_not_4); 5268 COMPILE_ASSERT(offsetof(Uniform1f, x) == 8, OffsetOf_Uniform1f_x_not_8); 5269 5270 struct Uniform1fvImmediate { 5271 typedef Uniform1fvImmediate ValueType; 5272 static const CommandId kCmdId = kUniform1fvImmediate; 5273 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5274 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5275 5276 static uint32_t ComputeDataSize(GLsizei count) { 5277 return static_cast<uint32_t>(sizeof(GLfloat) * 1 * count); // NOLINT 5278 } 5279 5280 static uint32_t ComputeSize(GLsizei count) { 5281 return static_cast<uint32_t>(sizeof(ValueType) + 5282 ComputeDataSize(count)); // NOLINT 5283 } 5284 5285 void SetHeader(GLsizei count) { 5286 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5287 } 5288 5289 void Init(GLint _location, GLsizei _count, const GLfloat* _v) { 5290 SetHeader(_count); 5291 location = _location; 5292 count = _count; 5293 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5294 } 5295 5296 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _v) { 5297 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5298 const uint32_t size = ComputeSize(_count); 5299 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5300 } 5301 5302 gpu::CommandHeader header; 5303 int32_t location; 5304 int32_t count; 5305 }; 5306 5307 COMPILE_ASSERT(sizeof(Uniform1fvImmediate) == 12, 5308 Sizeof_Uniform1fvImmediate_is_not_12); 5309 COMPILE_ASSERT(offsetof(Uniform1fvImmediate, header) == 0, 5310 OffsetOf_Uniform1fvImmediate_header_not_0); 5311 COMPILE_ASSERT(offsetof(Uniform1fvImmediate, location) == 4, 5312 OffsetOf_Uniform1fvImmediate_location_not_4); 5313 COMPILE_ASSERT(offsetof(Uniform1fvImmediate, count) == 8, 5314 OffsetOf_Uniform1fvImmediate_count_not_8); 5315 5316 struct Uniform1i { 5317 typedef Uniform1i ValueType; 5318 static const CommandId kCmdId = kUniform1i; 5319 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5320 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5321 5322 static uint32_t ComputeSize() { 5323 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5324 } 5325 5326 void SetHeader() { header.SetCmd<ValueType>(); } 5327 5328 void Init(GLint _location, GLint _x) { 5329 SetHeader(); 5330 location = _location; 5331 x = _x; 5332 } 5333 5334 void* Set(void* cmd, GLint _location, GLint _x) { 5335 static_cast<ValueType*>(cmd)->Init(_location, _x); 5336 return NextCmdAddress<ValueType>(cmd); 5337 } 5338 5339 gpu::CommandHeader header; 5340 int32_t location; 5341 int32_t x; 5342 }; 5343 5344 COMPILE_ASSERT(sizeof(Uniform1i) == 12, Sizeof_Uniform1i_is_not_12); 5345 COMPILE_ASSERT(offsetof(Uniform1i, header) == 0, 5346 OffsetOf_Uniform1i_header_not_0); 5347 COMPILE_ASSERT(offsetof(Uniform1i, location) == 4, 5348 OffsetOf_Uniform1i_location_not_4); 5349 COMPILE_ASSERT(offsetof(Uniform1i, x) == 8, OffsetOf_Uniform1i_x_not_8); 5350 5351 struct Uniform1ivImmediate { 5352 typedef Uniform1ivImmediate ValueType; 5353 static const CommandId kCmdId = kUniform1ivImmediate; 5354 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5355 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5356 5357 static uint32_t ComputeDataSize(GLsizei count) { 5358 return static_cast<uint32_t>(sizeof(GLint) * 1 * count); // NOLINT 5359 } 5360 5361 static uint32_t ComputeSize(GLsizei count) { 5362 return static_cast<uint32_t>(sizeof(ValueType) + 5363 ComputeDataSize(count)); // NOLINT 5364 } 5365 5366 void SetHeader(GLsizei count) { 5367 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5368 } 5369 5370 void Init(GLint _location, GLsizei _count, const GLint* _v) { 5371 SetHeader(_count); 5372 location = _location; 5373 count = _count; 5374 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5375 } 5376 5377 void* Set(void* cmd, GLint _location, GLsizei _count, const GLint* _v) { 5378 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5379 const uint32_t size = ComputeSize(_count); 5380 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5381 } 5382 5383 gpu::CommandHeader header; 5384 int32_t location; 5385 int32_t count; 5386 }; 5387 5388 COMPILE_ASSERT(sizeof(Uniform1ivImmediate) == 12, 5389 Sizeof_Uniform1ivImmediate_is_not_12); 5390 COMPILE_ASSERT(offsetof(Uniform1ivImmediate, header) == 0, 5391 OffsetOf_Uniform1ivImmediate_header_not_0); 5392 COMPILE_ASSERT(offsetof(Uniform1ivImmediate, location) == 4, 5393 OffsetOf_Uniform1ivImmediate_location_not_4); 5394 COMPILE_ASSERT(offsetof(Uniform1ivImmediate, count) == 8, 5395 OffsetOf_Uniform1ivImmediate_count_not_8); 5396 5397 struct Uniform2f { 5398 typedef Uniform2f ValueType; 5399 static const CommandId kCmdId = kUniform2f; 5400 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5401 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5402 5403 static uint32_t ComputeSize() { 5404 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5405 } 5406 5407 void SetHeader() { header.SetCmd<ValueType>(); } 5408 5409 void Init(GLint _location, GLfloat _x, GLfloat _y) { 5410 SetHeader(); 5411 location = _location; 5412 x = _x; 5413 y = _y; 5414 } 5415 5416 void* Set(void* cmd, GLint _location, GLfloat _x, GLfloat _y) { 5417 static_cast<ValueType*>(cmd)->Init(_location, _x, _y); 5418 return NextCmdAddress<ValueType>(cmd); 5419 } 5420 5421 gpu::CommandHeader header; 5422 int32_t location; 5423 float x; 5424 float y; 5425 }; 5426 5427 COMPILE_ASSERT(sizeof(Uniform2f) == 16, Sizeof_Uniform2f_is_not_16); 5428 COMPILE_ASSERT(offsetof(Uniform2f, header) == 0, 5429 OffsetOf_Uniform2f_header_not_0); 5430 COMPILE_ASSERT(offsetof(Uniform2f, location) == 4, 5431 OffsetOf_Uniform2f_location_not_4); 5432 COMPILE_ASSERT(offsetof(Uniform2f, x) == 8, OffsetOf_Uniform2f_x_not_8); 5433 COMPILE_ASSERT(offsetof(Uniform2f, y) == 12, OffsetOf_Uniform2f_y_not_12); 5434 5435 struct Uniform2fvImmediate { 5436 typedef Uniform2fvImmediate ValueType; 5437 static const CommandId kCmdId = kUniform2fvImmediate; 5438 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5439 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5440 5441 static uint32_t ComputeDataSize(GLsizei count) { 5442 return static_cast<uint32_t>(sizeof(GLfloat) * 2 * count); // NOLINT 5443 } 5444 5445 static uint32_t ComputeSize(GLsizei count) { 5446 return static_cast<uint32_t>(sizeof(ValueType) + 5447 ComputeDataSize(count)); // NOLINT 5448 } 5449 5450 void SetHeader(GLsizei count) { 5451 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5452 } 5453 5454 void Init(GLint _location, GLsizei _count, const GLfloat* _v) { 5455 SetHeader(_count); 5456 location = _location; 5457 count = _count; 5458 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5459 } 5460 5461 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _v) { 5462 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5463 const uint32_t size = ComputeSize(_count); 5464 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5465 } 5466 5467 gpu::CommandHeader header; 5468 int32_t location; 5469 int32_t count; 5470 }; 5471 5472 COMPILE_ASSERT(sizeof(Uniform2fvImmediate) == 12, 5473 Sizeof_Uniform2fvImmediate_is_not_12); 5474 COMPILE_ASSERT(offsetof(Uniform2fvImmediate, header) == 0, 5475 OffsetOf_Uniform2fvImmediate_header_not_0); 5476 COMPILE_ASSERT(offsetof(Uniform2fvImmediate, location) == 4, 5477 OffsetOf_Uniform2fvImmediate_location_not_4); 5478 COMPILE_ASSERT(offsetof(Uniform2fvImmediate, count) == 8, 5479 OffsetOf_Uniform2fvImmediate_count_not_8); 5480 5481 struct Uniform2i { 5482 typedef Uniform2i ValueType; 5483 static const CommandId kCmdId = kUniform2i; 5484 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5485 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5486 5487 static uint32_t ComputeSize() { 5488 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5489 } 5490 5491 void SetHeader() { header.SetCmd<ValueType>(); } 5492 5493 void Init(GLint _location, GLint _x, GLint _y) { 5494 SetHeader(); 5495 location = _location; 5496 x = _x; 5497 y = _y; 5498 } 5499 5500 void* Set(void* cmd, GLint _location, GLint _x, GLint _y) { 5501 static_cast<ValueType*>(cmd)->Init(_location, _x, _y); 5502 return NextCmdAddress<ValueType>(cmd); 5503 } 5504 5505 gpu::CommandHeader header; 5506 int32_t location; 5507 int32_t x; 5508 int32_t y; 5509 }; 5510 5511 COMPILE_ASSERT(sizeof(Uniform2i) == 16, Sizeof_Uniform2i_is_not_16); 5512 COMPILE_ASSERT(offsetof(Uniform2i, header) == 0, 5513 OffsetOf_Uniform2i_header_not_0); 5514 COMPILE_ASSERT(offsetof(Uniform2i, location) == 4, 5515 OffsetOf_Uniform2i_location_not_4); 5516 COMPILE_ASSERT(offsetof(Uniform2i, x) == 8, OffsetOf_Uniform2i_x_not_8); 5517 COMPILE_ASSERT(offsetof(Uniform2i, y) == 12, OffsetOf_Uniform2i_y_not_12); 5518 5519 struct Uniform2ivImmediate { 5520 typedef Uniform2ivImmediate ValueType; 5521 static const CommandId kCmdId = kUniform2ivImmediate; 5522 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5523 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5524 5525 static uint32_t ComputeDataSize(GLsizei count) { 5526 return static_cast<uint32_t>(sizeof(GLint) * 2 * count); // NOLINT 5527 } 5528 5529 static uint32_t ComputeSize(GLsizei count) { 5530 return static_cast<uint32_t>(sizeof(ValueType) + 5531 ComputeDataSize(count)); // NOLINT 5532 } 5533 5534 void SetHeader(GLsizei count) { 5535 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5536 } 5537 5538 void Init(GLint _location, GLsizei _count, const GLint* _v) { 5539 SetHeader(_count); 5540 location = _location; 5541 count = _count; 5542 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5543 } 5544 5545 void* Set(void* cmd, GLint _location, GLsizei _count, const GLint* _v) { 5546 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5547 const uint32_t size = ComputeSize(_count); 5548 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5549 } 5550 5551 gpu::CommandHeader header; 5552 int32_t location; 5553 int32_t count; 5554 }; 5555 5556 COMPILE_ASSERT(sizeof(Uniform2ivImmediate) == 12, 5557 Sizeof_Uniform2ivImmediate_is_not_12); 5558 COMPILE_ASSERT(offsetof(Uniform2ivImmediate, header) == 0, 5559 OffsetOf_Uniform2ivImmediate_header_not_0); 5560 COMPILE_ASSERT(offsetof(Uniform2ivImmediate, location) == 4, 5561 OffsetOf_Uniform2ivImmediate_location_not_4); 5562 COMPILE_ASSERT(offsetof(Uniform2ivImmediate, count) == 8, 5563 OffsetOf_Uniform2ivImmediate_count_not_8); 5564 5565 struct Uniform3f { 5566 typedef Uniform3f ValueType; 5567 static const CommandId kCmdId = kUniform3f; 5568 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5569 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5570 5571 static uint32_t ComputeSize() { 5572 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5573 } 5574 5575 void SetHeader() { header.SetCmd<ValueType>(); } 5576 5577 void Init(GLint _location, GLfloat _x, GLfloat _y, GLfloat _z) { 5578 SetHeader(); 5579 location = _location; 5580 x = _x; 5581 y = _y; 5582 z = _z; 5583 } 5584 5585 void* Set(void* cmd, GLint _location, GLfloat _x, GLfloat _y, GLfloat _z) { 5586 static_cast<ValueType*>(cmd)->Init(_location, _x, _y, _z); 5587 return NextCmdAddress<ValueType>(cmd); 5588 } 5589 5590 gpu::CommandHeader header; 5591 int32_t location; 5592 float x; 5593 float y; 5594 float z; 5595 }; 5596 5597 COMPILE_ASSERT(sizeof(Uniform3f) == 20, Sizeof_Uniform3f_is_not_20); 5598 COMPILE_ASSERT(offsetof(Uniform3f, header) == 0, 5599 OffsetOf_Uniform3f_header_not_0); 5600 COMPILE_ASSERT(offsetof(Uniform3f, location) == 4, 5601 OffsetOf_Uniform3f_location_not_4); 5602 COMPILE_ASSERT(offsetof(Uniform3f, x) == 8, OffsetOf_Uniform3f_x_not_8); 5603 COMPILE_ASSERT(offsetof(Uniform3f, y) == 12, OffsetOf_Uniform3f_y_not_12); 5604 COMPILE_ASSERT(offsetof(Uniform3f, z) == 16, OffsetOf_Uniform3f_z_not_16); 5605 5606 struct Uniform3fvImmediate { 5607 typedef Uniform3fvImmediate ValueType; 5608 static const CommandId kCmdId = kUniform3fvImmediate; 5609 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5610 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5611 5612 static uint32_t ComputeDataSize(GLsizei count) { 5613 return static_cast<uint32_t>(sizeof(GLfloat) * 3 * count); // NOLINT 5614 } 5615 5616 static uint32_t ComputeSize(GLsizei count) { 5617 return static_cast<uint32_t>(sizeof(ValueType) + 5618 ComputeDataSize(count)); // NOLINT 5619 } 5620 5621 void SetHeader(GLsizei count) { 5622 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5623 } 5624 5625 void Init(GLint _location, GLsizei _count, const GLfloat* _v) { 5626 SetHeader(_count); 5627 location = _location; 5628 count = _count; 5629 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5630 } 5631 5632 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _v) { 5633 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5634 const uint32_t size = ComputeSize(_count); 5635 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5636 } 5637 5638 gpu::CommandHeader header; 5639 int32_t location; 5640 int32_t count; 5641 }; 5642 5643 COMPILE_ASSERT(sizeof(Uniform3fvImmediate) == 12, 5644 Sizeof_Uniform3fvImmediate_is_not_12); 5645 COMPILE_ASSERT(offsetof(Uniform3fvImmediate, header) == 0, 5646 OffsetOf_Uniform3fvImmediate_header_not_0); 5647 COMPILE_ASSERT(offsetof(Uniform3fvImmediate, location) == 4, 5648 OffsetOf_Uniform3fvImmediate_location_not_4); 5649 COMPILE_ASSERT(offsetof(Uniform3fvImmediate, count) == 8, 5650 OffsetOf_Uniform3fvImmediate_count_not_8); 5651 5652 struct Uniform3i { 5653 typedef Uniform3i ValueType; 5654 static const CommandId kCmdId = kUniform3i; 5655 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5656 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5657 5658 static uint32_t ComputeSize() { 5659 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5660 } 5661 5662 void SetHeader() { header.SetCmd<ValueType>(); } 5663 5664 void Init(GLint _location, GLint _x, GLint _y, GLint _z) { 5665 SetHeader(); 5666 location = _location; 5667 x = _x; 5668 y = _y; 5669 z = _z; 5670 } 5671 5672 void* Set(void* cmd, GLint _location, GLint _x, GLint _y, GLint _z) { 5673 static_cast<ValueType*>(cmd)->Init(_location, _x, _y, _z); 5674 return NextCmdAddress<ValueType>(cmd); 5675 } 5676 5677 gpu::CommandHeader header; 5678 int32_t location; 5679 int32_t x; 5680 int32_t y; 5681 int32_t z; 5682 }; 5683 5684 COMPILE_ASSERT(sizeof(Uniform3i) == 20, Sizeof_Uniform3i_is_not_20); 5685 COMPILE_ASSERT(offsetof(Uniform3i, header) == 0, 5686 OffsetOf_Uniform3i_header_not_0); 5687 COMPILE_ASSERT(offsetof(Uniform3i, location) == 4, 5688 OffsetOf_Uniform3i_location_not_4); 5689 COMPILE_ASSERT(offsetof(Uniform3i, x) == 8, OffsetOf_Uniform3i_x_not_8); 5690 COMPILE_ASSERT(offsetof(Uniform3i, y) == 12, OffsetOf_Uniform3i_y_not_12); 5691 COMPILE_ASSERT(offsetof(Uniform3i, z) == 16, OffsetOf_Uniform3i_z_not_16); 5692 5693 struct Uniform3ivImmediate { 5694 typedef Uniform3ivImmediate ValueType; 5695 static const CommandId kCmdId = kUniform3ivImmediate; 5696 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5697 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5698 5699 static uint32_t ComputeDataSize(GLsizei count) { 5700 return static_cast<uint32_t>(sizeof(GLint) * 3 * count); // NOLINT 5701 } 5702 5703 static uint32_t ComputeSize(GLsizei count) { 5704 return static_cast<uint32_t>(sizeof(ValueType) + 5705 ComputeDataSize(count)); // NOLINT 5706 } 5707 5708 void SetHeader(GLsizei count) { 5709 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5710 } 5711 5712 void Init(GLint _location, GLsizei _count, const GLint* _v) { 5713 SetHeader(_count); 5714 location = _location; 5715 count = _count; 5716 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5717 } 5718 5719 void* Set(void* cmd, GLint _location, GLsizei _count, const GLint* _v) { 5720 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5721 const uint32_t size = ComputeSize(_count); 5722 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5723 } 5724 5725 gpu::CommandHeader header; 5726 int32_t location; 5727 int32_t count; 5728 }; 5729 5730 COMPILE_ASSERT(sizeof(Uniform3ivImmediate) == 12, 5731 Sizeof_Uniform3ivImmediate_is_not_12); 5732 COMPILE_ASSERT(offsetof(Uniform3ivImmediate, header) == 0, 5733 OffsetOf_Uniform3ivImmediate_header_not_0); 5734 COMPILE_ASSERT(offsetof(Uniform3ivImmediate, location) == 4, 5735 OffsetOf_Uniform3ivImmediate_location_not_4); 5736 COMPILE_ASSERT(offsetof(Uniform3ivImmediate, count) == 8, 5737 OffsetOf_Uniform3ivImmediate_count_not_8); 5738 5739 struct Uniform4f { 5740 typedef Uniform4f ValueType; 5741 static const CommandId kCmdId = kUniform4f; 5742 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5743 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5744 5745 static uint32_t ComputeSize() { 5746 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5747 } 5748 5749 void SetHeader() { header.SetCmd<ValueType>(); } 5750 5751 void Init(GLint _location, GLfloat _x, GLfloat _y, GLfloat _z, GLfloat _w) { 5752 SetHeader(); 5753 location = _location; 5754 x = _x; 5755 y = _y; 5756 z = _z; 5757 w = _w; 5758 } 5759 5760 void* Set(void* cmd, 5761 GLint _location, 5762 GLfloat _x, 5763 GLfloat _y, 5764 GLfloat _z, 5765 GLfloat _w) { 5766 static_cast<ValueType*>(cmd)->Init(_location, _x, _y, _z, _w); 5767 return NextCmdAddress<ValueType>(cmd); 5768 } 5769 5770 gpu::CommandHeader header; 5771 int32_t location; 5772 float x; 5773 float y; 5774 float z; 5775 float w; 5776 }; 5777 5778 COMPILE_ASSERT(sizeof(Uniform4f) == 24, Sizeof_Uniform4f_is_not_24); 5779 COMPILE_ASSERT(offsetof(Uniform4f, header) == 0, 5780 OffsetOf_Uniform4f_header_not_0); 5781 COMPILE_ASSERT(offsetof(Uniform4f, location) == 4, 5782 OffsetOf_Uniform4f_location_not_4); 5783 COMPILE_ASSERT(offsetof(Uniform4f, x) == 8, OffsetOf_Uniform4f_x_not_8); 5784 COMPILE_ASSERT(offsetof(Uniform4f, y) == 12, OffsetOf_Uniform4f_y_not_12); 5785 COMPILE_ASSERT(offsetof(Uniform4f, z) == 16, OffsetOf_Uniform4f_z_not_16); 5786 COMPILE_ASSERT(offsetof(Uniform4f, w) == 20, OffsetOf_Uniform4f_w_not_20); 5787 5788 struct Uniform4fvImmediate { 5789 typedef Uniform4fvImmediate ValueType; 5790 static const CommandId kCmdId = kUniform4fvImmediate; 5791 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5792 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5793 5794 static uint32_t ComputeDataSize(GLsizei count) { 5795 return static_cast<uint32_t>(sizeof(GLfloat) * 4 * count); // NOLINT 5796 } 5797 5798 static uint32_t ComputeSize(GLsizei count) { 5799 return static_cast<uint32_t>(sizeof(ValueType) + 5800 ComputeDataSize(count)); // NOLINT 5801 } 5802 5803 void SetHeader(GLsizei count) { 5804 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5805 } 5806 5807 void Init(GLint _location, GLsizei _count, const GLfloat* _v) { 5808 SetHeader(_count); 5809 location = _location; 5810 count = _count; 5811 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5812 } 5813 5814 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _v) { 5815 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5816 const uint32_t size = ComputeSize(_count); 5817 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5818 } 5819 5820 gpu::CommandHeader header; 5821 int32_t location; 5822 int32_t count; 5823 }; 5824 5825 COMPILE_ASSERT(sizeof(Uniform4fvImmediate) == 12, 5826 Sizeof_Uniform4fvImmediate_is_not_12); 5827 COMPILE_ASSERT(offsetof(Uniform4fvImmediate, header) == 0, 5828 OffsetOf_Uniform4fvImmediate_header_not_0); 5829 COMPILE_ASSERT(offsetof(Uniform4fvImmediate, location) == 4, 5830 OffsetOf_Uniform4fvImmediate_location_not_4); 5831 COMPILE_ASSERT(offsetof(Uniform4fvImmediate, count) == 8, 5832 OffsetOf_Uniform4fvImmediate_count_not_8); 5833 5834 struct Uniform4i { 5835 typedef Uniform4i ValueType; 5836 static const CommandId kCmdId = kUniform4i; 5837 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 5838 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5839 5840 static uint32_t ComputeSize() { 5841 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 5842 } 5843 5844 void SetHeader() { header.SetCmd<ValueType>(); } 5845 5846 void Init(GLint _location, GLint _x, GLint _y, GLint _z, GLint _w) { 5847 SetHeader(); 5848 location = _location; 5849 x = _x; 5850 y = _y; 5851 z = _z; 5852 w = _w; 5853 } 5854 5855 void* Set(void* cmd, 5856 GLint _location, 5857 GLint _x, 5858 GLint _y, 5859 GLint _z, 5860 GLint _w) { 5861 static_cast<ValueType*>(cmd)->Init(_location, _x, _y, _z, _w); 5862 return NextCmdAddress<ValueType>(cmd); 5863 } 5864 5865 gpu::CommandHeader header; 5866 int32_t location; 5867 int32_t x; 5868 int32_t y; 5869 int32_t z; 5870 int32_t w; 5871 }; 5872 5873 COMPILE_ASSERT(sizeof(Uniform4i) == 24, Sizeof_Uniform4i_is_not_24); 5874 COMPILE_ASSERT(offsetof(Uniform4i, header) == 0, 5875 OffsetOf_Uniform4i_header_not_0); 5876 COMPILE_ASSERT(offsetof(Uniform4i, location) == 4, 5877 OffsetOf_Uniform4i_location_not_4); 5878 COMPILE_ASSERT(offsetof(Uniform4i, x) == 8, OffsetOf_Uniform4i_x_not_8); 5879 COMPILE_ASSERT(offsetof(Uniform4i, y) == 12, OffsetOf_Uniform4i_y_not_12); 5880 COMPILE_ASSERT(offsetof(Uniform4i, z) == 16, OffsetOf_Uniform4i_z_not_16); 5881 COMPILE_ASSERT(offsetof(Uniform4i, w) == 20, OffsetOf_Uniform4i_w_not_20); 5882 5883 struct Uniform4ivImmediate { 5884 typedef Uniform4ivImmediate ValueType; 5885 static const CommandId kCmdId = kUniform4ivImmediate; 5886 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5887 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5888 5889 static uint32_t ComputeDataSize(GLsizei count) { 5890 return static_cast<uint32_t>(sizeof(GLint) * 4 * count); // NOLINT 5891 } 5892 5893 static uint32_t ComputeSize(GLsizei count) { 5894 return static_cast<uint32_t>(sizeof(ValueType) + 5895 ComputeDataSize(count)); // NOLINT 5896 } 5897 5898 void SetHeader(GLsizei count) { 5899 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5900 } 5901 5902 void Init(GLint _location, GLsizei _count, const GLint* _v) { 5903 SetHeader(_count); 5904 location = _location; 5905 count = _count; 5906 memcpy(ImmediateDataAddress(this), _v, ComputeDataSize(_count)); 5907 } 5908 5909 void* Set(void* cmd, GLint _location, GLsizei _count, const GLint* _v) { 5910 static_cast<ValueType*>(cmd)->Init(_location, _count, _v); 5911 const uint32_t size = ComputeSize(_count); 5912 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5913 } 5914 5915 gpu::CommandHeader header; 5916 int32_t location; 5917 int32_t count; 5918 }; 5919 5920 COMPILE_ASSERT(sizeof(Uniform4ivImmediate) == 12, 5921 Sizeof_Uniform4ivImmediate_is_not_12); 5922 COMPILE_ASSERT(offsetof(Uniform4ivImmediate, header) == 0, 5923 OffsetOf_Uniform4ivImmediate_header_not_0); 5924 COMPILE_ASSERT(offsetof(Uniform4ivImmediate, location) == 4, 5925 OffsetOf_Uniform4ivImmediate_location_not_4); 5926 COMPILE_ASSERT(offsetof(Uniform4ivImmediate, count) == 8, 5927 OffsetOf_Uniform4ivImmediate_count_not_8); 5928 5929 struct UniformMatrix2fvImmediate { 5930 typedef UniformMatrix2fvImmediate ValueType; 5931 static const CommandId kCmdId = kUniformMatrix2fvImmediate; 5932 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5933 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5934 5935 static uint32_t ComputeDataSize(GLsizei count) { 5936 return static_cast<uint32_t>(sizeof(GLfloat) * 4 * count); // NOLINT 5937 } 5938 5939 static uint32_t ComputeSize(GLsizei count) { 5940 return static_cast<uint32_t>(sizeof(ValueType) + 5941 ComputeDataSize(count)); // NOLINT 5942 } 5943 5944 void SetHeader(GLsizei count) { 5945 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5946 } 5947 5948 void Init(GLint _location, GLsizei _count, const GLfloat* _value) { 5949 SetHeader(_count); 5950 location = _location; 5951 count = _count; 5952 memcpy(ImmediateDataAddress(this), _value, ComputeDataSize(_count)); 5953 } 5954 5955 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _value) { 5956 static_cast<ValueType*>(cmd)->Init(_location, _count, _value); 5957 const uint32_t size = ComputeSize(_count); 5958 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 5959 } 5960 5961 gpu::CommandHeader header; 5962 int32_t location; 5963 int32_t count; 5964 static const uint32_t transpose = false; 5965 }; 5966 5967 COMPILE_ASSERT(sizeof(UniformMatrix2fvImmediate) == 12, 5968 Sizeof_UniformMatrix2fvImmediate_is_not_12); 5969 COMPILE_ASSERT(offsetof(UniformMatrix2fvImmediate, header) == 0, 5970 OffsetOf_UniformMatrix2fvImmediate_header_not_0); 5971 COMPILE_ASSERT(offsetof(UniformMatrix2fvImmediate, location) == 4, 5972 OffsetOf_UniformMatrix2fvImmediate_location_not_4); 5973 COMPILE_ASSERT(offsetof(UniformMatrix2fvImmediate, count) == 8, 5974 OffsetOf_UniformMatrix2fvImmediate_count_not_8); 5975 5976 struct UniformMatrix3fvImmediate { 5977 typedef UniformMatrix3fvImmediate ValueType; 5978 static const CommandId kCmdId = kUniformMatrix3fvImmediate; 5979 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 5980 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 5981 5982 static uint32_t ComputeDataSize(GLsizei count) { 5983 return static_cast<uint32_t>(sizeof(GLfloat) * 9 * count); // NOLINT 5984 } 5985 5986 static uint32_t ComputeSize(GLsizei count) { 5987 return static_cast<uint32_t>(sizeof(ValueType) + 5988 ComputeDataSize(count)); // NOLINT 5989 } 5990 5991 void SetHeader(GLsizei count) { 5992 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 5993 } 5994 5995 void Init(GLint _location, GLsizei _count, const GLfloat* _value) { 5996 SetHeader(_count); 5997 location = _location; 5998 count = _count; 5999 memcpy(ImmediateDataAddress(this), _value, ComputeDataSize(_count)); 6000 } 6001 6002 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _value) { 6003 static_cast<ValueType*>(cmd)->Init(_location, _count, _value); 6004 const uint32_t size = ComputeSize(_count); 6005 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6006 } 6007 6008 gpu::CommandHeader header; 6009 int32_t location; 6010 int32_t count; 6011 static const uint32_t transpose = false; 6012 }; 6013 6014 COMPILE_ASSERT(sizeof(UniformMatrix3fvImmediate) == 12, 6015 Sizeof_UniformMatrix3fvImmediate_is_not_12); 6016 COMPILE_ASSERT(offsetof(UniformMatrix3fvImmediate, header) == 0, 6017 OffsetOf_UniformMatrix3fvImmediate_header_not_0); 6018 COMPILE_ASSERT(offsetof(UniformMatrix3fvImmediate, location) == 4, 6019 OffsetOf_UniformMatrix3fvImmediate_location_not_4); 6020 COMPILE_ASSERT(offsetof(UniformMatrix3fvImmediate, count) == 8, 6021 OffsetOf_UniformMatrix3fvImmediate_count_not_8); 6022 6023 struct UniformMatrix4fvImmediate { 6024 typedef UniformMatrix4fvImmediate ValueType; 6025 static const CommandId kCmdId = kUniformMatrix4fvImmediate; 6026 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6027 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6028 6029 static uint32_t ComputeDataSize(GLsizei count) { 6030 return static_cast<uint32_t>(sizeof(GLfloat) * 16 * count); // NOLINT 6031 } 6032 6033 static uint32_t ComputeSize(GLsizei count) { 6034 return static_cast<uint32_t>(sizeof(ValueType) + 6035 ComputeDataSize(count)); // NOLINT 6036 } 6037 6038 void SetHeader(GLsizei count) { 6039 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 6040 } 6041 6042 void Init(GLint _location, GLsizei _count, const GLfloat* _value) { 6043 SetHeader(_count); 6044 location = _location; 6045 count = _count; 6046 memcpy(ImmediateDataAddress(this), _value, ComputeDataSize(_count)); 6047 } 6048 6049 void* Set(void* cmd, GLint _location, GLsizei _count, const GLfloat* _value) { 6050 static_cast<ValueType*>(cmd)->Init(_location, _count, _value); 6051 const uint32_t size = ComputeSize(_count); 6052 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6053 } 6054 6055 gpu::CommandHeader header; 6056 int32_t location; 6057 int32_t count; 6058 static const uint32_t transpose = false; 6059 }; 6060 6061 COMPILE_ASSERT(sizeof(UniformMatrix4fvImmediate) == 12, 6062 Sizeof_UniformMatrix4fvImmediate_is_not_12); 6063 COMPILE_ASSERT(offsetof(UniformMatrix4fvImmediate, header) == 0, 6064 OffsetOf_UniformMatrix4fvImmediate_header_not_0); 6065 COMPILE_ASSERT(offsetof(UniformMatrix4fvImmediate, location) == 4, 6066 OffsetOf_UniformMatrix4fvImmediate_location_not_4); 6067 COMPILE_ASSERT(offsetof(UniformMatrix4fvImmediate, count) == 8, 6068 OffsetOf_UniformMatrix4fvImmediate_count_not_8); 6069 6070 struct UseProgram { 6071 typedef UseProgram ValueType; 6072 static const CommandId kCmdId = kUseProgram; 6073 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6074 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6075 6076 static uint32_t ComputeSize() { 6077 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6078 } 6079 6080 void SetHeader() { header.SetCmd<ValueType>(); } 6081 6082 void Init(GLuint _program) { 6083 SetHeader(); 6084 program = _program; 6085 } 6086 6087 void* Set(void* cmd, GLuint _program) { 6088 static_cast<ValueType*>(cmd)->Init(_program); 6089 return NextCmdAddress<ValueType>(cmd); 6090 } 6091 6092 gpu::CommandHeader header; 6093 uint32_t program; 6094 }; 6095 6096 COMPILE_ASSERT(sizeof(UseProgram) == 8, Sizeof_UseProgram_is_not_8); 6097 COMPILE_ASSERT(offsetof(UseProgram, header) == 0, 6098 OffsetOf_UseProgram_header_not_0); 6099 COMPILE_ASSERT(offsetof(UseProgram, program) == 4, 6100 OffsetOf_UseProgram_program_not_4); 6101 6102 struct ValidateProgram { 6103 typedef ValidateProgram ValueType; 6104 static const CommandId kCmdId = kValidateProgram; 6105 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6106 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6107 6108 static uint32_t ComputeSize() { 6109 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6110 } 6111 6112 void SetHeader() { header.SetCmd<ValueType>(); } 6113 6114 void Init(GLuint _program) { 6115 SetHeader(); 6116 program = _program; 6117 } 6118 6119 void* Set(void* cmd, GLuint _program) { 6120 static_cast<ValueType*>(cmd)->Init(_program); 6121 return NextCmdAddress<ValueType>(cmd); 6122 } 6123 6124 gpu::CommandHeader header; 6125 uint32_t program; 6126 }; 6127 6128 COMPILE_ASSERT(sizeof(ValidateProgram) == 8, Sizeof_ValidateProgram_is_not_8); 6129 COMPILE_ASSERT(offsetof(ValidateProgram, header) == 0, 6130 OffsetOf_ValidateProgram_header_not_0); 6131 COMPILE_ASSERT(offsetof(ValidateProgram, program) == 4, 6132 OffsetOf_ValidateProgram_program_not_4); 6133 6134 struct VertexAttrib1f { 6135 typedef VertexAttrib1f ValueType; 6136 static const CommandId kCmdId = kVertexAttrib1f; 6137 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6138 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6139 6140 static uint32_t ComputeSize() { 6141 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6142 } 6143 6144 void SetHeader() { header.SetCmd<ValueType>(); } 6145 6146 void Init(GLuint _indx, GLfloat _x) { 6147 SetHeader(); 6148 indx = _indx; 6149 x = _x; 6150 } 6151 6152 void* Set(void* cmd, GLuint _indx, GLfloat _x) { 6153 static_cast<ValueType*>(cmd)->Init(_indx, _x); 6154 return NextCmdAddress<ValueType>(cmd); 6155 } 6156 6157 gpu::CommandHeader header; 6158 uint32_t indx; 6159 float x; 6160 }; 6161 6162 COMPILE_ASSERT(sizeof(VertexAttrib1f) == 12, Sizeof_VertexAttrib1f_is_not_12); 6163 COMPILE_ASSERT(offsetof(VertexAttrib1f, header) == 0, 6164 OffsetOf_VertexAttrib1f_header_not_0); 6165 COMPILE_ASSERT(offsetof(VertexAttrib1f, indx) == 4, 6166 OffsetOf_VertexAttrib1f_indx_not_4); 6167 COMPILE_ASSERT(offsetof(VertexAttrib1f, x) == 8, 6168 OffsetOf_VertexAttrib1f_x_not_8); 6169 6170 struct VertexAttrib1fvImmediate { 6171 typedef VertexAttrib1fvImmediate ValueType; 6172 static const CommandId kCmdId = kVertexAttrib1fvImmediate; 6173 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6174 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6175 6176 static uint32_t ComputeDataSize() { 6177 return static_cast<uint32_t>(sizeof(GLfloat) * 1); // NOLINT 6178 } 6179 6180 static uint32_t ComputeSize() { 6181 return static_cast<uint32_t>(sizeof(ValueType) + 6182 ComputeDataSize()); // NOLINT 6183 } 6184 6185 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 6186 6187 void Init(GLuint _indx, const GLfloat* _values) { 6188 SetHeader(); 6189 indx = _indx; 6190 memcpy(ImmediateDataAddress(this), _values, ComputeDataSize()); 6191 } 6192 6193 void* Set(void* cmd, GLuint _indx, const GLfloat* _values) { 6194 static_cast<ValueType*>(cmd)->Init(_indx, _values); 6195 const uint32_t size = ComputeSize(); 6196 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6197 } 6198 6199 gpu::CommandHeader header; 6200 uint32_t indx; 6201 }; 6202 6203 COMPILE_ASSERT(sizeof(VertexAttrib1fvImmediate) == 8, 6204 Sizeof_VertexAttrib1fvImmediate_is_not_8); 6205 COMPILE_ASSERT(offsetof(VertexAttrib1fvImmediate, header) == 0, 6206 OffsetOf_VertexAttrib1fvImmediate_header_not_0); 6207 COMPILE_ASSERT(offsetof(VertexAttrib1fvImmediate, indx) == 4, 6208 OffsetOf_VertexAttrib1fvImmediate_indx_not_4); 6209 6210 struct VertexAttrib2f { 6211 typedef VertexAttrib2f ValueType; 6212 static const CommandId kCmdId = kVertexAttrib2f; 6213 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6214 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6215 6216 static uint32_t ComputeSize() { 6217 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6218 } 6219 6220 void SetHeader() { header.SetCmd<ValueType>(); } 6221 6222 void Init(GLuint _indx, GLfloat _x, GLfloat _y) { 6223 SetHeader(); 6224 indx = _indx; 6225 x = _x; 6226 y = _y; 6227 } 6228 6229 void* Set(void* cmd, GLuint _indx, GLfloat _x, GLfloat _y) { 6230 static_cast<ValueType*>(cmd)->Init(_indx, _x, _y); 6231 return NextCmdAddress<ValueType>(cmd); 6232 } 6233 6234 gpu::CommandHeader header; 6235 uint32_t indx; 6236 float x; 6237 float y; 6238 }; 6239 6240 COMPILE_ASSERT(sizeof(VertexAttrib2f) == 16, Sizeof_VertexAttrib2f_is_not_16); 6241 COMPILE_ASSERT(offsetof(VertexAttrib2f, header) == 0, 6242 OffsetOf_VertexAttrib2f_header_not_0); 6243 COMPILE_ASSERT(offsetof(VertexAttrib2f, indx) == 4, 6244 OffsetOf_VertexAttrib2f_indx_not_4); 6245 COMPILE_ASSERT(offsetof(VertexAttrib2f, x) == 8, 6246 OffsetOf_VertexAttrib2f_x_not_8); 6247 COMPILE_ASSERT(offsetof(VertexAttrib2f, y) == 12, 6248 OffsetOf_VertexAttrib2f_y_not_12); 6249 6250 struct VertexAttrib2fvImmediate { 6251 typedef VertexAttrib2fvImmediate ValueType; 6252 static const CommandId kCmdId = kVertexAttrib2fvImmediate; 6253 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6254 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6255 6256 static uint32_t ComputeDataSize() { 6257 return static_cast<uint32_t>(sizeof(GLfloat) * 2); // NOLINT 6258 } 6259 6260 static uint32_t ComputeSize() { 6261 return static_cast<uint32_t>(sizeof(ValueType) + 6262 ComputeDataSize()); // NOLINT 6263 } 6264 6265 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 6266 6267 void Init(GLuint _indx, const GLfloat* _values) { 6268 SetHeader(); 6269 indx = _indx; 6270 memcpy(ImmediateDataAddress(this), _values, ComputeDataSize()); 6271 } 6272 6273 void* Set(void* cmd, GLuint _indx, const GLfloat* _values) { 6274 static_cast<ValueType*>(cmd)->Init(_indx, _values); 6275 const uint32_t size = ComputeSize(); 6276 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6277 } 6278 6279 gpu::CommandHeader header; 6280 uint32_t indx; 6281 }; 6282 6283 COMPILE_ASSERT(sizeof(VertexAttrib2fvImmediate) == 8, 6284 Sizeof_VertexAttrib2fvImmediate_is_not_8); 6285 COMPILE_ASSERT(offsetof(VertexAttrib2fvImmediate, header) == 0, 6286 OffsetOf_VertexAttrib2fvImmediate_header_not_0); 6287 COMPILE_ASSERT(offsetof(VertexAttrib2fvImmediate, indx) == 4, 6288 OffsetOf_VertexAttrib2fvImmediate_indx_not_4); 6289 6290 struct VertexAttrib3f { 6291 typedef VertexAttrib3f ValueType; 6292 static const CommandId kCmdId = kVertexAttrib3f; 6293 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6294 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6295 6296 static uint32_t ComputeSize() { 6297 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6298 } 6299 6300 void SetHeader() { header.SetCmd<ValueType>(); } 6301 6302 void Init(GLuint _indx, GLfloat _x, GLfloat _y, GLfloat _z) { 6303 SetHeader(); 6304 indx = _indx; 6305 x = _x; 6306 y = _y; 6307 z = _z; 6308 } 6309 6310 void* Set(void* cmd, GLuint _indx, GLfloat _x, GLfloat _y, GLfloat _z) { 6311 static_cast<ValueType*>(cmd)->Init(_indx, _x, _y, _z); 6312 return NextCmdAddress<ValueType>(cmd); 6313 } 6314 6315 gpu::CommandHeader header; 6316 uint32_t indx; 6317 float x; 6318 float y; 6319 float z; 6320 }; 6321 6322 COMPILE_ASSERT(sizeof(VertexAttrib3f) == 20, Sizeof_VertexAttrib3f_is_not_20); 6323 COMPILE_ASSERT(offsetof(VertexAttrib3f, header) == 0, 6324 OffsetOf_VertexAttrib3f_header_not_0); 6325 COMPILE_ASSERT(offsetof(VertexAttrib3f, indx) == 4, 6326 OffsetOf_VertexAttrib3f_indx_not_4); 6327 COMPILE_ASSERT(offsetof(VertexAttrib3f, x) == 8, 6328 OffsetOf_VertexAttrib3f_x_not_8); 6329 COMPILE_ASSERT(offsetof(VertexAttrib3f, y) == 12, 6330 OffsetOf_VertexAttrib3f_y_not_12); 6331 COMPILE_ASSERT(offsetof(VertexAttrib3f, z) == 16, 6332 OffsetOf_VertexAttrib3f_z_not_16); 6333 6334 struct VertexAttrib3fvImmediate { 6335 typedef VertexAttrib3fvImmediate ValueType; 6336 static const CommandId kCmdId = kVertexAttrib3fvImmediate; 6337 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6338 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6339 6340 static uint32_t ComputeDataSize() { 6341 return static_cast<uint32_t>(sizeof(GLfloat) * 3); // NOLINT 6342 } 6343 6344 static uint32_t ComputeSize() { 6345 return static_cast<uint32_t>(sizeof(ValueType) + 6346 ComputeDataSize()); // NOLINT 6347 } 6348 6349 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 6350 6351 void Init(GLuint _indx, const GLfloat* _values) { 6352 SetHeader(); 6353 indx = _indx; 6354 memcpy(ImmediateDataAddress(this), _values, ComputeDataSize()); 6355 } 6356 6357 void* Set(void* cmd, GLuint _indx, const GLfloat* _values) { 6358 static_cast<ValueType*>(cmd)->Init(_indx, _values); 6359 const uint32_t size = ComputeSize(); 6360 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6361 } 6362 6363 gpu::CommandHeader header; 6364 uint32_t indx; 6365 }; 6366 6367 COMPILE_ASSERT(sizeof(VertexAttrib3fvImmediate) == 8, 6368 Sizeof_VertexAttrib3fvImmediate_is_not_8); 6369 COMPILE_ASSERT(offsetof(VertexAttrib3fvImmediate, header) == 0, 6370 OffsetOf_VertexAttrib3fvImmediate_header_not_0); 6371 COMPILE_ASSERT(offsetof(VertexAttrib3fvImmediate, indx) == 4, 6372 OffsetOf_VertexAttrib3fvImmediate_indx_not_4); 6373 6374 struct VertexAttrib4f { 6375 typedef VertexAttrib4f ValueType; 6376 static const CommandId kCmdId = kVertexAttrib4f; 6377 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6378 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6379 6380 static uint32_t ComputeSize() { 6381 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6382 } 6383 6384 void SetHeader() { header.SetCmd<ValueType>(); } 6385 6386 void Init(GLuint _indx, GLfloat _x, GLfloat _y, GLfloat _z, GLfloat _w) { 6387 SetHeader(); 6388 indx = _indx; 6389 x = _x; 6390 y = _y; 6391 z = _z; 6392 w = _w; 6393 } 6394 6395 void* Set(void* cmd, 6396 GLuint _indx, 6397 GLfloat _x, 6398 GLfloat _y, 6399 GLfloat _z, 6400 GLfloat _w) { 6401 static_cast<ValueType*>(cmd)->Init(_indx, _x, _y, _z, _w); 6402 return NextCmdAddress<ValueType>(cmd); 6403 } 6404 6405 gpu::CommandHeader header; 6406 uint32_t indx; 6407 float x; 6408 float y; 6409 float z; 6410 float w; 6411 }; 6412 6413 COMPILE_ASSERT(sizeof(VertexAttrib4f) == 24, Sizeof_VertexAttrib4f_is_not_24); 6414 COMPILE_ASSERT(offsetof(VertexAttrib4f, header) == 0, 6415 OffsetOf_VertexAttrib4f_header_not_0); 6416 COMPILE_ASSERT(offsetof(VertexAttrib4f, indx) == 4, 6417 OffsetOf_VertexAttrib4f_indx_not_4); 6418 COMPILE_ASSERT(offsetof(VertexAttrib4f, x) == 8, 6419 OffsetOf_VertexAttrib4f_x_not_8); 6420 COMPILE_ASSERT(offsetof(VertexAttrib4f, y) == 12, 6421 OffsetOf_VertexAttrib4f_y_not_12); 6422 COMPILE_ASSERT(offsetof(VertexAttrib4f, z) == 16, 6423 OffsetOf_VertexAttrib4f_z_not_16); 6424 COMPILE_ASSERT(offsetof(VertexAttrib4f, w) == 20, 6425 OffsetOf_VertexAttrib4f_w_not_20); 6426 6427 struct VertexAttrib4fvImmediate { 6428 typedef VertexAttrib4fvImmediate ValueType; 6429 static const CommandId kCmdId = kVertexAttrib4fvImmediate; 6430 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6431 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6432 6433 static uint32_t ComputeDataSize() { 6434 return static_cast<uint32_t>(sizeof(GLfloat) * 4); // NOLINT 6435 } 6436 6437 static uint32_t ComputeSize() { 6438 return static_cast<uint32_t>(sizeof(ValueType) + 6439 ComputeDataSize()); // NOLINT 6440 } 6441 6442 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 6443 6444 void Init(GLuint _indx, const GLfloat* _values) { 6445 SetHeader(); 6446 indx = _indx; 6447 memcpy(ImmediateDataAddress(this), _values, ComputeDataSize()); 6448 } 6449 6450 void* Set(void* cmd, GLuint _indx, const GLfloat* _values) { 6451 static_cast<ValueType*>(cmd)->Init(_indx, _values); 6452 const uint32_t size = ComputeSize(); 6453 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6454 } 6455 6456 gpu::CommandHeader header; 6457 uint32_t indx; 6458 }; 6459 6460 COMPILE_ASSERT(sizeof(VertexAttrib4fvImmediate) == 8, 6461 Sizeof_VertexAttrib4fvImmediate_is_not_8); 6462 COMPILE_ASSERT(offsetof(VertexAttrib4fvImmediate, header) == 0, 6463 OffsetOf_VertexAttrib4fvImmediate_header_not_0); 6464 COMPILE_ASSERT(offsetof(VertexAttrib4fvImmediate, indx) == 4, 6465 OffsetOf_VertexAttrib4fvImmediate_indx_not_4); 6466 6467 struct VertexAttribPointer { 6468 typedef VertexAttribPointer ValueType; 6469 static const CommandId kCmdId = kVertexAttribPointer; 6470 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6471 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6472 6473 static uint32_t ComputeSize() { 6474 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6475 } 6476 6477 void SetHeader() { header.SetCmd<ValueType>(); } 6478 6479 void Init(GLuint _indx, 6480 GLint _size, 6481 GLenum _type, 6482 GLboolean _normalized, 6483 GLsizei _stride, 6484 GLuint _offset) { 6485 SetHeader(); 6486 indx = _indx; 6487 size = _size; 6488 type = _type; 6489 normalized = _normalized; 6490 stride = _stride; 6491 offset = _offset; 6492 } 6493 6494 void* Set(void* cmd, 6495 GLuint _indx, 6496 GLint _size, 6497 GLenum _type, 6498 GLboolean _normalized, 6499 GLsizei _stride, 6500 GLuint _offset) { 6501 static_cast<ValueType*>(cmd) 6502 ->Init(_indx, _size, _type, _normalized, _stride, _offset); 6503 return NextCmdAddress<ValueType>(cmd); 6504 } 6505 6506 gpu::CommandHeader header; 6507 uint32_t indx; 6508 int32_t size; 6509 uint32_t type; 6510 uint32_t normalized; 6511 int32_t stride; 6512 uint32_t offset; 6513 }; 6514 6515 COMPILE_ASSERT(sizeof(VertexAttribPointer) == 28, 6516 Sizeof_VertexAttribPointer_is_not_28); 6517 COMPILE_ASSERT(offsetof(VertexAttribPointer, header) == 0, 6518 OffsetOf_VertexAttribPointer_header_not_0); 6519 COMPILE_ASSERT(offsetof(VertexAttribPointer, indx) == 4, 6520 OffsetOf_VertexAttribPointer_indx_not_4); 6521 COMPILE_ASSERT(offsetof(VertexAttribPointer, size) == 8, 6522 OffsetOf_VertexAttribPointer_size_not_8); 6523 COMPILE_ASSERT(offsetof(VertexAttribPointer, type) == 12, 6524 OffsetOf_VertexAttribPointer_type_not_12); 6525 COMPILE_ASSERT(offsetof(VertexAttribPointer, normalized) == 16, 6526 OffsetOf_VertexAttribPointer_normalized_not_16); 6527 COMPILE_ASSERT(offsetof(VertexAttribPointer, stride) == 20, 6528 OffsetOf_VertexAttribPointer_stride_not_20); 6529 COMPILE_ASSERT(offsetof(VertexAttribPointer, offset) == 24, 6530 OffsetOf_VertexAttribPointer_offset_not_24); 6531 6532 struct Viewport { 6533 typedef Viewport ValueType; 6534 static const CommandId kCmdId = kViewport; 6535 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6536 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6537 6538 static uint32_t ComputeSize() { 6539 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6540 } 6541 6542 void SetHeader() { header.SetCmd<ValueType>(); } 6543 6544 void Init(GLint _x, GLint _y, GLsizei _width, GLsizei _height) { 6545 SetHeader(); 6546 x = _x; 6547 y = _y; 6548 width = _width; 6549 height = _height; 6550 } 6551 6552 void* Set(void* cmd, GLint _x, GLint _y, GLsizei _width, GLsizei _height) { 6553 static_cast<ValueType*>(cmd)->Init(_x, _y, _width, _height); 6554 return NextCmdAddress<ValueType>(cmd); 6555 } 6556 6557 gpu::CommandHeader header; 6558 int32_t x; 6559 int32_t y; 6560 int32_t width; 6561 int32_t height; 6562 }; 6563 6564 COMPILE_ASSERT(sizeof(Viewport) == 20, Sizeof_Viewport_is_not_20); 6565 COMPILE_ASSERT(offsetof(Viewport, header) == 0, OffsetOf_Viewport_header_not_0); 6566 COMPILE_ASSERT(offsetof(Viewport, x) == 4, OffsetOf_Viewport_x_not_4); 6567 COMPILE_ASSERT(offsetof(Viewport, y) == 8, OffsetOf_Viewport_y_not_8); 6568 COMPILE_ASSERT(offsetof(Viewport, width) == 12, OffsetOf_Viewport_width_not_12); 6569 COMPILE_ASSERT(offsetof(Viewport, height) == 16, 6570 OffsetOf_Viewport_height_not_16); 6571 6572 struct BlitFramebufferCHROMIUM { 6573 typedef BlitFramebufferCHROMIUM ValueType; 6574 static const CommandId kCmdId = kBlitFramebufferCHROMIUM; 6575 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6576 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 6577 6578 static uint32_t ComputeSize() { 6579 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6580 } 6581 6582 void SetHeader() { header.SetCmd<ValueType>(); } 6583 6584 void Init(GLint _srcX0, 6585 GLint _srcY0, 6586 GLint _srcX1, 6587 GLint _srcY1, 6588 GLint _dstX0, 6589 GLint _dstY0, 6590 GLint _dstX1, 6591 GLint _dstY1, 6592 GLbitfield _mask, 6593 GLenum _filter) { 6594 SetHeader(); 6595 srcX0 = _srcX0; 6596 srcY0 = _srcY0; 6597 srcX1 = _srcX1; 6598 srcY1 = _srcY1; 6599 dstX0 = _dstX0; 6600 dstY0 = _dstY0; 6601 dstX1 = _dstX1; 6602 dstY1 = _dstY1; 6603 mask = _mask; 6604 filter = _filter; 6605 } 6606 6607 void* Set(void* cmd, 6608 GLint _srcX0, 6609 GLint _srcY0, 6610 GLint _srcX1, 6611 GLint _srcY1, 6612 GLint _dstX0, 6613 GLint _dstY0, 6614 GLint _dstX1, 6615 GLint _dstY1, 6616 GLbitfield _mask, 6617 GLenum _filter) { 6618 static_cast<ValueType*>(cmd)->Init(_srcX0, 6619 _srcY0, 6620 _srcX1, 6621 _srcY1, 6622 _dstX0, 6623 _dstY0, 6624 _dstX1, 6625 _dstY1, 6626 _mask, 6627 _filter); 6628 return NextCmdAddress<ValueType>(cmd); 6629 } 6630 6631 gpu::CommandHeader header; 6632 int32_t srcX0; 6633 int32_t srcY0; 6634 int32_t srcX1; 6635 int32_t srcY1; 6636 int32_t dstX0; 6637 int32_t dstY0; 6638 int32_t dstX1; 6639 int32_t dstY1; 6640 uint32_t mask; 6641 uint32_t filter; 6642 }; 6643 6644 COMPILE_ASSERT(sizeof(BlitFramebufferCHROMIUM) == 44, 6645 Sizeof_BlitFramebufferCHROMIUM_is_not_44); 6646 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, header) == 0, 6647 OffsetOf_BlitFramebufferCHROMIUM_header_not_0); 6648 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, srcX0) == 4, 6649 OffsetOf_BlitFramebufferCHROMIUM_srcX0_not_4); 6650 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, srcY0) == 8, 6651 OffsetOf_BlitFramebufferCHROMIUM_srcY0_not_8); 6652 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, srcX1) == 12, 6653 OffsetOf_BlitFramebufferCHROMIUM_srcX1_not_12); 6654 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, srcY1) == 16, 6655 OffsetOf_BlitFramebufferCHROMIUM_srcY1_not_16); 6656 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, dstX0) == 20, 6657 OffsetOf_BlitFramebufferCHROMIUM_dstX0_not_20); 6658 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, dstY0) == 24, 6659 OffsetOf_BlitFramebufferCHROMIUM_dstY0_not_24); 6660 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, dstX1) == 28, 6661 OffsetOf_BlitFramebufferCHROMIUM_dstX1_not_28); 6662 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, dstY1) == 32, 6663 OffsetOf_BlitFramebufferCHROMIUM_dstY1_not_32); 6664 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, mask) == 36, 6665 OffsetOf_BlitFramebufferCHROMIUM_mask_not_36); 6666 COMPILE_ASSERT(offsetof(BlitFramebufferCHROMIUM, filter) == 40, 6667 OffsetOf_BlitFramebufferCHROMIUM_filter_not_40); 6668 6669 // GL_CHROMIUM_framebuffer_multisample 6670 struct RenderbufferStorageMultisampleCHROMIUM { 6671 typedef RenderbufferStorageMultisampleCHROMIUM ValueType; 6672 static const CommandId kCmdId = kRenderbufferStorageMultisampleCHROMIUM; 6673 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6674 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6675 6676 static uint32_t ComputeSize() { 6677 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6678 } 6679 6680 void SetHeader() { header.SetCmd<ValueType>(); } 6681 6682 void Init(GLenum _target, 6683 GLsizei _samples, 6684 GLenum _internalformat, 6685 GLsizei _width, 6686 GLsizei _height) { 6687 SetHeader(); 6688 target = _target; 6689 samples = _samples; 6690 internalformat = _internalformat; 6691 width = _width; 6692 height = _height; 6693 } 6694 6695 void* Set(void* cmd, 6696 GLenum _target, 6697 GLsizei _samples, 6698 GLenum _internalformat, 6699 GLsizei _width, 6700 GLsizei _height) { 6701 static_cast<ValueType*>(cmd) 6702 ->Init(_target, _samples, _internalformat, _width, _height); 6703 return NextCmdAddress<ValueType>(cmd); 6704 } 6705 6706 gpu::CommandHeader header; 6707 uint32_t target; 6708 int32_t samples; 6709 uint32_t internalformat; 6710 int32_t width; 6711 int32_t height; 6712 }; 6713 6714 COMPILE_ASSERT(sizeof(RenderbufferStorageMultisampleCHROMIUM) == 24, 6715 Sizeof_RenderbufferStorageMultisampleCHROMIUM_is_not_24); 6716 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleCHROMIUM, header) == 0, 6717 OffsetOf_RenderbufferStorageMultisampleCHROMIUM_header_not_0); 6718 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleCHROMIUM, target) == 4, 6719 OffsetOf_RenderbufferStorageMultisampleCHROMIUM_target_not_4); 6720 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleCHROMIUM, samples) == 8, 6721 OffsetOf_RenderbufferStorageMultisampleCHROMIUM_samples_not_8); 6722 COMPILE_ASSERT( 6723 offsetof(RenderbufferStorageMultisampleCHROMIUM, internalformat) == 12, 6724 OffsetOf_RenderbufferStorageMultisampleCHROMIUM_internalformat_not_12); 6725 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleCHROMIUM, width) == 16, 6726 OffsetOf_RenderbufferStorageMultisampleCHROMIUM_width_not_16); 6727 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleCHROMIUM, height) == 20, 6728 OffsetOf_RenderbufferStorageMultisampleCHROMIUM_height_not_20); 6729 6730 // GL_EXT_multisampled_render_to_texture 6731 struct RenderbufferStorageMultisampleEXT { 6732 typedef RenderbufferStorageMultisampleEXT ValueType; 6733 static const CommandId kCmdId = kRenderbufferStorageMultisampleEXT; 6734 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6735 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6736 6737 static uint32_t ComputeSize() { 6738 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6739 } 6740 6741 void SetHeader() { header.SetCmd<ValueType>(); } 6742 6743 void Init(GLenum _target, 6744 GLsizei _samples, 6745 GLenum _internalformat, 6746 GLsizei _width, 6747 GLsizei _height) { 6748 SetHeader(); 6749 target = _target; 6750 samples = _samples; 6751 internalformat = _internalformat; 6752 width = _width; 6753 height = _height; 6754 } 6755 6756 void* Set(void* cmd, 6757 GLenum _target, 6758 GLsizei _samples, 6759 GLenum _internalformat, 6760 GLsizei _width, 6761 GLsizei _height) { 6762 static_cast<ValueType*>(cmd) 6763 ->Init(_target, _samples, _internalformat, _width, _height); 6764 return NextCmdAddress<ValueType>(cmd); 6765 } 6766 6767 gpu::CommandHeader header; 6768 uint32_t target; 6769 int32_t samples; 6770 uint32_t internalformat; 6771 int32_t width; 6772 int32_t height; 6773 }; 6774 6775 COMPILE_ASSERT(sizeof(RenderbufferStorageMultisampleEXT) == 24, 6776 Sizeof_RenderbufferStorageMultisampleEXT_is_not_24); 6777 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleEXT, header) == 0, 6778 OffsetOf_RenderbufferStorageMultisampleEXT_header_not_0); 6779 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleEXT, target) == 4, 6780 OffsetOf_RenderbufferStorageMultisampleEXT_target_not_4); 6781 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleEXT, samples) == 8, 6782 OffsetOf_RenderbufferStorageMultisampleEXT_samples_not_8); 6783 COMPILE_ASSERT( 6784 offsetof(RenderbufferStorageMultisampleEXT, internalformat) == 12, 6785 OffsetOf_RenderbufferStorageMultisampleEXT_internalformat_not_12); 6786 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleEXT, width) == 16, 6787 OffsetOf_RenderbufferStorageMultisampleEXT_width_not_16); 6788 COMPILE_ASSERT(offsetof(RenderbufferStorageMultisampleEXT, height) == 20, 6789 OffsetOf_RenderbufferStorageMultisampleEXT_height_not_20); 6790 6791 struct FramebufferTexture2DMultisampleEXT { 6792 typedef FramebufferTexture2DMultisampleEXT ValueType; 6793 static const CommandId kCmdId = kFramebufferTexture2DMultisampleEXT; 6794 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6795 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 6796 6797 static uint32_t ComputeSize() { 6798 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6799 } 6800 6801 void SetHeader() { header.SetCmd<ValueType>(); } 6802 6803 void Init(GLenum _target, 6804 GLenum _attachment, 6805 GLenum _textarget, 6806 GLuint _texture, 6807 GLsizei _samples) { 6808 SetHeader(); 6809 target = _target; 6810 attachment = _attachment; 6811 textarget = _textarget; 6812 texture = _texture; 6813 samples = _samples; 6814 } 6815 6816 void* Set(void* cmd, 6817 GLenum _target, 6818 GLenum _attachment, 6819 GLenum _textarget, 6820 GLuint _texture, 6821 GLsizei _samples) { 6822 static_cast<ValueType*>(cmd) 6823 ->Init(_target, _attachment, _textarget, _texture, _samples); 6824 return NextCmdAddress<ValueType>(cmd); 6825 } 6826 6827 gpu::CommandHeader header; 6828 uint32_t target; 6829 uint32_t attachment; 6830 uint32_t textarget; 6831 uint32_t texture; 6832 int32_t samples; 6833 static const int32_t level = 0; 6834 }; 6835 6836 COMPILE_ASSERT(sizeof(FramebufferTexture2DMultisampleEXT) == 24, 6837 Sizeof_FramebufferTexture2DMultisampleEXT_is_not_24); 6838 COMPILE_ASSERT(offsetof(FramebufferTexture2DMultisampleEXT, header) == 0, 6839 OffsetOf_FramebufferTexture2DMultisampleEXT_header_not_0); 6840 COMPILE_ASSERT(offsetof(FramebufferTexture2DMultisampleEXT, target) == 4, 6841 OffsetOf_FramebufferTexture2DMultisampleEXT_target_not_4); 6842 COMPILE_ASSERT(offsetof(FramebufferTexture2DMultisampleEXT, attachment) == 8, 6843 OffsetOf_FramebufferTexture2DMultisampleEXT_attachment_not_8); 6844 COMPILE_ASSERT(offsetof(FramebufferTexture2DMultisampleEXT, textarget) == 12, 6845 OffsetOf_FramebufferTexture2DMultisampleEXT_textarget_not_12); 6846 COMPILE_ASSERT(offsetof(FramebufferTexture2DMultisampleEXT, texture) == 16, 6847 OffsetOf_FramebufferTexture2DMultisampleEXT_texture_not_16); 6848 COMPILE_ASSERT(offsetof(FramebufferTexture2DMultisampleEXT, samples) == 20, 6849 OffsetOf_FramebufferTexture2DMultisampleEXT_samples_not_20); 6850 6851 struct TexStorage2DEXT { 6852 typedef TexStorage2DEXT ValueType; 6853 static const CommandId kCmdId = kTexStorage2DEXT; 6854 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6855 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6856 6857 static uint32_t ComputeSize() { 6858 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 6859 } 6860 6861 void SetHeader() { header.SetCmd<ValueType>(); } 6862 6863 void Init(GLenum _target, 6864 GLsizei _levels, 6865 GLenum _internalFormat, 6866 GLsizei _width, 6867 GLsizei _height) { 6868 SetHeader(); 6869 target = _target; 6870 levels = _levels; 6871 internalFormat = _internalFormat; 6872 width = _width; 6873 height = _height; 6874 } 6875 6876 void* Set(void* cmd, 6877 GLenum _target, 6878 GLsizei _levels, 6879 GLenum _internalFormat, 6880 GLsizei _width, 6881 GLsizei _height) { 6882 static_cast<ValueType*>(cmd) 6883 ->Init(_target, _levels, _internalFormat, _width, _height); 6884 return NextCmdAddress<ValueType>(cmd); 6885 } 6886 6887 gpu::CommandHeader header; 6888 uint32_t target; 6889 int32_t levels; 6890 uint32_t internalFormat; 6891 int32_t width; 6892 int32_t height; 6893 }; 6894 6895 COMPILE_ASSERT(sizeof(TexStorage2DEXT) == 24, Sizeof_TexStorage2DEXT_is_not_24); 6896 COMPILE_ASSERT(offsetof(TexStorage2DEXT, header) == 0, 6897 OffsetOf_TexStorage2DEXT_header_not_0); 6898 COMPILE_ASSERT(offsetof(TexStorage2DEXT, target) == 4, 6899 OffsetOf_TexStorage2DEXT_target_not_4); 6900 COMPILE_ASSERT(offsetof(TexStorage2DEXT, levels) == 8, 6901 OffsetOf_TexStorage2DEXT_levels_not_8); 6902 COMPILE_ASSERT(offsetof(TexStorage2DEXT, internalFormat) == 12, 6903 OffsetOf_TexStorage2DEXT_internalFormat_not_12); 6904 COMPILE_ASSERT(offsetof(TexStorage2DEXT, width) == 16, 6905 OffsetOf_TexStorage2DEXT_width_not_16); 6906 COMPILE_ASSERT(offsetof(TexStorage2DEXT, height) == 20, 6907 OffsetOf_TexStorage2DEXT_height_not_20); 6908 6909 struct GenQueriesEXTImmediate { 6910 typedef GenQueriesEXTImmediate ValueType; 6911 static const CommandId kCmdId = kGenQueriesEXTImmediate; 6912 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6913 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6914 6915 static uint32_t ComputeDataSize(GLsizei n) { 6916 return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT 6917 } 6918 6919 static uint32_t ComputeSize(GLsizei n) { 6920 return static_cast<uint32_t>(sizeof(ValueType) + 6921 ComputeDataSize(n)); // NOLINT 6922 } 6923 6924 void SetHeader(GLsizei n) { 6925 header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); 6926 } 6927 6928 void Init(GLsizei _n, GLuint* _queries) { 6929 SetHeader(_n); 6930 n = _n; 6931 memcpy(ImmediateDataAddress(this), _queries, ComputeDataSize(_n)); 6932 } 6933 6934 void* Set(void* cmd, GLsizei _n, GLuint* _queries) { 6935 static_cast<ValueType*>(cmd)->Init(_n, _queries); 6936 const uint32_t size = ComputeSize(_n); 6937 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6938 } 6939 6940 gpu::CommandHeader header; 6941 int32_t n; 6942 }; 6943 6944 COMPILE_ASSERT(sizeof(GenQueriesEXTImmediate) == 8, 6945 Sizeof_GenQueriesEXTImmediate_is_not_8); 6946 COMPILE_ASSERT(offsetof(GenQueriesEXTImmediate, header) == 0, 6947 OffsetOf_GenQueriesEXTImmediate_header_not_0); 6948 COMPILE_ASSERT(offsetof(GenQueriesEXTImmediate, n) == 4, 6949 OffsetOf_GenQueriesEXTImmediate_n_not_4); 6950 6951 struct DeleteQueriesEXTImmediate { 6952 typedef DeleteQueriesEXTImmediate ValueType; 6953 static const CommandId kCmdId = kDeleteQueriesEXTImmediate; 6954 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 6955 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6956 6957 static uint32_t ComputeDataSize(GLsizei n) { 6958 return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT 6959 } 6960 6961 static uint32_t ComputeSize(GLsizei n) { 6962 return static_cast<uint32_t>(sizeof(ValueType) + 6963 ComputeDataSize(n)); // NOLINT 6964 } 6965 6966 void SetHeader(GLsizei n) { 6967 header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); 6968 } 6969 6970 void Init(GLsizei _n, const GLuint* _queries) { 6971 SetHeader(_n); 6972 n = _n; 6973 memcpy(ImmediateDataAddress(this), _queries, ComputeDataSize(_n)); 6974 } 6975 6976 void* Set(void* cmd, GLsizei _n, const GLuint* _queries) { 6977 static_cast<ValueType*>(cmd)->Init(_n, _queries); 6978 const uint32_t size = ComputeSize(_n); 6979 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 6980 } 6981 6982 gpu::CommandHeader header; 6983 int32_t n; 6984 }; 6985 6986 COMPILE_ASSERT(sizeof(DeleteQueriesEXTImmediate) == 8, 6987 Sizeof_DeleteQueriesEXTImmediate_is_not_8); 6988 COMPILE_ASSERT(offsetof(DeleteQueriesEXTImmediate, header) == 0, 6989 OffsetOf_DeleteQueriesEXTImmediate_header_not_0); 6990 COMPILE_ASSERT(offsetof(DeleteQueriesEXTImmediate, n) == 4, 6991 OffsetOf_DeleteQueriesEXTImmediate_n_not_4); 6992 6993 struct BeginQueryEXT { 6994 typedef BeginQueryEXT ValueType; 6995 static const CommandId kCmdId = kBeginQueryEXT; 6996 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 6997 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 6998 6999 static uint32_t ComputeSize() { 7000 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7001 } 7002 7003 void SetHeader() { header.SetCmd<ValueType>(); } 7004 7005 void Init(GLenum _target, 7006 GLuint _id, 7007 uint32_t _sync_data_shm_id, 7008 uint32_t _sync_data_shm_offset) { 7009 SetHeader(); 7010 target = _target; 7011 id = _id; 7012 sync_data_shm_id = _sync_data_shm_id; 7013 sync_data_shm_offset = _sync_data_shm_offset; 7014 } 7015 7016 void* Set(void* cmd, 7017 GLenum _target, 7018 GLuint _id, 7019 uint32_t _sync_data_shm_id, 7020 uint32_t _sync_data_shm_offset) { 7021 static_cast<ValueType*>(cmd) 7022 ->Init(_target, _id, _sync_data_shm_id, _sync_data_shm_offset); 7023 return NextCmdAddress<ValueType>(cmd); 7024 } 7025 7026 gpu::CommandHeader header; 7027 uint32_t target; 7028 uint32_t id; 7029 uint32_t sync_data_shm_id; 7030 uint32_t sync_data_shm_offset; 7031 }; 7032 7033 COMPILE_ASSERT(sizeof(BeginQueryEXT) == 20, Sizeof_BeginQueryEXT_is_not_20); 7034 COMPILE_ASSERT(offsetof(BeginQueryEXT, header) == 0, 7035 OffsetOf_BeginQueryEXT_header_not_0); 7036 COMPILE_ASSERT(offsetof(BeginQueryEXT, target) == 4, 7037 OffsetOf_BeginQueryEXT_target_not_4); 7038 COMPILE_ASSERT(offsetof(BeginQueryEXT, id) == 8, 7039 OffsetOf_BeginQueryEXT_id_not_8); 7040 COMPILE_ASSERT(offsetof(BeginQueryEXT, sync_data_shm_id) == 12, 7041 OffsetOf_BeginQueryEXT_sync_data_shm_id_not_12); 7042 COMPILE_ASSERT(offsetof(BeginQueryEXT, sync_data_shm_offset) == 16, 7043 OffsetOf_BeginQueryEXT_sync_data_shm_offset_not_16); 7044 7045 struct EndQueryEXT { 7046 typedef EndQueryEXT ValueType; 7047 static const CommandId kCmdId = kEndQueryEXT; 7048 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7049 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7050 7051 static uint32_t ComputeSize() { 7052 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7053 } 7054 7055 void SetHeader() { header.SetCmd<ValueType>(); } 7056 7057 void Init(GLenum _target, GLuint _submit_count) { 7058 SetHeader(); 7059 target = _target; 7060 submit_count = _submit_count; 7061 } 7062 7063 void* Set(void* cmd, GLenum _target, GLuint _submit_count) { 7064 static_cast<ValueType*>(cmd)->Init(_target, _submit_count); 7065 return NextCmdAddress<ValueType>(cmd); 7066 } 7067 7068 gpu::CommandHeader header; 7069 uint32_t target; 7070 uint32_t submit_count; 7071 }; 7072 7073 COMPILE_ASSERT(sizeof(EndQueryEXT) == 12, Sizeof_EndQueryEXT_is_not_12); 7074 COMPILE_ASSERT(offsetof(EndQueryEXT, header) == 0, 7075 OffsetOf_EndQueryEXT_header_not_0); 7076 COMPILE_ASSERT(offsetof(EndQueryEXT, target) == 4, 7077 OffsetOf_EndQueryEXT_target_not_4); 7078 COMPILE_ASSERT(offsetof(EndQueryEXT, submit_count) == 8, 7079 OffsetOf_EndQueryEXT_submit_count_not_8); 7080 7081 struct InsertEventMarkerEXT { 7082 typedef InsertEventMarkerEXT ValueType; 7083 static const CommandId kCmdId = kInsertEventMarkerEXT; 7084 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7085 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7086 7087 static uint32_t ComputeSize() { 7088 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7089 } 7090 7091 void SetHeader() { header.SetCmd<ValueType>(); } 7092 7093 void Init(GLuint _bucket_id) { 7094 SetHeader(); 7095 bucket_id = _bucket_id; 7096 } 7097 7098 void* Set(void* cmd, GLuint _bucket_id) { 7099 static_cast<ValueType*>(cmd)->Init(_bucket_id); 7100 return NextCmdAddress<ValueType>(cmd); 7101 } 7102 7103 gpu::CommandHeader header; 7104 uint32_t bucket_id; 7105 }; 7106 7107 COMPILE_ASSERT(sizeof(InsertEventMarkerEXT) == 8, 7108 Sizeof_InsertEventMarkerEXT_is_not_8); 7109 COMPILE_ASSERT(offsetof(InsertEventMarkerEXT, header) == 0, 7110 OffsetOf_InsertEventMarkerEXT_header_not_0); 7111 COMPILE_ASSERT(offsetof(InsertEventMarkerEXT, bucket_id) == 4, 7112 OffsetOf_InsertEventMarkerEXT_bucket_id_not_4); 7113 7114 struct PushGroupMarkerEXT { 7115 typedef PushGroupMarkerEXT ValueType; 7116 static const CommandId kCmdId = kPushGroupMarkerEXT; 7117 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7118 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7119 7120 static uint32_t ComputeSize() { 7121 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7122 } 7123 7124 void SetHeader() { header.SetCmd<ValueType>(); } 7125 7126 void Init(GLuint _bucket_id) { 7127 SetHeader(); 7128 bucket_id = _bucket_id; 7129 } 7130 7131 void* Set(void* cmd, GLuint _bucket_id) { 7132 static_cast<ValueType*>(cmd)->Init(_bucket_id); 7133 return NextCmdAddress<ValueType>(cmd); 7134 } 7135 7136 gpu::CommandHeader header; 7137 uint32_t bucket_id; 7138 }; 7139 7140 COMPILE_ASSERT(sizeof(PushGroupMarkerEXT) == 8, 7141 Sizeof_PushGroupMarkerEXT_is_not_8); 7142 COMPILE_ASSERT(offsetof(PushGroupMarkerEXT, header) == 0, 7143 OffsetOf_PushGroupMarkerEXT_header_not_0); 7144 COMPILE_ASSERT(offsetof(PushGroupMarkerEXT, bucket_id) == 4, 7145 OffsetOf_PushGroupMarkerEXT_bucket_id_not_4); 7146 7147 struct PopGroupMarkerEXT { 7148 typedef PopGroupMarkerEXT ValueType; 7149 static const CommandId kCmdId = kPopGroupMarkerEXT; 7150 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7151 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7152 7153 static uint32_t ComputeSize() { 7154 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7155 } 7156 7157 void SetHeader() { header.SetCmd<ValueType>(); } 7158 7159 void Init() { SetHeader(); } 7160 7161 void* Set(void* cmd) { 7162 static_cast<ValueType*>(cmd)->Init(); 7163 return NextCmdAddress<ValueType>(cmd); 7164 } 7165 7166 gpu::CommandHeader header; 7167 }; 7168 7169 COMPILE_ASSERT(sizeof(PopGroupMarkerEXT) == 4, 7170 Sizeof_PopGroupMarkerEXT_is_not_4); 7171 COMPILE_ASSERT(offsetof(PopGroupMarkerEXT, header) == 0, 7172 OffsetOf_PopGroupMarkerEXT_header_not_0); 7173 7174 struct GenVertexArraysOESImmediate { 7175 typedef GenVertexArraysOESImmediate ValueType; 7176 static const CommandId kCmdId = kGenVertexArraysOESImmediate; 7177 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 7178 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7179 7180 static uint32_t ComputeDataSize(GLsizei n) { 7181 return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT 7182 } 7183 7184 static uint32_t ComputeSize(GLsizei n) { 7185 return static_cast<uint32_t>(sizeof(ValueType) + 7186 ComputeDataSize(n)); // NOLINT 7187 } 7188 7189 void SetHeader(GLsizei n) { 7190 header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); 7191 } 7192 7193 void Init(GLsizei _n, GLuint* _arrays) { 7194 SetHeader(_n); 7195 n = _n; 7196 memcpy(ImmediateDataAddress(this), _arrays, ComputeDataSize(_n)); 7197 } 7198 7199 void* Set(void* cmd, GLsizei _n, GLuint* _arrays) { 7200 static_cast<ValueType*>(cmd)->Init(_n, _arrays); 7201 const uint32_t size = ComputeSize(_n); 7202 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 7203 } 7204 7205 gpu::CommandHeader header; 7206 int32_t n; 7207 }; 7208 7209 COMPILE_ASSERT(sizeof(GenVertexArraysOESImmediate) == 8, 7210 Sizeof_GenVertexArraysOESImmediate_is_not_8); 7211 COMPILE_ASSERT(offsetof(GenVertexArraysOESImmediate, header) == 0, 7212 OffsetOf_GenVertexArraysOESImmediate_header_not_0); 7213 COMPILE_ASSERT(offsetof(GenVertexArraysOESImmediate, n) == 4, 7214 OffsetOf_GenVertexArraysOESImmediate_n_not_4); 7215 7216 struct DeleteVertexArraysOESImmediate { 7217 typedef DeleteVertexArraysOESImmediate ValueType; 7218 static const CommandId kCmdId = kDeleteVertexArraysOESImmediate; 7219 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 7220 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7221 7222 static uint32_t ComputeDataSize(GLsizei n) { 7223 return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT 7224 } 7225 7226 static uint32_t ComputeSize(GLsizei n) { 7227 return static_cast<uint32_t>(sizeof(ValueType) + 7228 ComputeDataSize(n)); // NOLINT 7229 } 7230 7231 void SetHeader(GLsizei n) { 7232 header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); 7233 } 7234 7235 void Init(GLsizei _n, const GLuint* _arrays) { 7236 SetHeader(_n); 7237 n = _n; 7238 memcpy(ImmediateDataAddress(this), _arrays, ComputeDataSize(_n)); 7239 } 7240 7241 void* Set(void* cmd, GLsizei _n, const GLuint* _arrays) { 7242 static_cast<ValueType*>(cmd)->Init(_n, _arrays); 7243 const uint32_t size = ComputeSize(_n); 7244 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 7245 } 7246 7247 gpu::CommandHeader header; 7248 int32_t n; 7249 }; 7250 7251 COMPILE_ASSERT(sizeof(DeleteVertexArraysOESImmediate) == 8, 7252 Sizeof_DeleteVertexArraysOESImmediate_is_not_8); 7253 COMPILE_ASSERT(offsetof(DeleteVertexArraysOESImmediate, header) == 0, 7254 OffsetOf_DeleteVertexArraysOESImmediate_header_not_0); 7255 COMPILE_ASSERT(offsetof(DeleteVertexArraysOESImmediate, n) == 4, 7256 OffsetOf_DeleteVertexArraysOESImmediate_n_not_4); 7257 7258 struct IsVertexArrayOES { 7259 typedef IsVertexArrayOES ValueType; 7260 static const CommandId kCmdId = kIsVertexArrayOES; 7261 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7262 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7263 7264 typedef uint32_t Result; 7265 7266 static uint32_t ComputeSize() { 7267 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7268 } 7269 7270 void SetHeader() { header.SetCmd<ValueType>(); } 7271 7272 void Init(GLuint _array, 7273 uint32_t _result_shm_id, 7274 uint32_t _result_shm_offset) { 7275 SetHeader(); 7276 array = _array; 7277 result_shm_id = _result_shm_id; 7278 result_shm_offset = _result_shm_offset; 7279 } 7280 7281 void* Set(void* cmd, 7282 GLuint _array, 7283 uint32_t _result_shm_id, 7284 uint32_t _result_shm_offset) { 7285 static_cast<ValueType*>(cmd) 7286 ->Init(_array, _result_shm_id, _result_shm_offset); 7287 return NextCmdAddress<ValueType>(cmd); 7288 } 7289 7290 gpu::CommandHeader header; 7291 uint32_t array; 7292 uint32_t result_shm_id; 7293 uint32_t result_shm_offset; 7294 }; 7295 7296 COMPILE_ASSERT(sizeof(IsVertexArrayOES) == 16, 7297 Sizeof_IsVertexArrayOES_is_not_16); 7298 COMPILE_ASSERT(offsetof(IsVertexArrayOES, header) == 0, 7299 OffsetOf_IsVertexArrayOES_header_not_0); 7300 COMPILE_ASSERT(offsetof(IsVertexArrayOES, array) == 4, 7301 OffsetOf_IsVertexArrayOES_array_not_4); 7302 COMPILE_ASSERT(offsetof(IsVertexArrayOES, result_shm_id) == 8, 7303 OffsetOf_IsVertexArrayOES_result_shm_id_not_8); 7304 COMPILE_ASSERT(offsetof(IsVertexArrayOES, result_shm_offset) == 12, 7305 OffsetOf_IsVertexArrayOES_result_shm_offset_not_12); 7306 7307 struct BindVertexArrayOES { 7308 typedef BindVertexArrayOES ValueType; 7309 static const CommandId kCmdId = kBindVertexArrayOES; 7310 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7311 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7312 7313 static uint32_t ComputeSize() { 7314 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7315 } 7316 7317 void SetHeader() { header.SetCmd<ValueType>(); } 7318 7319 void Init(GLuint _array) { 7320 SetHeader(); 7321 array = _array; 7322 } 7323 7324 void* Set(void* cmd, GLuint _array) { 7325 static_cast<ValueType*>(cmd)->Init(_array); 7326 return NextCmdAddress<ValueType>(cmd); 7327 } 7328 7329 gpu::CommandHeader header; 7330 uint32_t array; 7331 }; 7332 7333 COMPILE_ASSERT(sizeof(BindVertexArrayOES) == 8, 7334 Sizeof_BindVertexArrayOES_is_not_8); 7335 COMPILE_ASSERT(offsetof(BindVertexArrayOES, header) == 0, 7336 OffsetOf_BindVertexArrayOES_header_not_0); 7337 COMPILE_ASSERT(offsetof(BindVertexArrayOES, array) == 4, 7338 OffsetOf_BindVertexArrayOES_array_not_4); 7339 7340 struct SwapBuffers { 7341 typedef SwapBuffers ValueType; 7342 static const CommandId kCmdId = kSwapBuffers; 7343 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7344 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 7345 7346 static uint32_t ComputeSize() { 7347 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7348 } 7349 7350 void SetHeader() { header.SetCmd<ValueType>(); } 7351 7352 void Init() { SetHeader(); } 7353 7354 void* Set(void* cmd) { 7355 static_cast<ValueType*>(cmd)->Init(); 7356 return NextCmdAddress<ValueType>(cmd); 7357 } 7358 7359 gpu::CommandHeader header; 7360 }; 7361 7362 COMPILE_ASSERT(sizeof(SwapBuffers) == 4, Sizeof_SwapBuffers_is_not_4); 7363 COMPILE_ASSERT(offsetof(SwapBuffers, header) == 0, 7364 OffsetOf_SwapBuffers_header_not_0); 7365 7366 struct GetMaxValueInBufferCHROMIUM { 7367 typedef GetMaxValueInBufferCHROMIUM ValueType; 7368 static const CommandId kCmdId = kGetMaxValueInBufferCHROMIUM; 7369 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7370 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7371 7372 typedef GLuint Result; 7373 7374 static uint32_t ComputeSize() { 7375 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7376 } 7377 7378 void SetHeader() { header.SetCmd<ValueType>(); } 7379 7380 void Init(GLuint _buffer_id, 7381 GLsizei _count, 7382 GLenum _type, 7383 GLuint _offset, 7384 uint32_t _result_shm_id, 7385 uint32_t _result_shm_offset) { 7386 SetHeader(); 7387 buffer_id = _buffer_id; 7388 count = _count; 7389 type = _type; 7390 offset = _offset; 7391 result_shm_id = _result_shm_id; 7392 result_shm_offset = _result_shm_offset; 7393 } 7394 7395 void* Set(void* cmd, 7396 GLuint _buffer_id, 7397 GLsizei _count, 7398 GLenum _type, 7399 GLuint _offset, 7400 uint32_t _result_shm_id, 7401 uint32_t _result_shm_offset) { 7402 static_cast<ValueType*>(cmd)->Init( 7403 _buffer_id, _count, _type, _offset, _result_shm_id, _result_shm_offset); 7404 return NextCmdAddress<ValueType>(cmd); 7405 } 7406 7407 gpu::CommandHeader header; 7408 uint32_t buffer_id; 7409 int32_t count; 7410 uint32_t type; 7411 uint32_t offset; 7412 uint32_t result_shm_id; 7413 uint32_t result_shm_offset; 7414 }; 7415 7416 COMPILE_ASSERT(sizeof(GetMaxValueInBufferCHROMIUM) == 28, 7417 Sizeof_GetMaxValueInBufferCHROMIUM_is_not_28); 7418 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, header) == 0, 7419 OffsetOf_GetMaxValueInBufferCHROMIUM_header_not_0); 7420 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, buffer_id) == 4, 7421 OffsetOf_GetMaxValueInBufferCHROMIUM_buffer_id_not_4); 7422 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, count) == 8, 7423 OffsetOf_GetMaxValueInBufferCHROMIUM_count_not_8); 7424 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, type) == 12, 7425 OffsetOf_GetMaxValueInBufferCHROMIUM_type_not_12); 7426 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, offset) == 16, 7427 OffsetOf_GetMaxValueInBufferCHROMIUM_offset_not_16); 7428 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, result_shm_id) == 20, 7429 OffsetOf_GetMaxValueInBufferCHROMIUM_result_shm_id_not_20); 7430 COMPILE_ASSERT(offsetof(GetMaxValueInBufferCHROMIUM, result_shm_offset) == 24, 7431 OffsetOf_GetMaxValueInBufferCHROMIUM_result_shm_offset_not_24); 7432 7433 struct GenSharedIdsCHROMIUM { 7434 typedef GenSharedIdsCHROMIUM ValueType; 7435 static const CommandId kCmdId = kGenSharedIdsCHROMIUM; 7436 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7437 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7438 7439 static uint32_t ComputeSize() { 7440 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7441 } 7442 7443 void SetHeader() { header.SetCmd<ValueType>(); } 7444 7445 void Init(GLuint _namespace_id, 7446 GLuint _id_offset, 7447 GLsizei _n, 7448 uint32_t _ids_shm_id, 7449 uint32_t _ids_shm_offset) { 7450 SetHeader(); 7451 namespace_id = _namespace_id; 7452 id_offset = _id_offset; 7453 n = _n; 7454 ids_shm_id = _ids_shm_id; 7455 ids_shm_offset = _ids_shm_offset; 7456 } 7457 7458 void* Set(void* cmd, 7459 GLuint _namespace_id, 7460 GLuint _id_offset, 7461 GLsizei _n, 7462 uint32_t _ids_shm_id, 7463 uint32_t _ids_shm_offset) { 7464 static_cast<ValueType*>(cmd) 7465 ->Init(_namespace_id, _id_offset, _n, _ids_shm_id, _ids_shm_offset); 7466 return NextCmdAddress<ValueType>(cmd); 7467 } 7468 7469 gpu::CommandHeader header; 7470 uint32_t namespace_id; 7471 uint32_t id_offset; 7472 int32_t n; 7473 uint32_t ids_shm_id; 7474 uint32_t ids_shm_offset; 7475 }; 7476 7477 COMPILE_ASSERT(sizeof(GenSharedIdsCHROMIUM) == 24, 7478 Sizeof_GenSharedIdsCHROMIUM_is_not_24); 7479 COMPILE_ASSERT(offsetof(GenSharedIdsCHROMIUM, header) == 0, 7480 OffsetOf_GenSharedIdsCHROMIUM_header_not_0); 7481 COMPILE_ASSERT(offsetof(GenSharedIdsCHROMIUM, namespace_id) == 4, 7482 OffsetOf_GenSharedIdsCHROMIUM_namespace_id_not_4); 7483 COMPILE_ASSERT(offsetof(GenSharedIdsCHROMIUM, id_offset) == 8, 7484 OffsetOf_GenSharedIdsCHROMIUM_id_offset_not_8); 7485 COMPILE_ASSERT(offsetof(GenSharedIdsCHROMIUM, n) == 12, 7486 OffsetOf_GenSharedIdsCHROMIUM_n_not_12); 7487 COMPILE_ASSERT(offsetof(GenSharedIdsCHROMIUM, ids_shm_id) == 16, 7488 OffsetOf_GenSharedIdsCHROMIUM_ids_shm_id_not_16); 7489 COMPILE_ASSERT(offsetof(GenSharedIdsCHROMIUM, ids_shm_offset) == 20, 7490 OffsetOf_GenSharedIdsCHROMIUM_ids_shm_offset_not_20); 7491 7492 struct DeleteSharedIdsCHROMIUM { 7493 typedef DeleteSharedIdsCHROMIUM ValueType; 7494 static const CommandId kCmdId = kDeleteSharedIdsCHROMIUM; 7495 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7496 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7497 7498 static uint32_t ComputeSize() { 7499 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7500 } 7501 7502 void SetHeader() { header.SetCmd<ValueType>(); } 7503 7504 void Init(GLuint _namespace_id, 7505 GLsizei _n, 7506 uint32_t _ids_shm_id, 7507 uint32_t _ids_shm_offset) { 7508 SetHeader(); 7509 namespace_id = _namespace_id; 7510 n = _n; 7511 ids_shm_id = _ids_shm_id; 7512 ids_shm_offset = _ids_shm_offset; 7513 } 7514 7515 void* Set(void* cmd, 7516 GLuint _namespace_id, 7517 GLsizei _n, 7518 uint32_t _ids_shm_id, 7519 uint32_t _ids_shm_offset) { 7520 static_cast<ValueType*>(cmd) 7521 ->Init(_namespace_id, _n, _ids_shm_id, _ids_shm_offset); 7522 return NextCmdAddress<ValueType>(cmd); 7523 } 7524 7525 gpu::CommandHeader header; 7526 uint32_t namespace_id; 7527 int32_t n; 7528 uint32_t ids_shm_id; 7529 uint32_t ids_shm_offset; 7530 }; 7531 7532 COMPILE_ASSERT(sizeof(DeleteSharedIdsCHROMIUM) == 20, 7533 Sizeof_DeleteSharedIdsCHROMIUM_is_not_20); 7534 COMPILE_ASSERT(offsetof(DeleteSharedIdsCHROMIUM, header) == 0, 7535 OffsetOf_DeleteSharedIdsCHROMIUM_header_not_0); 7536 COMPILE_ASSERT(offsetof(DeleteSharedIdsCHROMIUM, namespace_id) == 4, 7537 OffsetOf_DeleteSharedIdsCHROMIUM_namespace_id_not_4); 7538 COMPILE_ASSERT(offsetof(DeleteSharedIdsCHROMIUM, n) == 8, 7539 OffsetOf_DeleteSharedIdsCHROMIUM_n_not_8); 7540 COMPILE_ASSERT(offsetof(DeleteSharedIdsCHROMIUM, ids_shm_id) == 12, 7541 OffsetOf_DeleteSharedIdsCHROMIUM_ids_shm_id_not_12); 7542 COMPILE_ASSERT(offsetof(DeleteSharedIdsCHROMIUM, ids_shm_offset) == 16, 7543 OffsetOf_DeleteSharedIdsCHROMIUM_ids_shm_offset_not_16); 7544 7545 struct RegisterSharedIdsCHROMIUM { 7546 typedef RegisterSharedIdsCHROMIUM ValueType; 7547 static const CommandId kCmdId = kRegisterSharedIdsCHROMIUM; 7548 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7549 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7550 7551 static uint32_t ComputeSize() { 7552 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7553 } 7554 7555 void SetHeader() { header.SetCmd<ValueType>(); } 7556 7557 void Init(GLuint _namespace_id, 7558 GLsizei _n, 7559 uint32_t _ids_shm_id, 7560 uint32_t _ids_shm_offset) { 7561 SetHeader(); 7562 namespace_id = _namespace_id; 7563 n = _n; 7564 ids_shm_id = _ids_shm_id; 7565 ids_shm_offset = _ids_shm_offset; 7566 } 7567 7568 void* Set(void* cmd, 7569 GLuint _namespace_id, 7570 GLsizei _n, 7571 uint32_t _ids_shm_id, 7572 uint32_t _ids_shm_offset) { 7573 static_cast<ValueType*>(cmd) 7574 ->Init(_namespace_id, _n, _ids_shm_id, _ids_shm_offset); 7575 return NextCmdAddress<ValueType>(cmd); 7576 } 7577 7578 gpu::CommandHeader header; 7579 uint32_t namespace_id; 7580 int32_t n; 7581 uint32_t ids_shm_id; 7582 uint32_t ids_shm_offset; 7583 }; 7584 7585 COMPILE_ASSERT(sizeof(RegisterSharedIdsCHROMIUM) == 20, 7586 Sizeof_RegisterSharedIdsCHROMIUM_is_not_20); 7587 COMPILE_ASSERT(offsetof(RegisterSharedIdsCHROMIUM, header) == 0, 7588 OffsetOf_RegisterSharedIdsCHROMIUM_header_not_0); 7589 COMPILE_ASSERT(offsetof(RegisterSharedIdsCHROMIUM, namespace_id) == 4, 7590 OffsetOf_RegisterSharedIdsCHROMIUM_namespace_id_not_4); 7591 COMPILE_ASSERT(offsetof(RegisterSharedIdsCHROMIUM, n) == 8, 7592 OffsetOf_RegisterSharedIdsCHROMIUM_n_not_8); 7593 COMPILE_ASSERT(offsetof(RegisterSharedIdsCHROMIUM, ids_shm_id) == 12, 7594 OffsetOf_RegisterSharedIdsCHROMIUM_ids_shm_id_not_12); 7595 COMPILE_ASSERT(offsetof(RegisterSharedIdsCHROMIUM, ids_shm_offset) == 16, 7596 OffsetOf_RegisterSharedIdsCHROMIUM_ids_shm_offset_not_16); 7597 7598 struct EnableFeatureCHROMIUM { 7599 typedef EnableFeatureCHROMIUM ValueType; 7600 static const CommandId kCmdId = kEnableFeatureCHROMIUM; 7601 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7602 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7603 7604 typedef GLint Result; 7605 7606 static uint32_t ComputeSize() { 7607 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7608 } 7609 7610 void SetHeader() { header.SetCmd<ValueType>(); } 7611 7612 void Init(GLuint _bucket_id, 7613 uint32_t _result_shm_id, 7614 uint32_t _result_shm_offset) { 7615 SetHeader(); 7616 bucket_id = _bucket_id; 7617 result_shm_id = _result_shm_id; 7618 result_shm_offset = _result_shm_offset; 7619 } 7620 7621 void* Set(void* cmd, 7622 GLuint _bucket_id, 7623 uint32_t _result_shm_id, 7624 uint32_t _result_shm_offset) { 7625 static_cast<ValueType*>(cmd) 7626 ->Init(_bucket_id, _result_shm_id, _result_shm_offset); 7627 return NextCmdAddress<ValueType>(cmd); 7628 } 7629 7630 gpu::CommandHeader header; 7631 uint32_t bucket_id; 7632 uint32_t result_shm_id; 7633 uint32_t result_shm_offset; 7634 }; 7635 7636 COMPILE_ASSERT(sizeof(EnableFeatureCHROMIUM) == 16, 7637 Sizeof_EnableFeatureCHROMIUM_is_not_16); 7638 COMPILE_ASSERT(offsetof(EnableFeatureCHROMIUM, header) == 0, 7639 OffsetOf_EnableFeatureCHROMIUM_header_not_0); 7640 COMPILE_ASSERT(offsetof(EnableFeatureCHROMIUM, bucket_id) == 4, 7641 OffsetOf_EnableFeatureCHROMIUM_bucket_id_not_4); 7642 COMPILE_ASSERT(offsetof(EnableFeatureCHROMIUM, result_shm_id) == 8, 7643 OffsetOf_EnableFeatureCHROMIUM_result_shm_id_not_8); 7644 COMPILE_ASSERT(offsetof(EnableFeatureCHROMIUM, result_shm_offset) == 12, 7645 OffsetOf_EnableFeatureCHROMIUM_result_shm_offset_not_12); 7646 7647 struct ResizeCHROMIUM { 7648 typedef ResizeCHROMIUM ValueType; 7649 static const CommandId kCmdId = kResizeCHROMIUM; 7650 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7651 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7652 7653 static uint32_t ComputeSize() { 7654 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7655 } 7656 7657 void SetHeader() { header.SetCmd<ValueType>(); } 7658 7659 void Init(GLuint _width, GLuint _height, GLfloat _scale_factor) { 7660 SetHeader(); 7661 width = _width; 7662 height = _height; 7663 scale_factor = _scale_factor; 7664 } 7665 7666 void* Set(void* cmd, GLuint _width, GLuint _height, GLfloat _scale_factor) { 7667 static_cast<ValueType*>(cmd)->Init(_width, _height, _scale_factor); 7668 return NextCmdAddress<ValueType>(cmd); 7669 } 7670 7671 gpu::CommandHeader header; 7672 uint32_t width; 7673 uint32_t height; 7674 float scale_factor; 7675 }; 7676 7677 COMPILE_ASSERT(sizeof(ResizeCHROMIUM) == 16, Sizeof_ResizeCHROMIUM_is_not_16); 7678 COMPILE_ASSERT(offsetof(ResizeCHROMIUM, header) == 0, 7679 OffsetOf_ResizeCHROMIUM_header_not_0); 7680 COMPILE_ASSERT(offsetof(ResizeCHROMIUM, width) == 4, 7681 OffsetOf_ResizeCHROMIUM_width_not_4); 7682 COMPILE_ASSERT(offsetof(ResizeCHROMIUM, height) == 8, 7683 OffsetOf_ResizeCHROMIUM_height_not_8); 7684 COMPILE_ASSERT(offsetof(ResizeCHROMIUM, scale_factor) == 12, 7685 OffsetOf_ResizeCHROMIUM_scale_factor_not_12); 7686 7687 struct GetRequestableExtensionsCHROMIUM { 7688 typedef GetRequestableExtensionsCHROMIUM ValueType; 7689 static const CommandId kCmdId = kGetRequestableExtensionsCHROMIUM; 7690 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7691 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7692 7693 static uint32_t ComputeSize() { 7694 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7695 } 7696 7697 void SetHeader() { header.SetCmd<ValueType>(); } 7698 7699 void Init(uint32_t _bucket_id) { 7700 SetHeader(); 7701 bucket_id = _bucket_id; 7702 } 7703 7704 void* Set(void* cmd, uint32_t _bucket_id) { 7705 static_cast<ValueType*>(cmd)->Init(_bucket_id); 7706 return NextCmdAddress<ValueType>(cmd); 7707 } 7708 7709 gpu::CommandHeader header; 7710 uint32_t bucket_id; 7711 }; 7712 7713 COMPILE_ASSERT(sizeof(GetRequestableExtensionsCHROMIUM) == 8, 7714 Sizeof_GetRequestableExtensionsCHROMIUM_is_not_8); 7715 COMPILE_ASSERT(offsetof(GetRequestableExtensionsCHROMIUM, header) == 0, 7716 OffsetOf_GetRequestableExtensionsCHROMIUM_header_not_0); 7717 COMPILE_ASSERT(offsetof(GetRequestableExtensionsCHROMIUM, bucket_id) == 4, 7718 OffsetOf_GetRequestableExtensionsCHROMIUM_bucket_id_not_4); 7719 7720 struct RequestExtensionCHROMIUM { 7721 typedef RequestExtensionCHROMIUM ValueType; 7722 static const CommandId kCmdId = kRequestExtensionCHROMIUM; 7723 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7724 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7725 7726 static uint32_t ComputeSize() { 7727 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7728 } 7729 7730 void SetHeader() { header.SetCmd<ValueType>(); } 7731 7732 void Init(uint32_t _bucket_id) { 7733 SetHeader(); 7734 bucket_id = _bucket_id; 7735 } 7736 7737 void* Set(void* cmd, uint32_t _bucket_id) { 7738 static_cast<ValueType*>(cmd)->Init(_bucket_id); 7739 return NextCmdAddress<ValueType>(cmd); 7740 } 7741 7742 gpu::CommandHeader header; 7743 uint32_t bucket_id; 7744 }; 7745 7746 COMPILE_ASSERT(sizeof(RequestExtensionCHROMIUM) == 8, 7747 Sizeof_RequestExtensionCHROMIUM_is_not_8); 7748 COMPILE_ASSERT(offsetof(RequestExtensionCHROMIUM, header) == 0, 7749 OffsetOf_RequestExtensionCHROMIUM_header_not_0); 7750 COMPILE_ASSERT(offsetof(RequestExtensionCHROMIUM, bucket_id) == 4, 7751 OffsetOf_RequestExtensionCHROMIUM_bucket_id_not_4); 7752 7753 struct GetMultipleIntegervCHROMIUM { 7754 typedef GetMultipleIntegervCHROMIUM ValueType; 7755 static const CommandId kCmdId = kGetMultipleIntegervCHROMIUM; 7756 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7757 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7758 7759 static uint32_t ComputeSize() { 7760 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7761 } 7762 7763 void SetHeader() { header.SetCmd<ValueType>(); } 7764 7765 void Init(uint32_t _pnames_shm_id, 7766 uint32_t _pnames_shm_offset, 7767 GLuint _count, 7768 uint32_t _results_shm_id, 7769 uint32_t _results_shm_offset, 7770 GLsizeiptr _size) { 7771 SetHeader(); 7772 pnames_shm_id = _pnames_shm_id; 7773 pnames_shm_offset = _pnames_shm_offset; 7774 count = _count; 7775 results_shm_id = _results_shm_id; 7776 results_shm_offset = _results_shm_offset; 7777 size = _size; 7778 } 7779 7780 void* Set(void* cmd, 7781 uint32_t _pnames_shm_id, 7782 uint32_t _pnames_shm_offset, 7783 GLuint _count, 7784 uint32_t _results_shm_id, 7785 uint32_t _results_shm_offset, 7786 GLsizeiptr _size) { 7787 static_cast<ValueType*>(cmd)->Init(_pnames_shm_id, 7788 _pnames_shm_offset, 7789 _count, 7790 _results_shm_id, 7791 _results_shm_offset, 7792 _size); 7793 return NextCmdAddress<ValueType>(cmd); 7794 } 7795 7796 gpu::CommandHeader header; 7797 uint32_t pnames_shm_id; 7798 uint32_t pnames_shm_offset; 7799 uint32_t count; 7800 uint32_t results_shm_id; 7801 uint32_t results_shm_offset; 7802 int32_t size; 7803 }; 7804 7805 COMPILE_ASSERT(sizeof(GetMultipleIntegervCHROMIUM) == 28, 7806 Sizeof_GetMultipleIntegervCHROMIUM_is_not_28); 7807 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, header) == 0, 7808 OffsetOf_GetMultipleIntegervCHROMIUM_header_not_0); 7809 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, pnames_shm_id) == 4, 7810 OffsetOf_GetMultipleIntegervCHROMIUM_pnames_shm_id_not_4); 7811 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, pnames_shm_offset) == 8, 7812 OffsetOf_GetMultipleIntegervCHROMIUM_pnames_shm_offset_not_8); 7813 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, count) == 12, 7814 OffsetOf_GetMultipleIntegervCHROMIUM_count_not_12); 7815 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, results_shm_id) == 16, 7816 OffsetOf_GetMultipleIntegervCHROMIUM_results_shm_id_not_16); 7817 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, results_shm_offset) == 20, 7818 OffsetOf_GetMultipleIntegervCHROMIUM_results_shm_offset_not_20); 7819 COMPILE_ASSERT(offsetof(GetMultipleIntegervCHROMIUM, size) == 24, 7820 OffsetOf_GetMultipleIntegervCHROMIUM_size_not_24); 7821 7822 struct GetProgramInfoCHROMIUM { 7823 typedef GetProgramInfoCHROMIUM ValueType; 7824 static const CommandId kCmdId = kGetProgramInfoCHROMIUM; 7825 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7826 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7827 7828 struct Result { 7829 uint32_t link_status; 7830 uint32_t num_attribs; 7831 uint32_t num_uniforms; 7832 }; 7833 7834 static uint32_t ComputeSize() { 7835 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7836 } 7837 7838 void SetHeader() { header.SetCmd<ValueType>(); } 7839 7840 void Init(GLuint _program, uint32_t _bucket_id) { 7841 SetHeader(); 7842 program = _program; 7843 bucket_id = _bucket_id; 7844 } 7845 7846 void* Set(void* cmd, GLuint _program, uint32_t _bucket_id) { 7847 static_cast<ValueType*>(cmd)->Init(_program, _bucket_id); 7848 return NextCmdAddress<ValueType>(cmd); 7849 } 7850 7851 gpu::CommandHeader header; 7852 uint32_t program; 7853 uint32_t bucket_id; 7854 }; 7855 7856 COMPILE_ASSERT(sizeof(GetProgramInfoCHROMIUM) == 12, 7857 Sizeof_GetProgramInfoCHROMIUM_is_not_12); 7858 COMPILE_ASSERT(offsetof(GetProgramInfoCHROMIUM, header) == 0, 7859 OffsetOf_GetProgramInfoCHROMIUM_header_not_0); 7860 COMPILE_ASSERT(offsetof(GetProgramInfoCHROMIUM, program) == 4, 7861 OffsetOf_GetProgramInfoCHROMIUM_program_not_4); 7862 COMPILE_ASSERT(offsetof(GetProgramInfoCHROMIUM, bucket_id) == 8, 7863 OffsetOf_GetProgramInfoCHROMIUM_bucket_id_not_8); 7864 COMPILE_ASSERT(offsetof(GetProgramInfoCHROMIUM::Result, link_status) == 0, 7865 OffsetOf_GetProgramInfoCHROMIUM_Result_link_status_not_0); 7866 COMPILE_ASSERT(offsetof(GetProgramInfoCHROMIUM::Result, num_attribs) == 4, 7867 OffsetOf_GetProgramInfoCHROMIUM_Result_num_attribs_not_4); 7868 COMPILE_ASSERT(offsetof(GetProgramInfoCHROMIUM::Result, num_uniforms) == 8, 7869 OffsetOf_GetProgramInfoCHROMIUM_Result_num_uniforms_not_8); 7870 7871 struct GetTranslatedShaderSourceANGLE { 7872 typedef GetTranslatedShaderSourceANGLE ValueType; 7873 static const CommandId kCmdId = kGetTranslatedShaderSourceANGLE; 7874 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7875 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7876 7877 static uint32_t ComputeSize() { 7878 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7879 } 7880 7881 void SetHeader() { header.SetCmd<ValueType>(); } 7882 7883 void Init(GLuint _shader, uint32_t _bucket_id) { 7884 SetHeader(); 7885 shader = _shader; 7886 bucket_id = _bucket_id; 7887 } 7888 7889 void* Set(void* cmd, GLuint _shader, uint32_t _bucket_id) { 7890 static_cast<ValueType*>(cmd)->Init(_shader, _bucket_id); 7891 return NextCmdAddress<ValueType>(cmd); 7892 } 7893 7894 gpu::CommandHeader header; 7895 uint32_t shader; 7896 uint32_t bucket_id; 7897 }; 7898 7899 COMPILE_ASSERT(sizeof(GetTranslatedShaderSourceANGLE) == 12, 7900 Sizeof_GetTranslatedShaderSourceANGLE_is_not_12); 7901 COMPILE_ASSERT(offsetof(GetTranslatedShaderSourceANGLE, header) == 0, 7902 OffsetOf_GetTranslatedShaderSourceANGLE_header_not_0); 7903 COMPILE_ASSERT(offsetof(GetTranslatedShaderSourceANGLE, shader) == 4, 7904 OffsetOf_GetTranslatedShaderSourceANGLE_shader_not_4); 7905 COMPILE_ASSERT(offsetof(GetTranslatedShaderSourceANGLE, bucket_id) == 8, 7906 OffsetOf_GetTranslatedShaderSourceANGLE_bucket_id_not_8); 7907 7908 struct PostSubBufferCHROMIUM { 7909 typedef PostSubBufferCHROMIUM ValueType; 7910 static const CommandId kCmdId = kPostSubBufferCHROMIUM; 7911 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7912 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7913 7914 static uint32_t ComputeSize() { 7915 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7916 } 7917 7918 void SetHeader() { header.SetCmd<ValueType>(); } 7919 7920 void Init(GLint _x, GLint _y, GLint _width, GLint _height) { 7921 SetHeader(); 7922 x = _x; 7923 y = _y; 7924 width = _width; 7925 height = _height; 7926 } 7927 7928 void* Set(void* cmd, GLint _x, GLint _y, GLint _width, GLint _height) { 7929 static_cast<ValueType*>(cmd)->Init(_x, _y, _width, _height); 7930 return NextCmdAddress<ValueType>(cmd); 7931 } 7932 7933 gpu::CommandHeader header; 7934 int32_t x; 7935 int32_t y; 7936 int32_t width; 7937 int32_t height; 7938 }; 7939 7940 COMPILE_ASSERT(sizeof(PostSubBufferCHROMIUM) == 20, 7941 Sizeof_PostSubBufferCHROMIUM_is_not_20); 7942 COMPILE_ASSERT(offsetof(PostSubBufferCHROMIUM, header) == 0, 7943 OffsetOf_PostSubBufferCHROMIUM_header_not_0); 7944 COMPILE_ASSERT(offsetof(PostSubBufferCHROMIUM, x) == 4, 7945 OffsetOf_PostSubBufferCHROMIUM_x_not_4); 7946 COMPILE_ASSERT(offsetof(PostSubBufferCHROMIUM, y) == 8, 7947 OffsetOf_PostSubBufferCHROMIUM_y_not_8); 7948 COMPILE_ASSERT(offsetof(PostSubBufferCHROMIUM, width) == 12, 7949 OffsetOf_PostSubBufferCHROMIUM_width_not_12); 7950 COMPILE_ASSERT(offsetof(PostSubBufferCHROMIUM, height) == 16, 7951 OffsetOf_PostSubBufferCHROMIUM_height_not_16); 7952 7953 struct TexImageIOSurface2DCHROMIUM { 7954 typedef TexImageIOSurface2DCHROMIUM ValueType; 7955 static const CommandId kCmdId = kTexImageIOSurface2DCHROMIUM; 7956 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 7957 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 7958 7959 static uint32_t ComputeSize() { 7960 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 7961 } 7962 7963 void SetHeader() { header.SetCmd<ValueType>(); } 7964 7965 void Init(GLenum _target, 7966 GLsizei _width, 7967 GLsizei _height, 7968 GLuint _ioSurfaceId, 7969 GLuint _plane) { 7970 SetHeader(); 7971 target = _target; 7972 width = _width; 7973 height = _height; 7974 ioSurfaceId = _ioSurfaceId; 7975 plane = _plane; 7976 } 7977 7978 void* Set(void* cmd, 7979 GLenum _target, 7980 GLsizei _width, 7981 GLsizei _height, 7982 GLuint _ioSurfaceId, 7983 GLuint _plane) { 7984 static_cast<ValueType*>(cmd) 7985 ->Init(_target, _width, _height, _ioSurfaceId, _plane); 7986 return NextCmdAddress<ValueType>(cmd); 7987 } 7988 7989 gpu::CommandHeader header; 7990 uint32_t target; 7991 int32_t width; 7992 int32_t height; 7993 uint32_t ioSurfaceId; 7994 uint32_t plane; 7995 }; 7996 7997 COMPILE_ASSERT(sizeof(TexImageIOSurface2DCHROMIUM) == 24, 7998 Sizeof_TexImageIOSurface2DCHROMIUM_is_not_24); 7999 COMPILE_ASSERT(offsetof(TexImageIOSurface2DCHROMIUM, header) == 0, 8000 OffsetOf_TexImageIOSurface2DCHROMIUM_header_not_0); 8001 COMPILE_ASSERT(offsetof(TexImageIOSurface2DCHROMIUM, target) == 4, 8002 OffsetOf_TexImageIOSurface2DCHROMIUM_target_not_4); 8003 COMPILE_ASSERT(offsetof(TexImageIOSurface2DCHROMIUM, width) == 8, 8004 OffsetOf_TexImageIOSurface2DCHROMIUM_width_not_8); 8005 COMPILE_ASSERT(offsetof(TexImageIOSurface2DCHROMIUM, height) == 12, 8006 OffsetOf_TexImageIOSurface2DCHROMIUM_height_not_12); 8007 COMPILE_ASSERT(offsetof(TexImageIOSurface2DCHROMIUM, ioSurfaceId) == 16, 8008 OffsetOf_TexImageIOSurface2DCHROMIUM_ioSurfaceId_not_16); 8009 COMPILE_ASSERT(offsetof(TexImageIOSurface2DCHROMIUM, plane) == 20, 8010 OffsetOf_TexImageIOSurface2DCHROMIUM_plane_not_20); 8011 8012 struct CopyTextureCHROMIUM { 8013 typedef CopyTextureCHROMIUM ValueType; 8014 static const CommandId kCmdId = kCopyTextureCHROMIUM; 8015 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8016 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8017 8018 static uint32_t ComputeSize() { 8019 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8020 } 8021 8022 void SetHeader() { header.SetCmd<ValueType>(); } 8023 8024 void Init(GLenum _target, 8025 GLenum _source_id, 8026 GLenum _dest_id, 8027 GLint _level, 8028 GLint _internalformat, 8029 GLenum _dest_type) { 8030 SetHeader(); 8031 target = _target; 8032 source_id = _source_id; 8033 dest_id = _dest_id; 8034 level = _level; 8035 internalformat = _internalformat; 8036 dest_type = _dest_type; 8037 } 8038 8039 void* Set(void* cmd, 8040 GLenum _target, 8041 GLenum _source_id, 8042 GLenum _dest_id, 8043 GLint _level, 8044 GLint _internalformat, 8045 GLenum _dest_type) { 8046 static_cast<ValueType*>(cmd)->Init( 8047 _target, _source_id, _dest_id, _level, _internalformat, _dest_type); 8048 return NextCmdAddress<ValueType>(cmd); 8049 } 8050 8051 gpu::CommandHeader header; 8052 uint32_t target; 8053 uint32_t source_id; 8054 uint32_t dest_id; 8055 int32_t level; 8056 int32_t internalformat; 8057 uint32_t dest_type; 8058 }; 8059 8060 COMPILE_ASSERT(sizeof(CopyTextureCHROMIUM) == 28, 8061 Sizeof_CopyTextureCHROMIUM_is_not_28); 8062 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, header) == 0, 8063 OffsetOf_CopyTextureCHROMIUM_header_not_0); 8064 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, target) == 4, 8065 OffsetOf_CopyTextureCHROMIUM_target_not_4); 8066 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, source_id) == 8, 8067 OffsetOf_CopyTextureCHROMIUM_source_id_not_8); 8068 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, dest_id) == 12, 8069 OffsetOf_CopyTextureCHROMIUM_dest_id_not_12); 8070 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, level) == 16, 8071 OffsetOf_CopyTextureCHROMIUM_level_not_16); 8072 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, internalformat) == 20, 8073 OffsetOf_CopyTextureCHROMIUM_internalformat_not_20); 8074 COMPILE_ASSERT(offsetof(CopyTextureCHROMIUM, dest_type) == 24, 8075 OffsetOf_CopyTextureCHROMIUM_dest_type_not_24); 8076 8077 struct DrawArraysInstancedANGLE { 8078 typedef DrawArraysInstancedANGLE ValueType; 8079 static const CommandId kCmdId = kDrawArraysInstancedANGLE; 8080 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8081 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8082 8083 static uint32_t ComputeSize() { 8084 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8085 } 8086 8087 void SetHeader() { header.SetCmd<ValueType>(); } 8088 8089 void Init(GLenum _mode, GLint _first, GLsizei _count, GLsizei _primcount) { 8090 SetHeader(); 8091 mode = _mode; 8092 first = _first; 8093 count = _count; 8094 primcount = _primcount; 8095 } 8096 8097 void* Set(void* cmd, 8098 GLenum _mode, 8099 GLint _first, 8100 GLsizei _count, 8101 GLsizei _primcount) { 8102 static_cast<ValueType*>(cmd)->Init(_mode, _first, _count, _primcount); 8103 return NextCmdAddress<ValueType>(cmd); 8104 } 8105 8106 gpu::CommandHeader header; 8107 uint32_t mode; 8108 int32_t first; 8109 int32_t count; 8110 int32_t primcount; 8111 }; 8112 8113 COMPILE_ASSERT(sizeof(DrawArraysInstancedANGLE) == 20, 8114 Sizeof_DrawArraysInstancedANGLE_is_not_20); 8115 COMPILE_ASSERT(offsetof(DrawArraysInstancedANGLE, header) == 0, 8116 OffsetOf_DrawArraysInstancedANGLE_header_not_0); 8117 COMPILE_ASSERT(offsetof(DrawArraysInstancedANGLE, mode) == 4, 8118 OffsetOf_DrawArraysInstancedANGLE_mode_not_4); 8119 COMPILE_ASSERT(offsetof(DrawArraysInstancedANGLE, first) == 8, 8120 OffsetOf_DrawArraysInstancedANGLE_first_not_8); 8121 COMPILE_ASSERT(offsetof(DrawArraysInstancedANGLE, count) == 12, 8122 OffsetOf_DrawArraysInstancedANGLE_count_not_12); 8123 COMPILE_ASSERT(offsetof(DrawArraysInstancedANGLE, primcount) == 16, 8124 OffsetOf_DrawArraysInstancedANGLE_primcount_not_16); 8125 8126 struct DrawElementsInstancedANGLE { 8127 typedef DrawElementsInstancedANGLE ValueType; 8128 static const CommandId kCmdId = kDrawElementsInstancedANGLE; 8129 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8130 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8131 8132 static uint32_t ComputeSize() { 8133 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8134 } 8135 8136 void SetHeader() { header.SetCmd<ValueType>(); } 8137 8138 void Init(GLenum _mode, 8139 GLsizei _count, 8140 GLenum _type, 8141 GLuint _index_offset, 8142 GLsizei _primcount) { 8143 SetHeader(); 8144 mode = _mode; 8145 count = _count; 8146 type = _type; 8147 index_offset = _index_offset; 8148 primcount = _primcount; 8149 } 8150 8151 void* Set(void* cmd, 8152 GLenum _mode, 8153 GLsizei _count, 8154 GLenum _type, 8155 GLuint _index_offset, 8156 GLsizei _primcount) { 8157 static_cast<ValueType*>(cmd) 8158 ->Init(_mode, _count, _type, _index_offset, _primcount); 8159 return NextCmdAddress<ValueType>(cmd); 8160 } 8161 8162 gpu::CommandHeader header; 8163 uint32_t mode; 8164 int32_t count; 8165 uint32_t type; 8166 uint32_t index_offset; 8167 int32_t primcount; 8168 }; 8169 8170 COMPILE_ASSERT(sizeof(DrawElementsInstancedANGLE) == 24, 8171 Sizeof_DrawElementsInstancedANGLE_is_not_24); 8172 COMPILE_ASSERT(offsetof(DrawElementsInstancedANGLE, header) == 0, 8173 OffsetOf_DrawElementsInstancedANGLE_header_not_0); 8174 COMPILE_ASSERT(offsetof(DrawElementsInstancedANGLE, mode) == 4, 8175 OffsetOf_DrawElementsInstancedANGLE_mode_not_4); 8176 COMPILE_ASSERT(offsetof(DrawElementsInstancedANGLE, count) == 8, 8177 OffsetOf_DrawElementsInstancedANGLE_count_not_8); 8178 COMPILE_ASSERT(offsetof(DrawElementsInstancedANGLE, type) == 12, 8179 OffsetOf_DrawElementsInstancedANGLE_type_not_12); 8180 COMPILE_ASSERT(offsetof(DrawElementsInstancedANGLE, index_offset) == 16, 8181 OffsetOf_DrawElementsInstancedANGLE_index_offset_not_16); 8182 COMPILE_ASSERT(offsetof(DrawElementsInstancedANGLE, primcount) == 20, 8183 OffsetOf_DrawElementsInstancedANGLE_primcount_not_20); 8184 8185 struct VertexAttribDivisorANGLE { 8186 typedef VertexAttribDivisorANGLE ValueType; 8187 static const CommandId kCmdId = kVertexAttribDivisorANGLE; 8188 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8189 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8190 8191 static uint32_t ComputeSize() { 8192 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8193 } 8194 8195 void SetHeader() { header.SetCmd<ValueType>(); } 8196 8197 void Init(GLuint _index, GLuint _divisor) { 8198 SetHeader(); 8199 index = _index; 8200 divisor = _divisor; 8201 } 8202 8203 void* Set(void* cmd, GLuint _index, GLuint _divisor) { 8204 static_cast<ValueType*>(cmd)->Init(_index, _divisor); 8205 return NextCmdAddress<ValueType>(cmd); 8206 } 8207 8208 gpu::CommandHeader header; 8209 uint32_t index; 8210 uint32_t divisor; 8211 }; 8212 8213 COMPILE_ASSERT(sizeof(VertexAttribDivisorANGLE) == 12, 8214 Sizeof_VertexAttribDivisorANGLE_is_not_12); 8215 COMPILE_ASSERT(offsetof(VertexAttribDivisorANGLE, header) == 0, 8216 OffsetOf_VertexAttribDivisorANGLE_header_not_0); 8217 COMPILE_ASSERT(offsetof(VertexAttribDivisorANGLE, index) == 4, 8218 OffsetOf_VertexAttribDivisorANGLE_index_not_4); 8219 COMPILE_ASSERT(offsetof(VertexAttribDivisorANGLE, divisor) == 8, 8220 OffsetOf_VertexAttribDivisorANGLE_divisor_not_8); 8221 8222 struct ProduceTextureCHROMIUMImmediate { 8223 typedef ProduceTextureCHROMIUMImmediate ValueType; 8224 static const CommandId kCmdId = kProduceTextureCHROMIUMImmediate; 8225 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 8226 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 8227 8228 static uint32_t ComputeDataSize() { 8229 return static_cast<uint32_t>(sizeof(GLbyte) * 64); // NOLINT 8230 } 8231 8232 static uint32_t ComputeSize() { 8233 return static_cast<uint32_t>(sizeof(ValueType) + 8234 ComputeDataSize()); // NOLINT 8235 } 8236 8237 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 8238 8239 void Init(GLenum _target, const GLbyte* _mailbox) { 8240 SetHeader(); 8241 target = _target; 8242 memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize()); 8243 } 8244 8245 void* Set(void* cmd, GLenum _target, const GLbyte* _mailbox) { 8246 static_cast<ValueType*>(cmd)->Init(_target, _mailbox); 8247 const uint32_t size = ComputeSize(); 8248 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 8249 } 8250 8251 gpu::CommandHeader header; 8252 uint32_t target; 8253 }; 8254 8255 COMPILE_ASSERT(sizeof(ProduceTextureCHROMIUMImmediate) == 8, 8256 Sizeof_ProduceTextureCHROMIUMImmediate_is_not_8); 8257 COMPILE_ASSERT(offsetof(ProduceTextureCHROMIUMImmediate, header) == 0, 8258 OffsetOf_ProduceTextureCHROMIUMImmediate_header_not_0); 8259 COMPILE_ASSERT(offsetof(ProduceTextureCHROMIUMImmediate, target) == 4, 8260 OffsetOf_ProduceTextureCHROMIUMImmediate_target_not_4); 8261 8262 struct ProduceTextureDirectCHROMIUMImmediate { 8263 typedef ProduceTextureDirectCHROMIUMImmediate ValueType; 8264 static const CommandId kCmdId = kProduceTextureDirectCHROMIUMImmediate; 8265 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 8266 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 8267 8268 static uint32_t ComputeDataSize() { 8269 return static_cast<uint32_t>(sizeof(GLbyte) * 64); // NOLINT 8270 } 8271 8272 static uint32_t ComputeSize() { 8273 return static_cast<uint32_t>(sizeof(ValueType) + 8274 ComputeDataSize()); // NOLINT 8275 } 8276 8277 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 8278 8279 void Init(GLuint _texture, GLenum _target, const GLbyte* _mailbox) { 8280 SetHeader(); 8281 texture = _texture; 8282 target = _target; 8283 memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize()); 8284 } 8285 8286 void* Set(void* cmd, 8287 GLuint _texture, 8288 GLenum _target, 8289 const GLbyte* _mailbox) { 8290 static_cast<ValueType*>(cmd)->Init(_texture, _target, _mailbox); 8291 const uint32_t size = ComputeSize(); 8292 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 8293 } 8294 8295 gpu::CommandHeader header; 8296 uint32_t texture; 8297 uint32_t target; 8298 }; 8299 8300 COMPILE_ASSERT(sizeof(ProduceTextureDirectCHROMIUMImmediate) == 12, 8301 Sizeof_ProduceTextureDirectCHROMIUMImmediate_is_not_12); 8302 COMPILE_ASSERT(offsetof(ProduceTextureDirectCHROMIUMImmediate, header) == 0, 8303 OffsetOf_ProduceTextureDirectCHROMIUMImmediate_header_not_0); 8304 COMPILE_ASSERT(offsetof(ProduceTextureDirectCHROMIUMImmediate, texture) == 4, 8305 OffsetOf_ProduceTextureDirectCHROMIUMImmediate_texture_not_4); 8306 COMPILE_ASSERT(offsetof(ProduceTextureDirectCHROMIUMImmediate, target) == 8, 8307 OffsetOf_ProduceTextureDirectCHROMIUMImmediate_target_not_8); 8308 8309 struct ConsumeTextureCHROMIUMImmediate { 8310 typedef ConsumeTextureCHROMIUMImmediate ValueType; 8311 static const CommandId kCmdId = kConsumeTextureCHROMIUMImmediate; 8312 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 8313 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 8314 8315 static uint32_t ComputeDataSize() { 8316 return static_cast<uint32_t>(sizeof(GLbyte) * 64); // NOLINT 8317 } 8318 8319 static uint32_t ComputeSize() { 8320 return static_cast<uint32_t>(sizeof(ValueType) + 8321 ComputeDataSize()); // NOLINT 8322 } 8323 8324 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 8325 8326 void Init(GLenum _target, const GLbyte* _mailbox) { 8327 SetHeader(); 8328 target = _target; 8329 memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize()); 8330 } 8331 8332 void* Set(void* cmd, GLenum _target, const GLbyte* _mailbox) { 8333 static_cast<ValueType*>(cmd)->Init(_target, _mailbox); 8334 const uint32_t size = ComputeSize(); 8335 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 8336 } 8337 8338 gpu::CommandHeader header; 8339 uint32_t target; 8340 }; 8341 8342 COMPILE_ASSERT(sizeof(ConsumeTextureCHROMIUMImmediate) == 8, 8343 Sizeof_ConsumeTextureCHROMIUMImmediate_is_not_8); 8344 COMPILE_ASSERT(offsetof(ConsumeTextureCHROMIUMImmediate, header) == 0, 8345 OffsetOf_ConsumeTextureCHROMIUMImmediate_header_not_0); 8346 COMPILE_ASSERT(offsetof(ConsumeTextureCHROMIUMImmediate, target) == 4, 8347 OffsetOf_ConsumeTextureCHROMIUMImmediate_target_not_4); 8348 8349 struct BindUniformLocationCHROMIUMBucket { 8350 typedef BindUniformLocationCHROMIUMBucket ValueType; 8351 static const CommandId kCmdId = kBindUniformLocationCHROMIUMBucket; 8352 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8353 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8354 8355 static uint32_t ComputeSize() { 8356 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8357 } 8358 8359 void SetHeader() { header.SetCmd<ValueType>(); } 8360 8361 void Init(GLuint _program, GLint _location, uint32_t _name_bucket_id) { 8362 SetHeader(); 8363 program = _program; 8364 location = _location; 8365 name_bucket_id = _name_bucket_id; 8366 } 8367 8368 void* Set(void* cmd, 8369 GLuint _program, 8370 GLint _location, 8371 uint32_t _name_bucket_id) { 8372 static_cast<ValueType*>(cmd)->Init(_program, _location, _name_bucket_id); 8373 return NextCmdAddress<ValueType>(cmd); 8374 } 8375 8376 gpu::CommandHeader header; 8377 uint32_t program; 8378 int32_t location; 8379 uint32_t name_bucket_id; 8380 }; 8381 8382 COMPILE_ASSERT(sizeof(BindUniformLocationCHROMIUMBucket) == 16, 8383 Sizeof_BindUniformLocationCHROMIUMBucket_is_not_16); 8384 COMPILE_ASSERT(offsetof(BindUniformLocationCHROMIUMBucket, header) == 0, 8385 OffsetOf_BindUniformLocationCHROMIUMBucket_header_not_0); 8386 COMPILE_ASSERT(offsetof(BindUniformLocationCHROMIUMBucket, program) == 4, 8387 OffsetOf_BindUniformLocationCHROMIUMBucket_program_not_4); 8388 COMPILE_ASSERT(offsetof(BindUniformLocationCHROMIUMBucket, location) == 8, 8389 OffsetOf_BindUniformLocationCHROMIUMBucket_location_not_8); 8390 COMPILE_ASSERT( 8391 offsetof(BindUniformLocationCHROMIUMBucket, name_bucket_id) == 12, 8392 OffsetOf_BindUniformLocationCHROMIUMBucket_name_bucket_id_not_12); 8393 8394 struct BindTexImage2DCHROMIUM { 8395 typedef BindTexImage2DCHROMIUM ValueType; 8396 static const CommandId kCmdId = kBindTexImage2DCHROMIUM; 8397 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8398 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8399 8400 static uint32_t ComputeSize() { 8401 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8402 } 8403 8404 void SetHeader() { header.SetCmd<ValueType>(); } 8405 8406 void Init(GLenum _target, GLint _imageId) { 8407 SetHeader(); 8408 target = _target; 8409 imageId = _imageId; 8410 } 8411 8412 void* Set(void* cmd, GLenum _target, GLint _imageId) { 8413 static_cast<ValueType*>(cmd)->Init(_target, _imageId); 8414 return NextCmdAddress<ValueType>(cmd); 8415 } 8416 8417 gpu::CommandHeader header; 8418 uint32_t target; 8419 int32_t imageId; 8420 }; 8421 8422 COMPILE_ASSERT(sizeof(BindTexImage2DCHROMIUM) == 12, 8423 Sizeof_BindTexImage2DCHROMIUM_is_not_12); 8424 COMPILE_ASSERT(offsetof(BindTexImage2DCHROMIUM, header) == 0, 8425 OffsetOf_BindTexImage2DCHROMIUM_header_not_0); 8426 COMPILE_ASSERT(offsetof(BindTexImage2DCHROMIUM, target) == 4, 8427 OffsetOf_BindTexImage2DCHROMIUM_target_not_4); 8428 COMPILE_ASSERT(offsetof(BindTexImage2DCHROMIUM, imageId) == 8, 8429 OffsetOf_BindTexImage2DCHROMIUM_imageId_not_8); 8430 8431 struct ReleaseTexImage2DCHROMIUM { 8432 typedef ReleaseTexImage2DCHROMIUM ValueType; 8433 static const CommandId kCmdId = kReleaseTexImage2DCHROMIUM; 8434 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8435 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8436 8437 static uint32_t ComputeSize() { 8438 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8439 } 8440 8441 void SetHeader() { header.SetCmd<ValueType>(); } 8442 8443 void Init(GLenum _target, GLint _imageId) { 8444 SetHeader(); 8445 target = _target; 8446 imageId = _imageId; 8447 } 8448 8449 void* Set(void* cmd, GLenum _target, GLint _imageId) { 8450 static_cast<ValueType*>(cmd)->Init(_target, _imageId); 8451 return NextCmdAddress<ValueType>(cmd); 8452 } 8453 8454 gpu::CommandHeader header; 8455 uint32_t target; 8456 int32_t imageId; 8457 }; 8458 8459 COMPILE_ASSERT(sizeof(ReleaseTexImage2DCHROMIUM) == 12, 8460 Sizeof_ReleaseTexImage2DCHROMIUM_is_not_12); 8461 COMPILE_ASSERT(offsetof(ReleaseTexImage2DCHROMIUM, header) == 0, 8462 OffsetOf_ReleaseTexImage2DCHROMIUM_header_not_0); 8463 COMPILE_ASSERT(offsetof(ReleaseTexImage2DCHROMIUM, target) == 4, 8464 OffsetOf_ReleaseTexImage2DCHROMIUM_target_not_4); 8465 COMPILE_ASSERT(offsetof(ReleaseTexImage2DCHROMIUM, imageId) == 8, 8466 OffsetOf_ReleaseTexImage2DCHROMIUM_imageId_not_8); 8467 8468 struct TraceBeginCHROMIUM { 8469 typedef TraceBeginCHROMIUM ValueType; 8470 static const CommandId kCmdId = kTraceBeginCHROMIUM; 8471 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8472 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8473 8474 static uint32_t ComputeSize() { 8475 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8476 } 8477 8478 void SetHeader() { header.SetCmd<ValueType>(); } 8479 8480 void Init(GLuint _bucket_id) { 8481 SetHeader(); 8482 bucket_id = _bucket_id; 8483 } 8484 8485 void* Set(void* cmd, GLuint _bucket_id) { 8486 static_cast<ValueType*>(cmd)->Init(_bucket_id); 8487 return NextCmdAddress<ValueType>(cmd); 8488 } 8489 8490 gpu::CommandHeader header; 8491 uint32_t bucket_id; 8492 }; 8493 8494 COMPILE_ASSERT(sizeof(TraceBeginCHROMIUM) == 8, 8495 Sizeof_TraceBeginCHROMIUM_is_not_8); 8496 COMPILE_ASSERT(offsetof(TraceBeginCHROMIUM, header) == 0, 8497 OffsetOf_TraceBeginCHROMIUM_header_not_0); 8498 COMPILE_ASSERT(offsetof(TraceBeginCHROMIUM, bucket_id) == 4, 8499 OffsetOf_TraceBeginCHROMIUM_bucket_id_not_4); 8500 8501 struct TraceEndCHROMIUM { 8502 typedef TraceEndCHROMIUM ValueType; 8503 static const CommandId kCmdId = kTraceEndCHROMIUM; 8504 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8505 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8506 8507 static uint32_t ComputeSize() { 8508 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8509 } 8510 8511 void SetHeader() { header.SetCmd<ValueType>(); } 8512 8513 void Init() { SetHeader(); } 8514 8515 void* Set(void* cmd) { 8516 static_cast<ValueType*>(cmd)->Init(); 8517 return NextCmdAddress<ValueType>(cmd); 8518 } 8519 8520 gpu::CommandHeader header; 8521 }; 8522 8523 COMPILE_ASSERT(sizeof(TraceEndCHROMIUM) == 4, Sizeof_TraceEndCHROMIUM_is_not_4); 8524 COMPILE_ASSERT(offsetof(TraceEndCHROMIUM, header) == 0, 8525 OffsetOf_TraceEndCHROMIUM_header_not_0); 8526 8527 struct AsyncTexSubImage2DCHROMIUM { 8528 typedef AsyncTexSubImage2DCHROMIUM ValueType; 8529 static const CommandId kCmdId = kAsyncTexSubImage2DCHROMIUM; 8530 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8531 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8532 8533 static uint32_t ComputeSize() { 8534 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8535 } 8536 8537 void SetHeader() { header.SetCmd<ValueType>(); } 8538 8539 void Init(GLenum _target, 8540 GLint _level, 8541 GLint _xoffset, 8542 GLint _yoffset, 8543 GLsizei _width, 8544 GLsizei _height, 8545 GLenum _format, 8546 GLenum _type, 8547 uint32_t _data_shm_id, 8548 uint32_t _data_shm_offset, 8549 uint32_t _async_upload_token, 8550 uint32_t _sync_data_shm_id, 8551 uint32_t _sync_data_shm_offset) { 8552 SetHeader(); 8553 target = _target; 8554 level = _level; 8555 xoffset = _xoffset; 8556 yoffset = _yoffset; 8557 width = _width; 8558 height = _height; 8559 format = _format; 8560 type = _type; 8561 data_shm_id = _data_shm_id; 8562 data_shm_offset = _data_shm_offset; 8563 async_upload_token = _async_upload_token; 8564 sync_data_shm_id = _sync_data_shm_id; 8565 sync_data_shm_offset = _sync_data_shm_offset; 8566 } 8567 8568 void* Set(void* cmd, 8569 GLenum _target, 8570 GLint _level, 8571 GLint _xoffset, 8572 GLint _yoffset, 8573 GLsizei _width, 8574 GLsizei _height, 8575 GLenum _format, 8576 GLenum _type, 8577 uint32_t _data_shm_id, 8578 uint32_t _data_shm_offset, 8579 uint32_t _async_upload_token, 8580 uint32_t _sync_data_shm_id, 8581 uint32_t _sync_data_shm_offset) { 8582 static_cast<ValueType*>(cmd)->Init(_target, 8583 _level, 8584 _xoffset, 8585 _yoffset, 8586 _width, 8587 _height, 8588 _format, 8589 _type, 8590 _data_shm_id, 8591 _data_shm_offset, 8592 _async_upload_token, 8593 _sync_data_shm_id, 8594 _sync_data_shm_offset); 8595 return NextCmdAddress<ValueType>(cmd); 8596 } 8597 8598 gpu::CommandHeader header; 8599 uint32_t target; 8600 int32_t level; 8601 int32_t xoffset; 8602 int32_t yoffset; 8603 int32_t width; 8604 int32_t height; 8605 uint32_t format; 8606 uint32_t type; 8607 uint32_t data_shm_id; 8608 uint32_t data_shm_offset; 8609 uint32_t async_upload_token; 8610 uint32_t sync_data_shm_id; 8611 uint32_t sync_data_shm_offset; 8612 }; 8613 8614 COMPILE_ASSERT(sizeof(AsyncTexSubImage2DCHROMIUM) == 56, 8615 Sizeof_AsyncTexSubImage2DCHROMIUM_is_not_56); 8616 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, header) == 0, 8617 OffsetOf_AsyncTexSubImage2DCHROMIUM_header_not_0); 8618 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, target) == 4, 8619 OffsetOf_AsyncTexSubImage2DCHROMIUM_target_not_4); 8620 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, level) == 8, 8621 OffsetOf_AsyncTexSubImage2DCHROMIUM_level_not_8); 8622 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, xoffset) == 12, 8623 OffsetOf_AsyncTexSubImage2DCHROMIUM_xoffset_not_12); 8624 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, yoffset) == 16, 8625 OffsetOf_AsyncTexSubImage2DCHROMIUM_yoffset_not_16); 8626 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, width) == 20, 8627 OffsetOf_AsyncTexSubImage2DCHROMIUM_width_not_20); 8628 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, height) == 24, 8629 OffsetOf_AsyncTexSubImage2DCHROMIUM_height_not_24); 8630 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, format) == 28, 8631 OffsetOf_AsyncTexSubImage2DCHROMIUM_format_not_28); 8632 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, type) == 32, 8633 OffsetOf_AsyncTexSubImage2DCHROMIUM_type_not_32); 8634 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, data_shm_id) == 36, 8635 OffsetOf_AsyncTexSubImage2DCHROMIUM_data_shm_id_not_36); 8636 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, data_shm_offset) == 40, 8637 OffsetOf_AsyncTexSubImage2DCHROMIUM_data_shm_offset_not_40); 8638 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, async_upload_token) == 44, 8639 OffsetOf_AsyncTexSubImage2DCHROMIUM_async_upload_token_not_44); 8640 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, sync_data_shm_id) == 48, 8641 OffsetOf_AsyncTexSubImage2DCHROMIUM_sync_data_shm_id_not_48); 8642 COMPILE_ASSERT(offsetof(AsyncTexSubImage2DCHROMIUM, sync_data_shm_offset) == 52, 8643 OffsetOf_AsyncTexSubImage2DCHROMIUM_sync_data_shm_offset_not_52); 8644 8645 struct AsyncTexImage2DCHROMIUM { 8646 typedef AsyncTexImage2DCHROMIUM ValueType; 8647 static const CommandId kCmdId = kAsyncTexImage2DCHROMIUM; 8648 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8649 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8650 8651 static uint32_t ComputeSize() { 8652 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8653 } 8654 8655 void SetHeader() { header.SetCmd<ValueType>(); } 8656 8657 void Init(GLenum _target, 8658 GLint _level, 8659 GLint _internalformat, 8660 GLsizei _width, 8661 GLsizei _height, 8662 GLenum _format, 8663 GLenum _type, 8664 uint32_t _pixels_shm_id, 8665 uint32_t _pixels_shm_offset, 8666 uint32_t _async_upload_token, 8667 uint32_t _sync_data_shm_id, 8668 uint32_t _sync_data_shm_offset) { 8669 SetHeader(); 8670 target = _target; 8671 level = _level; 8672 internalformat = _internalformat; 8673 width = _width; 8674 height = _height; 8675 format = _format; 8676 type = _type; 8677 pixels_shm_id = _pixels_shm_id; 8678 pixels_shm_offset = _pixels_shm_offset; 8679 async_upload_token = _async_upload_token; 8680 sync_data_shm_id = _sync_data_shm_id; 8681 sync_data_shm_offset = _sync_data_shm_offset; 8682 } 8683 8684 void* Set(void* cmd, 8685 GLenum _target, 8686 GLint _level, 8687 GLint _internalformat, 8688 GLsizei _width, 8689 GLsizei _height, 8690 GLenum _format, 8691 GLenum _type, 8692 uint32_t _pixels_shm_id, 8693 uint32_t _pixels_shm_offset, 8694 uint32_t _async_upload_token, 8695 uint32_t _sync_data_shm_id, 8696 uint32_t _sync_data_shm_offset) { 8697 static_cast<ValueType*>(cmd)->Init(_target, 8698 _level, 8699 _internalformat, 8700 _width, 8701 _height, 8702 _format, 8703 _type, 8704 _pixels_shm_id, 8705 _pixels_shm_offset, 8706 _async_upload_token, 8707 _sync_data_shm_id, 8708 _sync_data_shm_offset); 8709 return NextCmdAddress<ValueType>(cmd); 8710 } 8711 8712 gpu::CommandHeader header; 8713 uint32_t target; 8714 int32_t level; 8715 int32_t internalformat; 8716 int32_t width; 8717 int32_t height; 8718 uint32_t format; 8719 uint32_t type; 8720 uint32_t pixels_shm_id; 8721 uint32_t pixels_shm_offset; 8722 uint32_t async_upload_token; 8723 uint32_t sync_data_shm_id; 8724 uint32_t sync_data_shm_offset; 8725 static const int32_t border = 0; 8726 }; 8727 8728 COMPILE_ASSERT(sizeof(AsyncTexImage2DCHROMIUM) == 52, 8729 Sizeof_AsyncTexImage2DCHROMIUM_is_not_52); 8730 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, header) == 0, 8731 OffsetOf_AsyncTexImage2DCHROMIUM_header_not_0); 8732 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, target) == 4, 8733 OffsetOf_AsyncTexImage2DCHROMIUM_target_not_4); 8734 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, level) == 8, 8735 OffsetOf_AsyncTexImage2DCHROMIUM_level_not_8); 8736 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, internalformat) == 12, 8737 OffsetOf_AsyncTexImage2DCHROMIUM_internalformat_not_12); 8738 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, width) == 16, 8739 OffsetOf_AsyncTexImage2DCHROMIUM_width_not_16); 8740 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, height) == 20, 8741 OffsetOf_AsyncTexImage2DCHROMIUM_height_not_20); 8742 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, format) == 24, 8743 OffsetOf_AsyncTexImage2DCHROMIUM_format_not_24); 8744 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, type) == 28, 8745 OffsetOf_AsyncTexImage2DCHROMIUM_type_not_28); 8746 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, pixels_shm_id) == 32, 8747 OffsetOf_AsyncTexImage2DCHROMIUM_pixels_shm_id_not_32); 8748 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, pixels_shm_offset) == 36, 8749 OffsetOf_AsyncTexImage2DCHROMIUM_pixels_shm_offset_not_36); 8750 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, async_upload_token) == 40, 8751 OffsetOf_AsyncTexImage2DCHROMIUM_async_upload_token_not_40); 8752 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, sync_data_shm_id) == 44, 8753 OffsetOf_AsyncTexImage2DCHROMIUM_sync_data_shm_id_not_44); 8754 COMPILE_ASSERT(offsetof(AsyncTexImage2DCHROMIUM, sync_data_shm_offset) == 48, 8755 OffsetOf_AsyncTexImage2DCHROMIUM_sync_data_shm_offset_not_48); 8756 8757 struct WaitAsyncTexImage2DCHROMIUM { 8758 typedef WaitAsyncTexImage2DCHROMIUM ValueType; 8759 static const CommandId kCmdId = kWaitAsyncTexImage2DCHROMIUM; 8760 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8761 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8762 8763 static uint32_t ComputeSize() { 8764 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8765 } 8766 8767 void SetHeader() { header.SetCmd<ValueType>(); } 8768 8769 void Init(GLenum _target) { 8770 SetHeader(); 8771 target = _target; 8772 } 8773 8774 void* Set(void* cmd, GLenum _target) { 8775 static_cast<ValueType*>(cmd)->Init(_target); 8776 return NextCmdAddress<ValueType>(cmd); 8777 } 8778 8779 gpu::CommandHeader header; 8780 uint32_t target; 8781 }; 8782 8783 COMPILE_ASSERT(sizeof(WaitAsyncTexImage2DCHROMIUM) == 8, 8784 Sizeof_WaitAsyncTexImage2DCHROMIUM_is_not_8); 8785 COMPILE_ASSERT(offsetof(WaitAsyncTexImage2DCHROMIUM, header) == 0, 8786 OffsetOf_WaitAsyncTexImage2DCHROMIUM_header_not_0); 8787 COMPILE_ASSERT(offsetof(WaitAsyncTexImage2DCHROMIUM, target) == 4, 8788 OffsetOf_WaitAsyncTexImage2DCHROMIUM_target_not_4); 8789 8790 struct WaitAllAsyncTexImage2DCHROMIUM { 8791 typedef WaitAllAsyncTexImage2DCHROMIUM ValueType; 8792 static const CommandId kCmdId = kWaitAllAsyncTexImage2DCHROMIUM; 8793 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8794 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8795 8796 static uint32_t ComputeSize() { 8797 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8798 } 8799 8800 void SetHeader() { header.SetCmd<ValueType>(); } 8801 8802 void Init() { SetHeader(); } 8803 8804 void* Set(void* cmd) { 8805 static_cast<ValueType*>(cmd)->Init(); 8806 return NextCmdAddress<ValueType>(cmd); 8807 } 8808 8809 gpu::CommandHeader header; 8810 }; 8811 8812 COMPILE_ASSERT(sizeof(WaitAllAsyncTexImage2DCHROMIUM) == 4, 8813 Sizeof_WaitAllAsyncTexImage2DCHROMIUM_is_not_4); 8814 COMPILE_ASSERT(offsetof(WaitAllAsyncTexImage2DCHROMIUM, header) == 0, 8815 OffsetOf_WaitAllAsyncTexImage2DCHROMIUM_header_not_0); 8816 8817 struct DiscardFramebufferEXTImmediate { 8818 typedef DiscardFramebufferEXTImmediate ValueType; 8819 static const CommandId kCmdId = kDiscardFramebufferEXTImmediate; 8820 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 8821 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8822 8823 static uint32_t ComputeDataSize(GLsizei count) { 8824 return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT 8825 } 8826 8827 static uint32_t ComputeSize(GLsizei count) { 8828 return static_cast<uint32_t>(sizeof(ValueType) + 8829 ComputeDataSize(count)); // NOLINT 8830 } 8831 8832 void SetHeader(GLsizei count) { 8833 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 8834 } 8835 8836 void Init(GLenum _target, GLsizei _count, const GLenum* _attachments) { 8837 SetHeader(_count); 8838 target = _target; 8839 count = _count; 8840 memcpy(ImmediateDataAddress(this), _attachments, ComputeDataSize(_count)); 8841 } 8842 8843 void* Set(void* cmd, 8844 GLenum _target, 8845 GLsizei _count, 8846 const GLenum* _attachments) { 8847 static_cast<ValueType*>(cmd)->Init(_target, _count, _attachments); 8848 const uint32_t size = ComputeSize(_count); 8849 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 8850 } 8851 8852 gpu::CommandHeader header; 8853 uint32_t target; 8854 int32_t count; 8855 }; 8856 8857 COMPILE_ASSERT(sizeof(DiscardFramebufferEXTImmediate) == 12, 8858 Sizeof_DiscardFramebufferEXTImmediate_is_not_12); 8859 COMPILE_ASSERT(offsetof(DiscardFramebufferEXTImmediate, header) == 0, 8860 OffsetOf_DiscardFramebufferEXTImmediate_header_not_0); 8861 COMPILE_ASSERT(offsetof(DiscardFramebufferEXTImmediate, target) == 4, 8862 OffsetOf_DiscardFramebufferEXTImmediate_target_not_4); 8863 COMPILE_ASSERT(offsetof(DiscardFramebufferEXTImmediate, count) == 8, 8864 OffsetOf_DiscardFramebufferEXTImmediate_count_not_8); 8865 8866 struct LoseContextCHROMIUM { 8867 typedef LoseContextCHROMIUM ValueType; 8868 static const CommandId kCmdId = kLoseContextCHROMIUM; 8869 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8870 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8871 8872 static uint32_t ComputeSize() { 8873 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8874 } 8875 8876 void SetHeader() { header.SetCmd<ValueType>(); } 8877 8878 void Init(GLenum _current, GLenum _other) { 8879 SetHeader(); 8880 current = _current; 8881 other = _other; 8882 } 8883 8884 void* Set(void* cmd, GLenum _current, GLenum _other) { 8885 static_cast<ValueType*>(cmd)->Init(_current, _other); 8886 return NextCmdAddress<ValueType>(cmd); 8887 } 8888 8889 gpu::CommandHeader header; 8890 uint32_t current; 8891 uint32_t other; 8892 }; 8893 8894 COMPILE_ASSERT(sizeof(LoseContextCHROMIUM) == 12, 8895 Sizeof_LoseContextCHROMIUM_is_not_12); 8896 COMPILE_ASSERT(offsetof(LoseContextCHROMIUM, header) == 0, 8897 OffsetOf_LoseContextCHROMIUM_header_not_0); 8898 COMPILE_ASSERT(offsetof(LoseContextCHROMIUM, current) == 4, 8899 OffsetOf_LoseContextCHROMIUM_current_not_4); 8900 COMPILE_ASSERT(offsetof(LoseContextCHROMIUM, other) == 8, 8901 OffsetOf_LoseContextCHROMIUM_other_not_8); 8902 8903 struct WaitSyncPointCHROMIUM { 8904 typedef WaitSyncPointCHROMIUM ValueType; 8905 static const CommandId kCmdId = kWaitSyncPointCHROMIUM; 8906 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8907 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); 8908 8909 static uint32_t ComputeSize() { 8910 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8911 } 8912 8913 void SetHeader() { header.SetCmd<ValueType>(); } 8914 8915 void Init(GLuint _sync_point) { 8916 SetHeader(); 8917 sync_point = _sync_point; 8918 } 8919 8920 void* Set(void* cmd, GLuint _sync_point) { 8921 static_cast<ValueType*>(cmd)->Init(_sync_point); 8922 return NextCmdAddress<ValueType>(cmd); 8923 } 8924 8925 gpu::CommandHeader header; 8926 uint32_t sync_point; 8927 }; 8928 8929 COMPILE_ASSERT(sizeof(WaitSyncPointCHROMIUM) == 8, 8930 Sizeof_WaitSyncPointCHROMIUM_is_not_8); 8931 COMPILE_ASSERT(offsetof(WaitSyncPointCHROMIUM, header) == 0, 8932 OffsetOf_WaitSyncPointCHROMIUM_header_not_0); 8933 COMPILE_ASSERT(offsetof(WaitSyncPointCHROMIUM, sync_point) == 4, 8934 OffsetOf_WaitSyncPointCHROMIUM_sync_point_not_4); 8935 8936 struct DrawBuffersEXTImmediate { 8937 typedef DrawBuffersEXTImmediate ValueType; 8938 static const CommandId kCmdId = kDrawBuffersEXTImmediate; 8939 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 8940 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8941 8942 static uint32_t ComputeDataSize(GLsizei count) { 8943 return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT 8944 } 8945 8946 static uint32_t ComputeSize(GLsizei count) { 8947 return static_cast<uint32_t>(sizeof(ValueType) + 8948 ComputeDataSize(count)); // NOLINT 8949 } 8950 8951 void SetHeader(GLsizei count) { 8952 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); 8953 } 8954 8955 void Init(GLsizei _count, const GLenum* _bufs) { 8956 SetHeader(_count); 8957 count = _count; 8958 memcpy(ImmediateDataAddress(this), _bufs, ComputeDataSize(_count)); 8959 } 8960 8961 void* Set(void* cmd, GLsizei _count, const GLenum* _bufs) { 8962 static_cast<ValueType*>(cmd)->Init(_count, _bufs); 8963 const uint32_t size = ComputeSize(_count); 8964 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 8965 } 8966 8967 gpu::CommandHeader header; 8968 int32_t count; 8969 }; 8970 8971 COMPILE_ASSERT(sizeof(DrawBuffersEXTImmediate) == 8, 8972 Sizeof_DrawBuffersEXTImmediate_is_not_8); 8973 COMPILE_ASSERT(offsetof(DrawBuffersEXTImmediate, header) == 0, 8974 OffsetOf_DrawBuffersEXTImmediate_header_not_0); 8975 COMPILE_ASSERT(offsetof(DrawBuffersEXTImmediate, count) == 4, 8976 OffsetOf_DrawBuffersEXTImmediate_count_not_4); 8977 8978 struct DiscardBackbufferCHROMIUM { 8979 typedef DiscardBackbufferCHROMIUM ValueType; 8980 static const CommandId kCmdId = kDiscardBackbufferCHROMIUM; 8981 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 8982 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 8983 8984 static uint32_t ComputeSize() { 8985 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 8986 } 8987 8988 void SetHeader() { header.SetCmd<ValueType>(); } 8989 8990 void Init() { SetHeader(); } 8991 8992 void* Set(void* cmd) { 8993 static_cast<ValueType*>(cmd)->Init(); 8994 return NextCmdAddress<ValueType>(cmd); 8995 } 8996 8997 gpu::CommandHeader header; 8998 }; 8999 9000 COMPILE_ASSERT(sizeof(DiscardBackbufferCHROMIUM) == 4, 9001 Sizeof_DiscardBackbufferCHROMIUM_is_not_4); 9002 COMPILE_ASSERT(offsetof(DiscardBackbufferCHROMIUM, header) == 0, 9003 OffsetOf_DiscardBackbufferCHROMIUM_header_not_0); 9004 9005 struct ScheduleOverlayPlaneCHROMIUM { 9006 typedef ScheduleOverlayPlaneCHROMIUM ValueType; 9007 static const CommandId kCmdId = kScheduleOverlayPlaneCHROMIUM; 9008 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 9009 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 9010 9011 static uint32_t ComputeSize() { 9012 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 9013 } 9014 9015 void SetHeader() { header.SetCmd<ValueType>(); } 9016 9017 void Init(GLint _plane_z_order, 9018 GLenum _plane_transform, 9019 GLuint _overlay_texture_id, 9020 GLint _bounds_x, 9021 GLint _bounds_y, 9022 GLint _bounds_width, 9023 GLint _bounds_height, 9024 GLfloat _uv_x, 9025 GLfloat _uv_y, 9026 GLfloat _uv_width, 9027 GLfloat _uv_height) { 9028 SetHeader(); 9029 plane_z_order = _plane_z_order; 9030 plane_transform = _plane_transform; 9031 overlay_texture_id = _overlay_texture_id; 9032 bounds_x = _bounds_x; 9033 bounds_y = _bounds_y; 9034 bounds_width = _bounds_width; 9035 bounds_height = _bounds_height; 9036 uv_x = _uv_x; 9037 uv_y = _uv_y; 9038 uv_width = _uv_width; 9039 uv_height = _uv_height; 9040 } 9041 9042 void* Set(void* cmd, 9043 GLint _plane_z_order, 9044 GLenum _plane_transform, 9045 GLuint _overlay_texture_id, 9046 GLint _bounds_x, 9047 GLint _bounds_y, 9048 GLint _bounds_width, 9049 GLint _bounds_height, 9050 GLfloat _uv_x, 9051 GLfloat _uv_y, 9052 GLfloat _uv_width, 9053 GLfloat _uv_height) { 9054 static_cast<ValueType*>(cmd)->Init(_plane_z_order, 9055 _plane_transform, 9056 _overlay_texture_id, 9057 _bounds_x, 9058 _bounds_y, 9059 _bounds_width, 9060 _bounds_height, 9061 _uv_x, 9062 _uv_y, 9063 _uv_width, 9064 _uv_height); 9065 return NextCmdAddress<ValueType>(cmd); 9066 } 9067 9068 gpu::CommandHeader header; 9069 int32_t plane_z_order; 9070 uint32_t plane_transform; 9071 uint32_t overlay_texture_id; 9072 int32_t bounds_x; 9073 int32_t bounds_y; 9074 int32_t bounds_width; 9075 int32_t bounds_height; 9076 float uv_x; 9077 float uv_y; 9078 float uv_width; 9079 float uv_height; 9080 }; 9081 9082 COMPILE_ASSERT(sizeof(ScheduleOverlayPlaneCHROMIUM) == 48, 9083 Sizeof_ScheduleOverlayPlaneCHROMIUM_is_not_48); 9084 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, header) == 0, 9085 OffsetOf_ScheduleOverlayPlaneCHROMIUM_header_not_0); 9086 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, plane_z_order) == 4, 9087 OffsetOf_ScheduleOverlayPlaneCHROMIUM_plane_z_order_not_4); 9088 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, plane_transform) == 8, 9089 OffsetOf_ScheduleOverlayPlaneCHROMIUM_plane_transform_not_8); 9090 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, overlay_texture_id) == 12, 9091 OffsetOf_ScheduleOverlayPlaneCHROMIUM_overlay_texture_id_not_12); 9092 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_x) == 16, 9093 OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_x_not_16); 9094 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_y) == 20, 9095 OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_y_not_20); 9096 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_width) == 24, 9097 OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_width_not_24); 9098 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_height) == 28, 9099 OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_height_not_28); 9100 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_x) == 32, 9101 OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_x_not_32); 9102 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_y) == 36, 9103 OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_y_not_36); 9104 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_width) == 40, 9105 OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_width_not_40); 9106 COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_height) == 44, 9107 OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_height_not_44); 9108 9109 struct MatrixLoadfCHROMIUMImmediate { 9110 typedef MatrixLoadfCHROMIUMImmediate ValueType; 9111 static const CommandId kCmdId = kMatrixLoadfCHROMIUMImmediate; 9112 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 9113 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 9114 9115 static uint32_t ComputeDataSize() { 9116 return static_cast<uint32_t>(sizeof(GLfloat) * 16); // NOLINT 9117 } 9118 9119 static uint32_t ComputeSize() { 9120 return static_cast<uint32_t>(sizeof(ValueType) + 9121 ComputeDataSize()); // NOLINT 9122 } 9123 9124 void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); } 9125 9126 void Init(GLenum _matrixMode, const GLfloat* _m) { 9127 SetHeader(); 9128 matrixMode = _matrixMode; 9129 memcpy(ImmediateDataAddress(this), _m, ComputeDataSize()); 9130 } 9131 9132 void* Set(void* cmd, GLenum _matrixMode, const GLfloat* _m) { 9133 static_cast<ValueType*>(cmd)->Init(_matrixMode, _m); 9134 const uint32_t size = ComputeSize(); 9135 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); 9136 } 9137 9138 gpu::CommandHeader header; 9139 uint32_t matrixMode; 9140 }; 9141 9142 COMPILE_ASSERT(sizeof(MatrixLoadfCHROMIUMImmediate) == 8, 9143 Sizeof_MatrixLoadfCHROMIUMImmediate_is_not_8); 9144 COMPILE_ASSERT(offsetof(MatrixLoadfCHROMIUMImmediate, header) == 0, 9145 OffsetOf_MatrixLoadfCHROMIUMImmediate_header_not_0); 9146 COMPILE_ASSERT(offsetof(MatrixLoadfCHROMIUMImmediate, matrixMode) == 4, 9147 OffsetOf_MatrixLoadfCHROMIUMImmediate_matrixMode_not_4); 9148 9149 struct MatrixLoadIdentityCHROMIUM { 9150 typedef MatrixLoadIdentityCHROMIUM ValueType; 9151 static const CommandId kCmdId = kMatrixLoadIdentityCHROMIUM; 9152 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 9153 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 9154 9155 static uint32_t ComputeSize() { 9156 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 9157 } 9158 9159 void SetHeader() { header.SetCmd<ValueType>(); } 9160 9161 void Init(GLenum _matrixMode) { 9162 SetHeader(); 9163 matrixMode = _matrixMode; 9164 } 9165 9166 void* Set(void* cmd, GLenum _matrixMode) { 9167 static_cast<ValueType*>(cmd)->Init(_matrixMode); 9168 return NextCmdAddress<ValueType>(cmd); 9169 } 9170 9171 gpu::CommandHeader header; 9172 uint32_t matrixMode; 9173 }; 9174 9175 COMPILE_ASSERT(sizeof(MatrixLoadIdentityCHROMIUM) == 8, 9176 Sizeof_MatrixLoadIdentityCHROMIUM_is_not_8); 9177 COMPILE_ASSERT(offsetof(MatrixLoadIdentityCHROMIUM, header) == 0, 9178 OffsetOf_MatrixLoadIdentityCHROMIUM_header_not_0); 9179 COMPILE_ASSERT(offsetof(MatrixLoadIdentityCHROMIUM, matrixMode) == 4, 9180 OffsetOf_MatrixLoadIdentityCHROMIUM_matrixMode_not_4); 9181 9182 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ 9183