1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
  212
  213
  214
  215
  216
  217
  218
  219
  220
  221
  222
  223
  224
  225
  226
  227
  228
  229
  230
  231
  232
  233
  234
  235
  236
  237
  238
  239
  240
  241
  242
  243
  244
  245
  246
  247
  248
  249
  250
  251
  252
  253
  254
  255
  256
  257
  258
  259
  260
  261
  262
  263
  264
  265
  266
  267
  268
  269
  270
  271
  272
  273
  274
  275
  276
  277
  278
  279
  280
  281
  282
  283
  284
  285
  286
  287
  288
  289
  290
  291
  292
  293
  294
  295
  296
  297
  298
  299
  300
  301
  302
  303
  304
  305
  306
  307
  308
  309
  310
  311
  312
  313
  314
  315
  316
  317
  318
  319
  320
  321
  322
  323
  324
  325
  326
  327
  328
  329
  330
  331
  332
  333
  334
  335
  336
  337
  338
  339
  340
  341
  342
  343
  344
  345
  346
  347
  348
  349
  350
  351
  352
  353
  354
  355
  356
  357
  358
  359
  360
  361
  362
  363
  364
  365
  366
  367
  368
  369
  370
  371
  372
  373
  374
  375
  376
  377
  378
  379
  380
  381
  382
  383
  384
  385
  386
  387
  388
  389
  390
  391
  392
  393
  394
  395
  396
  397
  398
  399
  400
  401
  402
  403
  404
  405
  406
  407
  408
  409
  410
  411
  412
  413
  414
  415
  416
  417
  418
  419
  420
  421
  422
  423
  424
  425
  426
  427
  428
  429
  430
  431
  432
  433
  434
  435
  436
  437
  438
  439
  440
  441
  442
  443
  444
  445
  446
  447
  448
  449
  450
  451
  452
  453
  454
  455
  456
  457
  458
  459
  460
  461
  462
  463
  464
  465
  466
  467
  468
  469
  470
  471
  472
  473
  474
  475
  476
  477
  478
  479
  480
  481
  482
  483
  484
  485
  486
  487
  488
  489
  490
  491
  492
  493
  494
  495
  496
  497
  498
  499
  500
  501
  502
  503
  504
  505
  506
  507
  508
  509
  510
  511
  512
  513
  514
  515
  516
  517
  518
  519
  520
  521
  522
  523
  524
  525
  526
  527
  528
  529
  530
  531
  532
  533
  534
  535
  536
  537
  538
  539
  540
  541
  542
  543
  544
  545
  546
  547
  548
  549
  550
  551
  552
  553
  554
  555
  556
  557
  558
  559
  560
  561
  562
  563
  564
  565
  566
  567
  568
  569
  570
  571
  572
  573
  574
  575
  576
  577
  578
  579
  580
  581
  582
  583
  584
  585
  586
  587
  588
  589
  590
  591
  592
  593
  594
  595
  596
  597
  598
  599
  600
  601
  602
  603
  604
  605
  606
  607
  608
  609
  610
  611
  612
  613
  614
  615
  616
  617
  618
  619
  620
  621
  622
  623
  624
  625
  626
  627
  628
  629
  630
  631
  632
  633
  634
  635
  636
  637
  638
  639
  640
  641
  642
  643
  644
  645
  646
  647
  648
  649
  650
  651
  652
  653
  654
  655
  656
  657
  658
  659
  660
  661
  662
  663
  664
  665
  666
  667
  668
  669
  670
  671
  672
  673
  674
  675
  676
  677
  678
  679
  680
  681
  682
  683
  684
  685
  686
  687
  688
  689
  690
  691
  692
  693
  694
  695
  696
  697
  698
  699
  700
  701
  702
  703
  704
  705
  706
  707
  708
  709
  710
  711
  712
  713
  714
  715
  716
  717
  718
  719
  720
  721
  722
  723
  724
  725
  726
  727
  728
  729
  730
  731
  732
  733
  734
  735
  736
  737
  738
  739
  740
  741
  742
  743
  744
  745
  746
  747
  748
  749
  750
  751
  752
  753
  754
  755
  756
  757
  758
  759
  760
  761
  762
  763
  764
  765
  766
  767
  768
  769
  770
  771
  772
  773
  774
  775
  776
  777
  778
  779
  780
  781
  782
  783
  784
  785
  786
  787
  788
  789
  790
  791
  792
  793
  794
  795
  796
  797
  798
  799
  800
  801
  802
  803
  804
  805
  806
  807
  808
  809
  810
  811
  812
  813
  814
  815
  816
  817
  818
  819
  820
  821
  822
  823
  824
  825
  826
  827
  828
  829
  830
  831
  832
  833
  834
  835
  836
  837
  838
  839
  840
  841
  842
  843
  844
  845
  846
  847
  848
  849
  850
  851
  852
  853
  854
  855
  856
  857
  858
  859
  860
  861
  862
  863
  864
  865
  866
  867
  868
  869
  870
  871
  872
  873
  874
  875
  876
  877
  878
  879
  880
  881
  882
  883
  884
  885
  886
  887
  888
  889
  890
  891
  892
  893
  894
  895
  896
  897
  898
  899
  900
  901
  902
  903
  904
  905
  906
  907
  908
  909
  910
  911
  912
  913
  914
  915
  916
  917
  918
  919
  920
  921
  922
  923
  924
  925
  926
  927
  928
  929
  930
  931
  932
  933
  934
  935
  936
  937
  938
  939
  940
  941
  942
  943
  944
  945
  946
  947
  948
  949
  950
  951
  952
  953
  954
  955
  956
  957
  958
  959
  960
  961
  962
  963
  964
  965
  966
  967
  968
  969
  970
  971
  972
  973
  974
  975
  976
  977
  978
  979
  980
  981
  982
  983
  984
  985
  986
  987
  988
  989
  990
  991
  992
  993
  994
  995
  996
  997
  998
  999
 1000
 1001
 1002
 1003
 1004
 1005
 1006
 1007
 1008
 1009
 1010
 1011
 1012
 1013
 1014
 1015
 1016
 1017
 1018
 1019
 1020
 1021
 1022
 1023
 1024
 1025
 1026
 1027
 1028
 1029
 1030
 1031
 1032
 1033
 1034
 1035
 1036
 1037
 1038
 1039
 1040
 1041
 1042
 1043
 1044
 1045
 1046
 1047
 1048
 1049
 1050
 1051
 1052
 1053
 1054
 1055
 1056
 1057
 1058
 1059
 1060
 1061
 1062
 1063
 1064
 1065
 1066
 1067
 1068
 1069
 1070
 1071
 1072
 1073
 1074
 1075
 1076
 1077
 1078
 1079
 1080
 1081
 1082
 1083
 1084
 1085
 1086
 1087
 1088
 1089
 1090
 1091
 1092
 1093
 1094
 1095
 1096
 1097
 1098
 1099
 1100
 1101
 1102
 1103
 1104
 1105
 1106
 1107
 1108
 1109
 1110
 1111
 1112
 1113
 1114
 1115
 1116
 1117
 1118
 1119
 1120
 1121
 1122
 1123
 1124
 1125
 1126
 1127
 1128
 1129
 1130
 1131
 1132
 1133
 1134
 1135
 1136
 1137
 1138
 1139
 1140
 1141
 1142
 1143
 1144
 1145
 1146
 1147
 1148
 1149
 1150
 1151
 1152
 1153
 1154
 1155
 1156
 1157
 1158
 1159
 1160
 1161
 1162
 1163
 1164
 1165
 1166
 1167
 1168
 1169
 1170
 1171
 1172
 1173
 1174
 1175
 1176
 1177
 1178
 1179
 1180
 1181
 1182
 1183
 1184
 1185
 1186
 1187
 1188
 1189
 1190
 1191
 1192
 1193
 1194
 1195
 1196
 1197
 1198
 1199
 1200
 1201
 1202
 1203
 1204
 1205
 1206
 1207
 1208
 1209
 1210
 1211
 1212
 1213
 1214
 1215
 1216
 1217
 1218
 1219
 1220
 1221
 1222
 1223
 1224
 1225
 1226
 1227
 1228
 1229
 1230
 1231
 1232
 1233
 1234
 1235
 1236
 1237
 1238
 1239
 1240
 1241
 1242
 1243
 1244
 1245
 1246
 1247
 1248
 1249
 1250
 1251
 1252
 1253
 1254
 1255
 1256
 1257
 1258
 1259
 1260
 1261
 1262
 1263
 1264
 1265
 1266
 1267
 1268
 1269
 1270
 1271
 1272
 1273
 1274
 1275
 1276
 1277
 1278
 1279
 1280
 1281
 1282
 1283
 1284
 1285
 1286
 1287
 1288
 1289
 1290
 1291
 1292
 1293
 1294
 1295
 1296
 1297
 1298
 1299
 1300
 1301
 1302
 1303
 1304
 1305
 1306
 1307
 1308
 1309
 1310
 1311
 1312
 1313
 1314
 1315
 1316
 1317
 1318
 1319
 1320
 1321
 1322
 1323
 1324
 1325
 1326
 1327
 1328
 1329
 1330
 1331
 1332
 1333
 1334
 1335
 1336
 1337
 1338
 1339
 1340
 1341
 1342
 1343
 1344
 1345
 1346
 1347
 1348
 1349
 1350
 1351
 1352
 1353
 1354
 1355
 1356
 1357
 1358
 1359
 1360
 1361
 1362
 1363
 1364
 1365
 1366
 1367
 1368
 1369
 1370
 1371
 1372
 1373
 1374
 1375
 1376
 1377
 1378
 1379
 1380
 1381
 1382
 1383
 1384
 1385
 1386
 1387
 1388
 1389
 1390
 1391
 1392
 1393
 1394
 1395
 1396
 1397
 1398
 1399
 1400
 1401
 1402
 1403
 1404
 1405
 1406
 1407
 1408
 1409
 1410
 1411
 1412
 1413
 1414
 1415
 1416
 1417
 1418
 1419
 1420
 1421
 1422
 1423
 1424
 1425
 1426
 1427
 1428
 1429
 1430
 1431
 1432
 1433
 1434
 1435
 1436
 1437
 1438
 1439
 1440
 1441
 1442
 1443
 1444
 1445
 1446
 1447
 1448
 1449
 1450
 1451
 1452
 1453
 1454
 1455
 1456
 1457
 1458
 1459
 1460
 1461
 1462
 1463
 1464
 1465
 1466
 1467
 1468
 1469
 1470
 1471
 1472
 1473
 1474
 1475
 1476
 1477
 1478
 1479
 1480
 1481
 1482
 1483
 1484
 1485
 1486
 1487
 1488
 1489
 1490
 1491
 1492
 1493
 1494
 1495
 1496
 1497
 1498
 1499
 1500
 1501
 1502
 1503
 1504

gpu / command_buffer / common / raster_cmd_format_autogen.h [blame]

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is auto-generated from
// gpu/command_buffer/build_raster_cmd_buffer.py
// It's formatted by clang-format using chromium coding style:
//    clang-format -i -style=chromium filename
// DO NOT EDIT!

#ifndef GPU_COMMAND_BUFFER_COMMON_RASTER_CMD_FORMAT_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_COMMON_RASTER_CMD_FORMAT_AUTOGEN_H_

struct Finish {
  typedef Finish ValueType;
  static const CommandId kCmdId = kFinish;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init() { SetHeader(); }

  void* Set(void* cmd) {
    static_cast<ValueType*>(cmd)->Init();
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
};

static_assert(sizeof(Finish) == 4, "size of Finish should be 4");
static_assert(offsetof(Finish, header) == 0,
              "offset of Finish header should be 0");

struct Flush {
  typedef Flush ValueType;
  static const CommandId kCmdId = kFlush;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init() { SetHeader(); }

  void* Set(void* cmd) {
    static_cast<ValueType*>(cmd)->Init();
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
};

static_assert(sizeof(Flush) == 4, "size of Flush should be 4");
static_assert(offsetof(Flush, header) == 0,
              "offset of Flush header should be 0");

struct GetError {
  typedef GetError ValueType;
  static const CommandId kCmdId = kGetError;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  typedef GLenum Result;

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(uint32_t _result_shm_id, uint32_t _result_shm_offset) {
    SetHeader();
    result_shm_id = _result_shm_id;
    result_shm_offset = _result_shm_offset;
  }

  void* Set(void* cmd, uint32_t _result_shm_id, uint32_t _result_shm_offset) {
    static_cast<ValueType*>(cmd)->Init(_result_shm_id, _result_shm_offset);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t result_shm_id;
  uint32_t result_shm_offset;
};

static_assert(sizeof(GetError) == 12, "size of GetError should be 12");
static_assert(offsetof(GetError, header) == 0,
              "offset of GetError header should be 0");
static_assert(offsetof(GetError, result_shm_id) == 4,
              "offset of GetError result_shm_id should be 4");
static_assert(offsetof(GetError, result_shm_offset) == 8,
              "offset of GetError result_shm_offset should be 8");

struct GenQueriesEXTImmediate {
  typedef GenQueriesEXTImmediate ValueType;
  static const CommandId kCmdId = kGenQueriesEXTImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeDataSize(GLsizei _n) {
    return static_cast<uint32_t>(sizeof(GLuint) * _n);  // NOLINT
  }

  static uint32_t ComputeSize(GLsizei _n) {
    return static_cast<uint32_t>(sizeof(ValueType) +
                                 ComputeDataSize(_n));  // NOLINT
  }

  void SetHeader(GLsizei _n) {
    header.SetCmdByTotalSize<ValueType>(ComputeSize(_n));
  }

  void Init(GLsizei _n, GLuint* _queries) {
    SetHeader(_n);
    n = _n;
    memcpy(ImmediateDataAddress(this), _queries, ComputeDataSize(_n));
  }

  void* Set(void* cmd, GLsizei _n, GLuint* _queries) {
    static_cast<ValueType*>(cmd)->Init(_n, _queries);
    const uint32_t size = ComputeSize(_n);
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  int32_t n;
};

static_assert(sizeof(GenQueriesEXTImmediate) == 8,
              "size of GenQueriesEXTImmediate should be 8");
static_assert(offsetof(GenQueriesEXTImmediate, header) == 0,
              "offset of GenQueriesEXTImmediate header should be 0");
static_assert(offsetof(GenQueriesEXTImmediate, n) == 4,
              "offset of GenQueriesEXTImmediate n should be 4");

struct DeleteQueriesEXTImmediate {
  typedef DeleteQueriesEXTImmediate ValueType;
  static const CommandId kCmdId = kDeleteQueriesEXTImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeDataSize(GLsizei _n) {
    return static_cast<uint32_t>(sizeof(GLuint) * _n);  // NOLINT
  }

  static uint32_t ComputeSize(GLsizei _n) {
    return static_cast<uint32_t>(sizeof(ValueType) +
                                 ComputeDataSize(_n));  // NOLINT
  }

  void SetHeader(GLsizei _n) {
    header.SetCmdByTotalSize<ValueType>(ComputeSize(_n));
  }

  void Init(GLsizei _n, const GLuint* _queries) {
    SetHeader(_n);
    n = _n;
    memcpy(ImmediateDataAddress(this), _queries, ComputeDataSize(_n));
  }

  void* Set(void* cmd, GLsizei _n, const GLuint* _queries) {
    static_cast<ValueType*>(cmd)->Init(_n, _queries);
    const uint32_t size = ComputeSize(_n);
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  int32_t n;
};

static_assert(sizeof(DeleteQueriesEXTImmediate) == 8,
              "size of DeleteQueriesEXTImmediate should be 8");
static_assert(offsetof(DeleteQueriesEXTImmediate, header) == 0,
              "offset of DeleteQueriesEXTImmediate header should be 0");
static_assert(offsetof(DeleteQueriesEXTImmediate, n) == 4,
              "offset of DeleteQueriesEXTImmediate n should be 4");

struct QueryCounterEXT {
  typedef QueryCounterEXT ValueType;
  static const CommandId kCmdId = kQueryCounterEXT;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _id,
            GLenum _target,
            uint32_t _sync_data_shm_id,
            uint32_t _sync_data_shm_offset,
            GLuint _submit_count) {
    SetHeader();
    id = _id;
    target = _target;
    sync_data_shm_id = _sync_data_shm_id;
    sync_data_shm_offset = _sync_data_shm_offset;
    submit_count = _submit_count;
  }

  void* Set(void* cmd,
            GLuint _id,
            GLenum _target,
            uint32_t _sync_data_shm_id,
            uint32_t _sync_data_shm_offset,
            GLuint _submit_count) {
    static_cast<ValueType*>(cmd)->Init(_id, _target, _sync_data_shm_id,
                                       _sync_data_shm_offset, _submit_count);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t id;
  uint32_t target;
  uint32_t sync_data_shm_id;
  uint32_t sync_data_shm_offset;
  uint32_t submit_count;
};

static_assert(sizeof(QueryCounterEXT) == 24,
              "size of QueryCounterEXT should be 24");
static_assert(offsetof(QueryCounterEXT, header) == 0,
              "offset of QueryCounterEXT header should be 0");
static_assert(offsetof(QueryCounterEXT, id) == 4,
              "offset of QueryCounterEXT id should be 4");
static_assert(offsetof(QueryCounterEXT, target) == 8,
              "offset of QueryCounterEXT target should be 8");
static_assert(offsetof(QueryCounterEXT, sync_data_shm_id) == 12,
              "offset of QueryCounterEXT sync_data_shm_id should be 12");
static_assert(offsetof(QueryCounterEXT, sync_data_shm_offset) == 16,
              "offset of QueryCounterEXT sync_data_shm_offset should be 16");
static_assert(offsetof(QueryCounterEXT, submit_count) == 20,
              "offset of QueryCounterEXT submit_count should be 20");

struct BeginQueryEXT {
  typedef BeginQueryEXT ValueType;
  static const CommandId kCmdId = kBeginQueryEXT;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLenum _target,
            GLuint _id,
            uint32_t _sync_data_shm_id,
            uint32_t _sync_data_shm_offset) {
    SetHeader();
    target = _target;
    id = _id;
    sync_data_shm_id = _sync_data_shm_id;
    sync_data_shm_offset = _sync_data_shm_offset;
  }

  void* Set(void* cmd,
            GLenum _target,
            GLuint _id,
            uint32_t _sync_data_shm_id,
            uint32_t _sync_data_shm_offset) {
    static_cast<ValueType*>(cmd)->Init(_target, _id, _sync_data_shm_id,
                                       _sync_data_shm_offset);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t target;
  uint32_t id;
  uint32_t sync_data_shm_id;
  uint32_t sync_data_shm_offset;
};

static_assert(sizeof(BeginQueryEXT) == 20,
              "size of BeginQueryEXT should be 20");
static_assert(offsetof(BeginQueryEXT, header) == 0,
              "offset of BeginQueryEXT header should be 0");
static_assert(offsetof(BeginQueryEXT, target) == 4,
              "offset of BeginQueryEXT target should be 4");
static_assert(offsetof(BeginQueryEXT, id) == 8,
              "offset of BeginQueryEXT id should be 8");
static_assert(offsetof(BeginQueryEXT, sync_data_shm_id) == 12,
              "offset of BeginQueryEXT sync_data_shm_id should be 12");
static_assert(offsetof(BeginQueryEXT, sync_data_shm_offset) == 16,
              "offset of BeginQueryEXT sync_data_shm_offset should be 16");

struct EndQueryEXT {
  typedef EndQueryEXT ValueType;
  static const CommandId kCmdId = kEndQueryEXT;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLenum _target, GLuint _submit_count) {
    SetHeader();
    target = _target;
    submit_count = _submit_count;
  }

  void* Set(void* cmd, GLenum _target, GLuint _submit_count) {
    static_cast<ValueType*>(cmd)->Init(_target, _submit_count);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t target;
  uint32_t submit_count;
};

static_assert(sizeof(EndQueryEXT) == 12, "size of EndQueryEXT should be 12");
static_assert(offsetof(EndQueryEXT, header) == 0,
              "offset of EndQueryEXT header should be 0");
static_assert(offsetof(EndQueryEXT, target) == 4,
              "offset of EndQueryEXT target should be 4");
static_assert(offsetof(EndQueryEXT, submit_count) == 8,
              "offset of EndQueryEXT submit_count should be 8");

struct LoseContextCHROMIUM {
  typedef LoseContextCHROMIUM ValueType;
  static const CommandId kCmdId = kLoseContextCHROMIUM;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLenum _current, GLenum _other) {
    SetHeader();
    current = _current;
    other = _other;
  }

  void* Set(void* cmd, GLenum _current, GLenum _other) {
    static_cast<ValueType*>(cmd)->Init(_current, _other);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t current;
  uint32_t other;
};

static_assert(sizeof(LoseContextCHROMIUM) == 12,
              "size of LoseContextCHROMIUM should be 12");
static_assert(offsetof(LoseContextCHROMIUM, header) == 0,
              "offset of LoseContextCHROMIUM header should be 0");
static_assert(offsetof(LoseContextCHROMIUM, current) == 4,
              "offset of LoseContextCHROMIUM current should be 4");
static_assert(offsetof(LoseContextCHROMIUM, other) == 8,
              "offset of LoseContextCHROMIUM other should be 8");

struct BeginRasterCHROMIUMImmediate {
  typedef BeginRasterCHROMIUMImmediate ValueType;
  static const CommandId kCmdId = kBeginRasterCHROMIUMImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeDataSize() {
    return static_cast<uint32_t>(sizeof(GLbyte) * 16);
  }

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType) + ComputeDataSize());
  }

  void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); }

  void Init(GLfloat _r,
            GLfloat _g,
            GLfloat _b,
            GLfloat _a,
            GLboolean _needs_clear,
            GLuint _msaa_sample_count,
            gpu::raster::MsaaMode _msaa_mode,
            GLboolean _can_use_lcd_text,
            GLboolean _visible,
            GLfloat _hdr_headroom,
            const GLbyte* _mailbox) {
    SetHeader();
    r = _r;
    g = _g;
    b = _b;
    a = _a;
    needs_clear = _needs_clear;
    msaa_sample_count = _msaa_sample_count;
    msaa_mode = _msaa_mode;
    can_use_lcd_text = _can_use_lcd_text;
    visible = _visible;
    hdr_headroom = _hdr_headroom;
    memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize());
  }

  void* Set(void* cmd,
            GLfloat _r,
            GLfloat _g,
            GLfloat _b,
            GLfloat _a,
            GLboolean _needs_clear,
            GLuint _msaa_sample_count,
            gpu::raster::MsaaMode _msaa_mode,
            GLboolean _can_use_lcd_text,
            GLboolean _visible,
            GLfloat _hdr_headroom,
            const GLbyte* _mailbox) {
    static_cast<ValueType*>(cmd)->Init(
        _r, _g, _b, _a, _needs_clear, _msaa_sample_count, _msaa_mode,
        _can_use_lcd_text, _visible, _hdr_headroom, _mailbox);
    const uint32_t size = ComputeSize();
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  float r;
  float g;
  float b;
  float a;
  uint32_t needs_clear;
  uint32_t msaa_sample_count;
  uint32_t msaa_mode;
  uint32_t can_use_lcd_text;
  uint32_t visible;
  float hdr_headroom;
};

static_assert(sizeof(BeginRasterCHROMIUMImmediate) == 44,
              "size of BeginRasterCHROMIUMImmediate should be 44");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, header) == 0,
              "offset of BeginRasterCHROMIUMImmediate header should be 0");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, r) == 4,
              "offset of BeginRasterCHROMIUMImmediate r should be 4");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, g) == 8,
              "offset of BeginRasterCHROMIUMImmediate g should be 8");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, b) == 12,
              "offset of BeginRasterCHROMIUMImmediate b should be 12");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, a) == 16,
              "offset of BeginRasterCHROMIUMImmediate a should be 16");
static_assert(
    offsetof(BeginRasterCHROMIUMImmediate, needs_clear) == 20,
    "offset of BeginRasterCHROMIUMImmediate needs_clear should be 20");
static_assert(
    offsetof(BeginRasterCHROMIUMImmediate, msaa_sample_count) == 24,
    "offset of BeginRasterCHROMIUMImmediate msaa_sample_count should be 24");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, msaa_mode) == 28,
              "offset of BeginRasterCHROMIUMImmediate msaa_mode should be 28");
static_assert(
    offsetof(BeginRasterCHROMIUMImmediate, can_use_lcd_text) == 32,
    "offset of BeginRasterCHROMIUMImmediate can_use_lcd_text should be 32");
static_assert(offsetof(BeginRasterCHROMIUMImmediate, visible) == 36,
              "offset of BeginRasterCHROMIUMImmediate visible should be 36");
static_assert(
    offsetof(BeginRasterCHROMIUMImmediate, hdr_headroom) == 40,
    "offset of BeginRasterCHROMIUMImmediate hdr_headroom should be 40");

struct RasterCHROMIUM {
  typedef RasterCHROMIUM ValueType;
  static const CommandId kCmdId = kRasterCHROMIUM;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _raster_shm_id,
            GLuint _raster_shm_offset,
            GLsizeiptr _raster_shm_size,
            GLuint _font_shm_id,
            GLuint _font_shm_offset,
            GLsizeiptr _font_shm_size) {
    SetHeader();
    raster_shm_id = _raster_shm_id;
    raster_shm_offset = _raster_shm_offset;
    raster_shm_size = _raster_shm_size;
    font_shm_id = _font_shm_id;
    font_shm_offset = _font_shm_offset;
    font_shm_size = _font_shm_size;
  }

  void* Set(void* cmd,
            GLuint _raster_shm_id,
            GLuint _raster_shm_offset,
            GLsizeiptr _raster_shm_size,
            GLuint _font_shm_id,
            GLuint _font_shm_offset,
            GLsizeiptr _font_shm_size) {
    static_cast<ValueType*>(cmd)->Init(_raster_shm_id, _raster_shm_offset,
                                       _raster_shm_size, _font_shm_id,
                                       _font_shm_offset, _font_shm_size);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t raster_shm_id;
  uint32_t raster_shm_offset;
  int32_t raster_shm_size;
  uint32_t font_shm_id;
  uint32_t font_shm_offset;
  int32_t font_shm_size;
};

static_assert(sizeof(RasterCHROMIUM) == 28,
              "size of RasterCHROMIUM should be 28");
static_assert(offsetof(RasterCHROMIUM, header) == 0,
              "offset of RasterCHROMIUM header should be 0");
static_assert(offsetof(RasterCHROMIUM, raster_shm_id) == 4,
              "offset of RasterCHROMIUM raster_shm_id should be 4");
static_assert(offsetof(RasterCHROMIUM, raster_shm_offset) == 8,
              "offset of RasterCHROMIUM raster_shm_offset should be 8");
static_assert(offsetof(RasterCHROMIUM, raster_shm_size) == 12,
              "offset of RasterCHROMIUM raster_shm_size should be 12");
static_assert(offsetof(RasterCHROMIUM, font_shm_id) == 16,
              "offset of RasterCHROMIUM font_shm_id should be 16");
static_assert(offsetof(RasterCHROMIUM, font_shm_offset) == 20,
              "offset of RasterCHROMIUM font_shm_offset should be 20");
static_assert(offsetof(RasterCHROMIUM, font_shm_size) == 24,
              "offset of RasterCHROMIUM font_shm_size should be 24");

struct EndRasterCHROMIUM {
  typedef EndRasterCHROMIUM ValueType;
  static const CommandId kCmdId = kEndRasterCHROMIUM;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init() { SetHeader(); }

  void* Set(void* cmd) {
    static_cast<ValueType*>(cmd)->Init();
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
};

static_assert(sizeof(EndRasterCHROMIUM) == 4,
              "size of EndRasterCHROMIUM should be 4");
static_assert(offsetof(EndRasterCHROMIUM, header) == 0,
              "offset of EndRasterCHROMIUM header should be 0");

struct CreateTransferCacheEntryINTERNAL {
  typedef CreateTransferCacheEntryINTERNAL ValueType;
  static const CommandId kCmdId = kCreateTransferCacheEntryINTERNAL;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _entry_type,
            GLuint _entry_id,
            GLuint _handle_shm_id,
            GLuint _handle_shm_offset,
            GLuint _data_shm_id,
            GLuint _data_shm_offset,
            GLuint _data_size) {
    SetHeader();
    entry_type = _entry_type;
    entry_id = _entry_id;
    handle_shm_id = _handle_shm_id;
    handle_shm_offset = _handle_shm_offset;
    data_shm_id = _data_shm_id;
    data_shm_offset = _data_shm_offset;
    data_size = _data_size;
  }

  void* Set(void* cmd,
            GLuint _entry_type,
            GLuint _entry_id,
            GLuint _handle_shm_id,
            GLuint _handle_shm_offset,
            GLuint _data_shm_id,
            GLuint _data_shm_offset,
            GLuint _data_size) {
    static_cast<ValueType*>(cmd)->Init(_entry_type, _entry_id, _handle_shm_id,
                                       _handle_shm_offset, _data_shm_id,
                                       _data_shm_offset, _data_size);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t entry_type;
  uint32_t entry_id;
  uint32_t handle_shm_id;
  uint32_t handle_shm_offset;
  uint32_t data_shm_id;
  uint32_t data_shm_offset;
  uint32_t data_size;
};

static_assert(sizeof(CreateTransferCacheEntryINTERNAL) == 32,
              "size of CreateTransferCacheEntryINTERNAL should be 32");
static_assert(offsetof(CreateTransferCacheEntryINTERNAL, header) == 0,
              "offset of CreateTransferCacheEntryINTERNAL header should be 0");
static_assert(
    offsetof(CreateTransferCacheEntryINTERNAL, entry_type) == 4,
    "offset of CreateTransferCacheEntryINTERNAL entry_type should be 4");
static_assert(
    offsetof(CreateTransferCacheEntryINTERNAL, entry_id) == 8,
    "offset of CreateTransferCacheEntryINTERNAL entry_id should be 8");
static_assert(
    offsetof(CreateTransferCacheEntryINTERNAL, handle_shm_id) == 12,
    "offset of CreateTransferCacheEntryINTERNAL handle_shm_id should be 12");
static_assert(offsetof(CreateTransferCacheEntryINTERNAL, handle_shm_offset) ==
                  16,
              "offset of CreateTransferCacheEntryINTERNAL handle_shm_offset "
              "should be 16");
static_assert(
    offsetof(CreateTransferCacheEntryINTERNAL, data_shm_id) == 20,
    "offset of CreateTransferCacheEntryINTERNAL data_shm_id should be 20");
static_assert(
    offsetof(CreateTransferCacheEntryINTERNAL, data_shm_offset) == 24,
    "offset of CreateTransferCacheEntryINTERNAL data_shm_offset should be 24");
static_assert(
    offsetof(CreateTransferCacheEntryINTERNAL, data_size) == 28,
    "offset of CreateTransferCacheEntryINTERNAL data_size should be 28");

struct DeleteTransferCacheEntryINTERNAL {
  typedef DeleteTransferCacheEntryINTERNAL ValueType;
  static const CommandId kCmdId = kDeleteTransferCacheEntryINTERNAL;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _entry_type, GLuint _entry_id) {
    SetHeader();
    entry_type = _entry_type;
    entry_id = _entry_id;
  }

  void* Set(void* cmd, GLuint _entry_type, GLuint _entry_id) {
    static_cast<ValueType*>(cmd)->Init(_entry_type, _entry_id);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t entry_type;
  uint32_t entry_id;
};

static_assert(sizeof(DeleteTransferCacheEntryINTERNAL) == 12,
              "size of DeleteTransferCacheEntryINTERNAL should be 12");
static_assert(offsetof(DeleteTransferCacheEntryINTERNAL, header) == 0,
              "offset of DeleteTransferCacheEntryINTERNAL header should be 0");
static_assert(
    offsetof(DeleteTransferCacheEntryINTERNAL, entry_type) == 4,
    "offset of DeleteTransferCacheEntryINTERNAL entry_type should be 4");
static_assert(
    offsetof(DeleteTransferCacheEntryINTERNAL, entry_id) == 8,
    "offset of DeleteTransferCacheEntryINTERNAL entry_id should be 8");

struct UnlockTransferCacheEntryINTERNAL {
  typedef UnlockTransferCacheEntryINTERNAL ValueType;
  static const CommandId kCmdId = kUnlockTransferCacheEntryINTERNAL;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _entry_type, GLuint _entry_id) {
    SetHeader();
    entry_type = _entry_type;
    entry_id = _entry_id;
  }

  void* Set(void* cmd, GLuint _entry_type, GLuint _entry_id) {
    static_cast<ValueType*>(cmd)->Init(_entry_type, _entry_id);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t entry_type;
  uint32_t entry_id;
};

static_assert(sizeof(UnlockTransferCacheEntryINTERNAL) == 12,
              "size of UnlockTransferCacheEntryINTERNAL should be 12");
static_assert(offsetof(UnlockTransferCacheEntryINTERNAL, header) == 0,
              "offset of UnlockTransferCacheEntryINTERNAL header should be 0");
static_assert(
    offsetof(UnlockTransferCacheEntryINTERNAL, entry_type) == 4,
    "offset of UnlockTransferCacheEntryINTERNAL entry_type should be 4");
static_assert(
    offsetof(UnlockTransferCacheEntryINTERNAL, entry_id) == 8,
    "offset of UnlockTransferCacheEntryINTERNAL entry_id should be 8");

struct DeletePaintCachePathsINTERNALImmediate {
  typedef DeletePaintCachePathsINTERNALImmediate ValueType;
  static const CommandId kCmdId = kDeletePaintCachePathsINTERNALImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeDataSize(GLsizei _n) {
    return static_cast<uint32_t>(sizeof(GLuint) * _n);  // NOLINT
  }

  static uint32_t ComputeSize(GLsizei _n) {
    return static_cast<uint32_t>(sizeof(ValueType) +
                                 ComputeDataSize(_n));  // NOLINT
  }

  void SetHeader(GLsizei _n) {
    header.SetCmdByTotalSize<ValueType>(ComputeSize(_n));
  }

  void Init(GLsizei _n, const GLuint* _ids) {
    SetHeader(_n);
    n = _n;
    memcpy(ImmediateDataAddress(this), _ids, ComputeDataSize(_n));
  }

  void* Set(void* cmd, GLsizei _n, const GLuint* _ids) {
    static_cast<ValueType*>(cmd)->Init(_n, _ids);
    const uint32_t size = ComputeSize(_n);
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  int32_t n;
};

static_assert(sizeof(DeletePaintCachePathsINTERNALImmediate) == 8,
              "size of DeletePaintCachePathsINTERNALImmediate should be 8");
static_assert(
    offsetof(DeletePaintCachePathsINTERNALImmediate, header) == 0,
    "offset of DeletePaintCachePathsINTERNALImmediate header should be 0");
static_assert(offsetof(DeletePaintCachePathsINTERNALImmediate, n) == 4,
              "offset of DeletePaintCachePathsINTERNALImmediate n should be 4");

struct DeletePaintCachePathsINTERNAL {
  typedef DeletePaintCachePathsINTERNAL ValueType;
  static const CommandId kCmdId = kDeletePaintCachePathsINTERNAL;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLsizei _n, uint32_t _ids_shm_id, uint32_t _ids_shm_offset) {
    SetHeader();
    n = _n;
    ids_shm_id = _ids_shm_id;
    ids_shm_offset = _ids_shm_offset;
  }

  void* Set(void* cmd,
            GLsizei _n,
            uint32_t _ids_shm_id,
            uint32_t _ids_shm_offset) {
    static_cast<ValueType*>(cmd)->Init(_n, _ids_shm_id, _ids_shm_offset);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  int32_t n;
  uint32_t ids_shm_id;
  uint32_t ids_shm_offset;
};

static_assert(sizeof(DeletePaintCachePathsINTERNAL) == 16,
              "size of DeletePaintCachePathsINTERNAL should be 16");
static_assert(offsetof(DeletePaintCachePathsINTERNAL, header) == 0,
              "offset of DeletePaintCachePathsINTERNAL header should be 0");
static_assert(offsetof(DeletePaintCachePathsINTERNAL, n) == 4,
              "offset of DeletePaintCachePathsINTERNAL n should be 4");
static_assert(offsetof(DeletePaintCachePathsINTERNAL, ids_shm_id) == 8,
              "offset of DeletePaintCachePathsINTERNAL ids_shm_id should be 8");
static_assert(
    offsetof(DeletePaintCachePathsINTERNAL, ids_shm_offset) == 12,
    "offset of DeletePaintCachePathsINTERNAL ids_shm_offset should be 12");

struct ClearPaintCacheINTERNAL {
  typedef ClearPaintCacheINTERNAL ValueType;
  static const CommandId kCmdId = kClearPaintCacheINTERNAL;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init() { SetHeader(); }

  void* Set(void* cmd) {
    static_cast<ValueType*>(cmd)->Init();
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
};

static_assert(sizeof(ClearPaintCacheINTERNAL) == 4,
              "size of ClearPaintCacheINTERNAL should be 4");
static_assert(offsetof(ClearPaintCacheINTERNAL, header) == 0,
              "offset of ClearPaintCacheINTERNAL header should be 0");

struct CopySharedImageINTERNALImmediate {
  typedef CopySharedImageINTERNALImmediate ValueType;
  static const CommandId kCmdId = kCopySharedImageINTERNALImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);

  static uint32_t ComputeDataSize() {
    return static_cast<uint32_t>(sizeof(GLbyte) * 32);
  }

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType) + ComputeDataSize());
  }

  void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); }

  void Init(GLint _xoffset,
            GLint _yoffset,
            GLint _x,
            GLint _y,
            GLsizei _width,
            GLsizei _height,
            const GLbyte* _mailboxes) {
    SetHeader();
    xoffset = _xoffset;
    yoffset = _yoffset;
    x = _x;
    y = _y;
    width = _width;
    height = _height;
    memcpy(ImmediateDataAddress(this), _mailboxes, ComputeDataSize());
  }

  void* Set(void* cmd,
            GLint _xoffset,
            GLint _yoffset,
            GLint _x,
            GLint _y,
            GLsizei _width,
            GLsizei _height,
            const GLbyte* _mailboxes) {
    static_cast<ValueType*>(cmd)->Init(_xoffset, _yoffset, _x, _y, _width,
                                       _height, _mailboxes);
    const uint32_t size = ComputeSize();
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  int32_t xoffset;
  int32_t yoffset;
  int32_t x;
  int32_t y;
  int32_t width;
  int32_t height;
};

static_assert(sizeof(CopySharedImageINTERNALImmediate) == 28,
              "size of CopySharedImageINTERNALImmediate should be 28");
static_assert(offsetof(CopySharedImageINTERNALImmediate, header) == 0,
              "offset of CopySharedImageINTERNALImmediate header should be 0");
static_assert(offsetof(CopySharedImageINTERNALImmediate, xoffset) == 4,
              "offset of CopySharedImageINTERNALImmediate xoffset should be 4");
static_assert(offsetof(CopySharedImageINTERNALImmediate, yoffset) == 8,
              "offset of CopySharedImageINTERNALImmediate yoffset should be 8");
static_assert(offsetof(CopySharedImageINTERNALImmediate, x) == 12,
              "offset of CopySharedImageINTERNALImmediate x should be 12");
static_assert(offsetof(CopySharedImageINTERNALImmediate, y) == 16,
              "offset of CopySharedImageINTERNALImmediate y should be 16");
static_assert(offsetof(CopySharedImageINTERNALImmediate, width) == 20,
              "offset of CopySharedImageINTERNALImmediate width should be 20");
static_assert(offsetof(CopySharedImageINTERNALImmediate, height) == 24,
              "offset of CopySharedImageINTERNALImmediate height should be 24");

struct WritePixelsINTERNALImmediate {
  typedef WritePixelsINTERNALImmediate ValueType;
  static const CommandId kCmdId = kWritePixelsINTERNALImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);

  static uint32_t ComputeDataSize() {
    return static_cast<uint32_t>(sizeof(GLbyte) * 16);
  }

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType) + ComputeDataSize());
  }

  void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); }

  void Init(GLint _x_offset,
            GLint _y_offset,
            GLuint _src_width,
            GLuint _src_height,
            GLuint _src_row_bytes,
            GLuint _src_sk_color_type,
            GLuint _src_sk_alpha_type,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _pixels_offset,
            const GLbyte* _mailbox) {
    SetHeader();
    x_offset = _x_offset;
    y_offset = _y_offset;
    src_width = _src_width;
    src_height = _src_height;
    src_row_bytes = _src_row_bytes;
    src_sk_color_type = _src_sk_color_type;
    src_sk_alpha_type = _src_sk_alpha_type;
    shm_id = _shm_id;
    shm_offset = _shm_offset;
    pixels_offset = _pixels_offset;
    memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize());
  }

  void* Set(void* cmd,
            GLint _x_offset,
            GLint _y_offset,
            GLuint _src_width,
            GLuint _src_height,
            GLuint _src_row_bytes,
            GLuint _src_sk_color_type,
            GLuint _src_sk_alpha_type,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _pixels_offset,
            const GLbyte* _mailbox) {
    static_cast<ValueType*>(cmd)->Init(
        _x_offset, _y_offset, _src_width, _src_height, _src_row_bytes,
        _src_sk_color_type, _src_sk_alpha_type, _shm_id, _shm_offset,
        _pixels_offset, _mailbox);
    const uint32_t size = ComputeSize();
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  int32_t x_offset;
  int32_t y_offset;
  uint32_t src_width;
  uint32_t src_height;
  uint32_t src_row_bytes;
  uint32_t src_sk_color_type;
  uint32_t src_sk_alpha_type;
  int32_t shm_id;
  uint32_t shm_offset;
  uint32_t pixels_offset;
};

static_assert(sizeof(WritePixelsINTERNALImmediate) == 44,
              "size of WritePixelsINTERNALImmediate should be 44");
static_assert(offsetof(WritePixelsINTERNALImmediate, header) == 0,
              "offset of WritePixelsINTERNALImmediate header should be 0");
static_assert(offsetof(WritePixelsINTERNALImmediate, x_offset) == 4,
              "offset of WritePixelsINTERNALImmediate x_offset should be 4");
static_assert(offsetof(WritePixelsINTERNALImmediate, y_offset) == 8,
              "offset of WritePixelsINTERNALImmediate y_offset should be 8");
static_assert(offsetof(WritePixelsINTERNALImmediate, src_width) == 12,
              "offset of WritePixelsINTERNALImmediate src_width should be 12");
static_assert(offsetof(WritePixelsINTERNALImmediate, src_height) == 16,
              "offset of WritePixelsINTERNALImmediate src_height should be 16");
static_assert(
    offsetof(WritePixelsINTERNALImmediate, src_row_bytes) == 20,
    "offset of WritePixelsINTERNALImmediate src_row_bytes should be 20");
static_assert(
    offsetof(WritePixelsINTERNALImmediate, src_sk_color_type) == 24,
    "offset of WritePixelsINTERNALImmediate src_sk_color_type should be 24");
static_assert(
    offsetof(WritePixelsINTERNALImmediate, src_sk_alpha_type) == 28,
    "offset of WritePixelsINTERNALImmediate src_sk_alpha_type should be 28");
static_assert(offsetof(WritePixelsINTERNALImmediate, shm_id) == 32,
              "offset of WritePixelsINTERNALImmediate shm_id should be 32");
static_assert(offsetof(WritePixelsINTERNALImmediate, shm_offset) == 36,
              "offset of WritePixelsINTERNALImmediate shm_offset should be 36");
static_assert(
    offsetof(WritePixelsINTERNALImmediate, pixels_offset) == 40,
    "offset of WritePixelsINTERNALImmediate pixels_offset should be 40");

struct WritePixelsYUVINTERNALImmediate {
  typedef WritePixelsYUVINTERNALImmediate ValueType;
  static const CommandId kCmdId = kWritePixelsYUVINTERNALImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);

  static uint32_t ComputeDataSize() {
    return static_cast<uint32_t>(sizeof(GLbyte) * 16);
  }

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType) + ComputeDataSize());
  }

  void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); }

  void Init(GLuint _src_width,
            GLuint _src_height,
            GLuint _src_row_bytes_plane1,
            GLuint _src_row_bytes_plane2,
            GLuint _src_row_bytes_plane3,
            GLuint _src_row_bytes_plane4,
            GLuint _src_yuv_plane_config,
            GLuint _src_yuv_subsampling,
            GLuint _src_yuv_datatype,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _plane2_offset,
            GLuint _plane3_offset,
            GLuint _plane4_offset,
            const GLbyte* _mailbox) {
    SetHeader();
    src_width = _src_width;
    src_height = _src_height;
    src_row_bytes_plane1 = _src_row_bytes_plane1;
    src_row_bytes_plane2 = _src_row_bytes_plane2;
    src_row_bytes_plane3 = _src_row_bytes_plane3;
    src_row_bytes_plane4 = _src_row_bytes_plane4;
    src_yuv_plane_config = _src_yuv_plane_config;
    src_yuv_subsampling = _src_yuv_subsampling;
    src_yuv_datatype = _src_yuv_datatype;
    shm_id = _shm_id;
    shm_offset = _shm_offset;
    plane2_offset = _plane2_offset;
    plane3_offset = _plane3_offset;
    plane4_offset = _plane4_offset;
    memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize());
  }

  void* Set(void* cmd,
            GLuint _src_width,
            GLuint _src_height,
            GLuint _src_row_bytes_plane1,
            GLuint _src_row_bytes_plane2,
            GLuint _src_row_bytes_plane3,
            GLuint _src_row_bytes_plane4,
            GLuint _src_yuv_plane_config,
            GLuint _src_yuv_subsampling,
            GLuint _src_yuv_datatype,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _plane2_offset,
            GLuint _plane3_offset,
            GLuint _plane4_offset,
            const GLbyte* _mailbox) {
    static_cast<ValueType*>(cmd)->Init(
        _src_width, _src_height, _src_row_bytes_plane1, _src_row_bytes_plane2,
        _src_row_bytes_plane3, _src_row_bytes_plane4, _src_yuv_plane_config,
        _src_yuv_subsampling, _src_yuv_datatype, _shm_id, _shm_offset,
        _plane2_offset, _plane3_offset, _plane4_offset, _mailbox);
    const uint32_t size = ComputeSize();
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  uint32_t src_width;
  uint32_t src_height;
  uint32_t src_row_bytes_plane1;
  uint32_t src_row_bytes_plane2;
  uint32_t src_row_bytes_plane3;
  uint32_t src_row_bytes_plane4;
  uint32_t src_yuv_plane_config;
  uint32_t src_yuv_subsampling;
  uint32_t src_yuv_datatype;
  int32_t shm_id;
  uint32_t shm_offset;
  uint32_t plane2_offset;
  uint32_t plane3_offset;
  uint32_t plane4_offset;
};

static_assert(sizeof(WritePixelsYUVINTERNALImmediate) == 60,
              "size of WritePixelsYUVINTERNALImmediate should be 60");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, header) == 0,
              "offset of WritePixelsYUVINTERNALImmediate header should be 0");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, src_width) == 4,
    "offset of WritePixelsYUVINTERNALImmediate src_width should be 4");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, src_height) == 8,
    "offset of WritePixelsYUVINTERNALImmediate src_height should be 8");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, src_row_bytes_plane1) ==
                  12,
              "offset of WritePixelsYUVINTERNALImmediate src_row_bytes_plane1 "
              "should be 12");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, src_row_bytes_plane2) ==
                  16,
              "offset of WritePixelsYUVINTERNALImmediate src_row_bytes_plane2 "
              "should be 16");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, src_row_bytes_plane3) ==
                  20,
              "offset of WritePixelsYUVINTERNALImmediate src_row_bytes_plane3 "
              "should be 20");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, src_row_bytes_plane4) ==
                  24,
              "offset of WritePixelsYUVINTERNALImmediate src_row_bytes_plane4 "
              "should be 24");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, src_yuv_plane_config) ==
                  28,
              "offset of WritePixelsYUVINTERNALImmediate src_yuv_plane_config "
              "should be 28");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, src_yuv_subsampling) ==
                  32,
              "offset of WritePixelsYUVINTERNALImmediate src_yuv_subsampling "
              "should be 32");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, src_yuv_datatype) == 36,
    "offset of WritePixelsYUVINTERNALImmediate src_yuv_datatype should be 36");
static_assert(offsetof(WritePixelsYUVINTERNALImmediate, shm_id) == 40,
              "offset of WritePixelsYUVINTERNALImmediate shm_id should be 40");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, shm_offset) == 44,
    "offset of WritePixelsYUVINTERNALImmediate shm_offset should be 44");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, plane2_offset) == 48,
    "offset of WritePixelsYUVINTERNALImmediate plane2_offset should be 48");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, plane3_offset) == 52,
    "offset of WritePixelsYUVINTERNALImmediate plane3_offset should be 52");
static_assert(
    offsetof(WritePixelsYUVINTERNALImmediate, plane4_offset) == 56,
    "offset of WritePixelsYUVINTERNALImmediate plane4_offset should be 56");

struct ReadbackARGBImagePixelsINTERNALImmediate {
  typedef ReadbackARGBImagePixelsINTERNALImmediate ValueType;
  static const CommandId kCmdId = kReadbackARGBImagePixelsINTERNALImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);

  typedef uint32_t Result;

  static uint32_t ComputeDataSize() {
    return static_cast<uint32_t>(sizeof(GLbyte) * 16);
  }

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType) + ComputeDataSize());
  }

  void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); }

  void Init(GLint _src_x,
            GLint _src_y,
            GLint _plane_index,
            GLuint _dst_width,
            GLuint _dst_height,
            GLuint _row_bytes,
            GLuint _dst_sk_color_type,
            GLuint _dst_sk_alpha_type,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _color_space_offset,
            GLuint _pixels_offset,
            const GLbyte* _mailbox) {
    SetHeader();
    src_x = _src_x;
    src_y = _src_y;
    plane_index = _plane_index;
    dst_width = _dst_width;
    dst_height = _dst_height;
    row_bytes = _row_bytes;
    dst_sk_color_type = _dst_sk_color_type;
    dst_sk_alpha_type = _dst_sk_alpha_type;
    shm_id = _shm_id;
    shm_offset = _shm_offset;
    color_space_offset = _color_space_offset;
    pixels_offset = _pixels_offset;
    memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize());
  }

  void* Set(void* cmd,
            GLint _src_x,
            GLint _src_y,
            GLint _plane_index,
            GLuint _dst_width,
            GLuint _dst_height,
            GLuint _row_bytes,
            GLuint _dst_sk_color_type,
            GLuint _dst_sk_alpha_type,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _color_space_offset,
            GLuint _pixels_offset,
            const GLbyte* _mailbox) {
    static_cast<ValueType*>(cmd)->Init(
        _src_x, _src_y, _plane_index, _dst_width, _dst_height, _row_bytes,
        _dst_sk_color_type, _dst_sk_alpha_type, _shm_id, _shm_offset,
        _color_space_offset, _pixels_offset, _mailbox);
    const uint32_t size = ComputeSize();
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  int32_t src_x;
  int32_t src_y;
  int32_t plane_index;
  uint32_t dst_width;
  uint32_t dst_height;
  uint32_t row_bytes;
  uint32_t dst_sk_color_type;
  uint32_t dst_sk_alpha_type;
  int32_t shm_id;
  uint32_t shm_offset;
  uint32_t color_space_offset;
  uint32_t pixels_offset;
};

static_assert(sizeof(ReadbackARGBImagePixelsINTERNALImmediate) == 52,
              "size of ReadbackARGBImagePixelsINTERNALImmediate should be 52");
static_assert(
    offsetof(ReadbackARGBImagePixelsINTERNALImmediate, header) == 0,
    "offset of ReadbackARGBImagePixelsINTERNALImmediate header should be 0");
static_assert(
    offsetof(ReadbackARGBImagePixelsINTERNALImmediate, src_x) == 4,
    "offset of ReadbackARGBImagePixelsINTERNALImmediate src_x should be 4");
static_assert(
    offsetof(ReadbackARGBImagePixelsINTERNALImmediate, src_y) == 8,
    "offset of ReadbackARGBImagePixelsINTERNALImmediate src_y should be 8");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate, plane_index) ==
                  12,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate plane_index "
              "should be 12");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate, dst_width) ==
                  16,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate dst_width "
              "should be 16");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate, dst_height) ==
                  20,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate dst_height "
              "should be 20");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate, row_bytes) ==
                  24,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate row_bytes "
              "should be 24");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate,
                       dst_sk_color_type) == 28,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate "
              "dst_sk_color_type should be 28");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate,
                       dst_sk_alpha_type) == 32,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate "
              "dst_sk_alpha_type should be 32");
static_assert(
    offsetof(ReadbackARGBImagePixelsINTERNALImmediate, shm_id) == 36,
    "offset of ReadbackARGBImagePixelsINTERNALImmediate shm_id should be 36");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate, shm_offset) ==
                  40,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate shm_offset "
              "should be 40");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate,
                       color_space_offset) == 44,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate "
              "color_space_offset should be 44");
static_assert(offsetof(ReadbackARGBImagePixelsINTERNALImmediate,
                       pixels_offset) == 48,
              "offset of ReadbackARGBImagePixelsINTERNALImmediate "
              "pixels_offset should be 48");

struct ReadbackYUVImagePixelsINTERNALImmediate {
  typedef ReadbackYUVImagePixelsINTERNALImmediate ValueType;
  static const CommandId kCmdId = kReadbackYUVImagePixelsINTERNALImmediate;
  static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);

  typedef uint32_t Result;

  static uint32_t ComputeDataSize() {
    return static_cast<uint32_t>(sizeof(GLbyte) * 16);
  }

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType) + ComputeDataSize());
  }

  void SetHeader() { header.SetCmdByTotalSize<ValueType>(ComputeSize()); }

  void Init(GLuint _dst_width,
            GLuint _dst_height,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _y_offset,
            GLuint _y_stride,
            GLuint _u_offset,
            GLuint _u_stride,
            GLuint _v_offset,
            GLuint _v_stride,
            const GLbyte* _mailbox) {
    SetHeader();
    dst_width = _dst_width;
    dst_height = _dst_height;
    shm_id = _shm_id;
    shm_offset = _shm_offset;
    y_offset = _y_offset;
    y_stride = _y_stride;
    u_offset = _u_offset;
    u_stride = _u_stride;
    v_offset = _v_offset;
    v_stride = _v_stride;
    memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize());
  }

  void* Set(void* cmd,
            GLuint _dst_width,
            GLuint _dst_height,
            GLint _shm_id,
            GLuint _shm_offset,
            GLuint _y_offset,
            GLuint _y_stride,
            GLuint _u_offset,
            GLuint _u_stride,
            GLuint _v_offset,
            GLuint _v_stride,
            const GLbyte* _mailbox) {
    static_cast<ValueType*>(cmd)->Init(
        _dst_width, _dst_height, _shm_id, _shm_offset, _y_offset, _y_stride,
        _u_offset, _u_stride, _v_offset, _v_stride, _mailbox);
    const uint32_t size = ComputeSize();
    return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
  }

  gpu::CommandHeader header;
  uint32_t dst_width;
  uint32_t dst_height;
  int32_t shm_id;
  uint32_t shm_offset;
  uint32_t y_offset;
  uint32_t y_stride;
  uint32_t u_offset;
  uint32_t u_stride;
  uint32_t v_offset;
  uint32_t v_stride;
};

static_assert(sizeof(ReadbackYUVImagePixelsINTERNALImmediate) == 44,
              "size of ReadbackYUVImagePixelsINTERNALImmediate should be 44");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, header) == 0,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate header should be 0");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, dst_width) == 4,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate dst_width should be 4");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, dst_height) == 8,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate dst_height should be 8");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, shm_id) == 12,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate shm_id should be 12");
static_assert(offsetof(ReadbackYUVImagePixelsINTERNALImmediate, shm_offset) ==
                  16,
              "offset of ReadbackYUVImagePixelsINTERNALImmediate shm_offset "
              "should be 16");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, y_offset) == 20,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate y_offset should be 20");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, y_stride) == 24,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate y_stride should be 24");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, u_offset) == 28,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate u_offset should be 28");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, u_stride) == 32,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate u_stride should be 32");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, v_offset) == 36,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate v_offset should be 36");
static_assert(
    offsetof(ReadbackYUVImagePixelsINTERNALImmediate, v_stride) == 40,
    "offset of ReadbackYUVImagePixelsINTERNALImmediate v_stride should be 40");

struct TraceBeginCHROMIUM {
  typedef TraceBeginCHROMIUM ValueType;
  static const CommandId kCmdId = kTraceBeginCHROMIUM;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _category_bucket_id, GLuint _name_bucket_id) {
    SetHeader();
    category_bucket_id = _category_bucket_id;
    name_bucket_id = _name_bucket_id;
  }

  void* Set(void* cmd, GLuint _category_bucket_id, GLuint _name_bucket_id) {
    static_cast<ValueType*>(cmd)->Init(_category_bucket_id, _name_bucket_id);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t category_bucket_id;
  uint32_t name_bucket_id;
};

static_assert(sizeof(TraceBeginCHROMIUM) == 12,
              "size of TraceBeginCHROMIUM should be 12");
static_assert(offsetof(TraceBeginCHROMIUM, header) == 0,
              "offset of TraceBeginCHROMIUM header should be 0");
static_assert(offsetof(TraceBeginCHROMIUM, category_bucket_id) == 4,
              "offset of TraceBeginCHROMIUM category_bucket_id should be 4");
static_assert(offsetof(TraceBeginCHROMIUM, name_bucket_id) == 8,
              "offset of TraceBeginCHROMIUM name_bucket_id should be 8");

struct TraceEndCHROMIUM {
  typedef TraceEndCHROMIUM ValueType;
  static const CommandId kCmdId = kTraceEndCHROMIUM;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init() { SetHeader(); }

  void* Set(void* cmd) {
    static_cast<ValueType*>(cmd)->Init();
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
};

static_assert(sizeof(TraceEndCHROMIUM) == 4,
              "size of TraceEndCHROMIUM should be 4");
static_assert(offsetof(TraceEndCHROMIUM, header) == 0,
              "offset of TraceEndCHROMIUM header should be 0");

struct SetActiveURLCHROMIUM {
  typedef SetActiveURLCHROMIUM ValueType;
  static const CommandId kCmdId = kSetActiveURLCHROMIUM;
  static const cmd::ArgFlags kArgFlags = cmd::kFixed;
  static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);

  static uint32_t ComputeSize() {
    return static_cast<uint32_t>(sizeof(ValueType));  // NOLINT
  }

  void SetHeader() { header.SetCmd<ValueType>(); }

  void Init(GLuint _url_bucket_id) {
    SetHeader();
    url_bucket_id = _url_bucket_id;
  }

  void* Set(void* cmd, GLuint _url_bucket_id) {
    static_cast<ValueType*>(cmd)->Init(_url_bucket_id);
    return NextCmdAddress<ValueType>(cmd);
  }

  gpu::CommandHeader header;
  uint32_t url_bucket_id;
};

static_assert(sizeof(SetActiveURLCHROMIUM) == 8,
              "size of SetActiveURLCHROMIUM should be 8");
static_assert(offsetof(SetActiveURLCHROMIUM, header) == 0,
              "offset of SetActiveURLCHROMIUM header should be 0");
static_assert(offsetof(SetActiveURLCHROMIUM, url_bucket_id) == 4,
              "offset of SetActiveURLCHROMIUM url_bucket_id should be 4");

#endif  // GPU_COMMAND_BUFFER_COMMON_RASTER_CMD_FORMAT_AUTOGEN_H_