| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // use other POD types or intrinsics as members. | 57 // use other POD types or intrinsics as members. |
| 58 | 58 |
| 59 #ifndef O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ | 59 #ifndef O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ |
| 60 #define O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ | 60 #define O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ |
| 61 | 61 |
| 62 #include "command_buffer/common/cross/cmd_buffer_common.h" | 62 #include "command_buffer/common/cross/cmd_buffer_common.h" |
| 63 #include "command_buffer/common/cross/resource.h" | 63 #include "command_buffer/common/cross/resource.h" |
| 64 | 64 |
| 65 namespace o3d { | 65 namespace o3d { |
| 66 namespace command_buffer { | 66 namespace command_buffer { |
| 67 namespace o3d { |
| 67 | 68 |
| 68 // This macro is used to safely and convienently expand the list of commnad | 69 // This macro is used to safely and convienently expand the list of commnad |
| 69 // buffer commands in to various lists and never have them get out of sync. To | 70 // buffer commands in to various lists and never have them get out of sync. To |
| 70 // add a new command, add it this list, create the corresponding structure below | 71 // add a new command, add it this list, create the corresponding structure below |
| 71 // and then add a function in gapi_decoder.cc called Handle_COMMAND_NAME where | 72 // and then add a function in gapi_decoder.cc called Handle_COMMAND_NAME where |
| 72 // COMMAND_NAME is the name of your command structure. | 73 // COMMAND_NAME is the name of your command structure. |
| 73 // | 74 // |
| 74 // NOTE: THE ORDER OF THESE MUST NOT CHANGE (their id is derived by order) | 75 // NOTE: THE ORDER OF THESE MUST NOT CHANGE (their id is derived by order) |
| 75 #define O3D_COMMAND_BUFFER_CMDS(OP) \ | 76 #define O3D_COMMAND_BUFFER_CMDS(OP) \ |
| 76 OP(Noop) /* 1024 */ \ | 77 OP(Noop) /* 1024 */ \ |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 kBlendFuncDstAlpha, | 234 kBlendFuncDstAlpha, |
| 234 kBlendFuncInvDstAlpha, | 235 kBlendFuncInvDstAlpha, |
| 235 kBlendFuncDstColor, | 236 kBlendFuncDstColor, |
| 236 kBlendFuncInvDstColor, | 237 kBlendFuncInvDstColor, |
| 237 kBlendFuncSrcAlphaSaturate, | 238 kBlendFuncSrcAlphaSaturate, |
| 238 kBlendFuncBlendColor, | 239 kBlendFuncBlendColor, |
| 239 kBlendFuncInvBlendColor, | 240 kBlendFuncInvBlendColor, |
| 240 kNumBlendFunc | 241 kNumBlendFunc |
| 241 }; | 242 }; |
| 242 | 243 |
| 243 namespace cmd { | |
| 244 | |
| 245 const char* GetCommandName(CommandId id); | 244 const char* GetCommandName(CommandId id); |
| 246 | 245 |
| 247 // Make sure the compiler does not add extra padding to any of the command | 246 // Make sure the compiler does not add extra padding to any of the command |
| 248 // structures. | 247 // structures. |
| 249 O3D_PUSH_STRUCTURE_PACKING_1; | 248 O3D_PUSH_STRUCTURE_PACKING_1; |
| 250 | 249 |
| 251 struct Noop { | 250 struct Noop { |
| 252 typedef Noop ValueType; | 251 typedef Noop ValueType; |
| 253 static const CommandId kCmdId = command_buffer::kNoop; | 252 static const CommandId kCmdId = kNoop; |
| 254 static const ArgFlags kArgFlags = kAtLeastN; | 253 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 255 | 254 |
| 256 void SetHeader(uint32 skip_count) { | 255 void SetHeader(uint32 skip_count) { |
| 257 header.Init(kCmdId, skip_count + 1); | 256 header.Init(kCmdId, skip_count + 1); |
| 258 } | 257 } |
| 259 | 258 |
| 260 void Init(uint32 skip_count) { | 259 void Init(uint32 skip_count) { |
| 261 SetHeader(skip_count); | 260 SetHeader(skip_count); |
| 262 } | 261 } |
| 263 | 262 |
| 264 static void* Set(void* cmd, uint32 skip_count) { | 263 static void* Set(void* cmd, uint32 skip_count) { |
| 265 static_cast<ValueType*>(cmd)->Init(skip_count); | 264 static_cast<ValueType*>(cmd)->Init(skip_count); |
| 266 return NextImmediateCmdAddress<ValueType>( | 265 return NextImmediateCmdAddress<ValueType>( |
| 267 cmd, skip_count * sizeof(CommandBufferEntry)); // NOLINT | 266 cmd, skip_count * sizeof(CommandBufferEntry)); // NOLINT |
| 268 } | 267 } |
| 269 | 268 |
| 270 CommandHeader header; | 269 CommandHeader header; |
| 271 }; | 270 }; |
| 272 | 271 |
| 273 COMPILE_ASSERT(sizeof(Noop) == 4, Sizeof_Noop_is_not_4); | 272 COMPILE_ASSERT(sizeof(Noop) == 4, Sizeof_Noop_is_not_4); |
| 274 COMPILE_ASSERT(offsetof(Noop, header) == 0, Offsetof_Noop_header_not_0); | 273 COMPILE_ASSERT(offsetof(Noop, header) == 0, Offsetof_Noop_header_not_0); |
| 275 | 274 |
| 276 struct SetToken { | 275 struct SetToken { |
| 277 typedef SetToken ValueType; | 276 typedef SetToken ValueType; |
| 278 static const CommandId kCmdId = command_buffer::kSetToken; | 277 static const CommandId kCmdId = kSetToken; |
| 279 static const ArgFlags kArgFlags = kFixed; | 278 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 280 | 279 |
| 281 void SetHeader() { | 280 void SetHeader() { |
| 282 header.SetCmd<ValueType>(); | 281 header.SetCmd<ValueType>(); |
| 283 } | 282 } |
| 284 | 283 |
| 285 void Init(uint32 _token) { | 284 void Init(uint32 _token) { |
| 286 SetHeader(); | 285 SetHeader(); |
| 287 token = _token; | 286 token = _token; |
| 288 } | 287 } |
| 289 static void* Set(void* cmd, uint32 token) { | 288 static void* Set(void* cmd, uint32 token) { |
| 290 static_cast<ValueType*>(cmd)->Init(token); | 289 static_cast<ValueType*>(cmd)->Init(token); |
| 291 return NextCmdAddress<ValueType>(cmd); | 290 return NextCmdAddress<ValueType>(cmd); |
| 292 } | 291 } |
| 293 | 292 |
| 294 CommandHeader header; | 293 CommandHeader header; |
| 295 uint32 token; | 294 uint32 token; |
| 296 }; | 295 }; |
| 297 | 296 |
| 298 COMPILE_ASSERT(sizeof(SetToken) == 8, Sizeof_SetToken_is_not_8); | 297 COMPILE_ASSERT(sizeof(SetToken) == 8, Sizeof_SetToken_is_not_8); |
| 299 COMPILE_ASSERT(offsetof(SetToken, header) == 0, | 298 COMPILE_ASSERT(offsetof(SetToken, header) == 0, |
| 300 Offsetof_SetToken_header_not_0); | 299 Offsetof_SetToken_header_not_0); |
| 301 COMPILE_ASSERT(offsetof(SetToken, token) == 4, | 300 COMPILE_ASSERT(offsetof(SetToken, token) == 4, |
| 302 Offsetof_SetToken_token_not_4); | 301 Offsetof_SetToken_token_not_4); |
| 303 | 302 |
| 304 struct BeginFrame { | 303 struct BeginFrame { |
| 305 typedef BeginFrame ValueType; | 304 typedef BeginFrame ValueType; |
| 306 static const CommandId kCmdId = command_buffer::kBeginFrame; | 305 static const CommandId kCmdId = kBeginFrame; |
| 307 static const ArgFlags kArgFlags = kFixed; | 306 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 308 | 307 |
| 309 void SetHeader() { | 308 void SetHeader() { |
| 310 header.SetCmd<ValueType>(); | 309 header.SetCmd<ValueType>(); |
| 311 } | 310 } |
| 312 | 311 |
| 313 void Init() { | 312 void Init() { |
| 314 SetHeader(); | 313 SetHeader(); |
| 315 } | 314 } |
| 316 static void* Set(void* cmd) { | 315 static void* Set(void* cmd) { |
| 317 static_cast<ValueType*>(cmd)->Init(); | 316 static_cast<ValueType*>(cmd)->Init(); |
| 318 return NextCmdAddress<ValueType>(cmd); | 317 return NextCmdAddress<ValueType>(cmd); |
| 319 } | 318 } |
| 320 | 319 |
| 321 CommandHeader header; | 320 CommandHeader header; |
| 322 }; | 321 }; |
| 323 | 322 |
| 324 COMPILE_ASSERT(sizeof(BeginFrame) == 4, Sizeof_BeginFrame_is_not_4); | 323 COMPILE_ASSERT(sizeof(BeginFrame) == 4, Sizeof_BeginFrame_is_not_4); |
| 325 COMPILE_ASSERT(offsetof(BeginFrame, header) == 0, | 324 COMPILE_ASSERT(offsetof(BeginFrame, header) == 0, |
| 326 OffsetOf_BeginFrame_header_not_0); | 325 OffsetOf_BeginFrame_header_not_0); |
| 327 | 326 |
| 328 struct EndFrame { | 327 struct EndFrame { |
| 329 typedef EndFrame ValueType; | 328 typedef EndFrame ValueType; |
| 330 static const CommandId kCmdId = command_buffer::kEndFrame; | 329 static const CommandId kCmdId = kEndFrame; |
| 331 static const ArgFlags kArgFlags = kFixed; | 330 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 332 | 331 |
| 333 void SetHeader() { | 332 void SetHeader() { |
| 334 header.SetCmd<ValueType>(); | 333 header.SetCmd<ValueType>(); |
| 335 } | 334 } |
| 336 | 335 |
| 337 void Init() { | 336 void Init() { |
| 338 SetHeader(); | 337 SetHeader(); |
| 339 } | 338 } |
| 340 static void* Set(void* cmd) { | 339 static void* Set(void* cmd) { |
| 341 static_cast<ValueType*>(cmd)->Init(); | 340 static_cast<ValueType*>(cmd)->Init(); |
| 342 return NextCmdAddress<ValueType>(cmd); | 341 return NextCmdAddress<ValueType>(cmd); |
| 343 } | 342 } |
| 344 | 343 |
| 345 CommandHeader header; | 344 CommandHeader header; |
| 346 }; | 345 }; |
| 347 | 346 |
| 348 COMPILE_ASSERT(sizeof(EndFrame) == 4, Sizeof_EndFrame_is_not_4); | 347 COMPILE_ASSERT(sizeof(EndFrame) == 4, Sizeof_EndFrame_is_not_4); |
| 349 COMPILE_ASSERT(offsetof(EndFrame, header) == 0, | 348 COMPILE_ASSERT(offsetof(EndFrame, header) == 0, |
| 350 OffsetOf_EndFrame_header_not_0); | 349 OffsetOf_EndFrame_header_not_0); |
| 351 | 350 |
| 352 struct Clear { | 351 struct Clear { |
| 353 typedef Clear ValueType; | 352 typedef Clear ValueType; |
| 354 static const CommandId kCmdId = command_buffer::kClear; | 353 static const CommandId kCmdId = kClear; |
| 355 static const ArgFlags kArgFlags = kFixed; | 354 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 356 | 355 |
| 357 void SetHeader() { | 356 void SetHeader() { |
| 358 header.SetCmd<ValueType>(); | 357 header.SetCmd<ValueType>(); |
| 359 } | 358 } |
| 360 | 359 |
| 361 void Init(uint32 _buffers, float _red, float _green, float _blue, | 360 void Init(uint32 _buffers, float _red, float _green, float _blue, |
| 362 float _alpha, float _depth, uint32 _stencil) { | 361 float _alpha, float _depth, uint32 _stencil) { |
| 363 SetHeader(); | 362 SetHeader(); |
| 364 buffers = _buffers; | 363 buffers = _buffers; |
| 365 red = _red; | 364 red = _red; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 OffsetOf_Clear_blue_not_16); | 401 OffsetOf_Clear_blue_not_16); |
| 403 COMPILE_ASSERT(offsetof(Clear, alpha) == 20, | 402 COMPILE_ASSERT(offsetof(Clear, alpha) == 20, |
| 404 OffsetOf_Clear_alpha_not_20); | 403 OffsetOf_Clear_alpha_not_20); |
| 405 COMPILE_ASSERT(offsetof(Clear, depth) == 24, | 404 COMPILE_ASSERT(offsetof(Clear, depth) == 24, |
| 406 OffsetOf_Clear_depth_not_24); | 405 OffsetOf_Clear_depth_not_24); |
| 407 COMPILE_ASSERT(offsetof(Clear, stencil) == 28, | 406 COMPILE_ASSERT(offsetof(Clear, stencil) == 28, |
| 408 OffsetOf_Clear_stencil_not_28); | 407 OffsetOf_Clear_stencil_not_28); |
| 409 | 408 |
| 410 struct SetViewport { | 409 struct SetViewport { |
| 411 typedef SetViewport ValueType; | 410 typedef SetViewport ValueType; |
| 412 static const CommandId kCmdId = command_buffer::kSetViewport; | 411 static const CommandId kCmdId = kSetViewport; |
| 413 static const ArgFlags kArgFlags = kFixed; | 412 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 414 | 413 |
| 415 void SetHeader() { | 414 void SetHeader() { |
| 416 header.SetCmd<ValueType>(); | 415 header.SetCmd<ValueType>(); |
| 417 } | 416 } |
| 418 | 417 |
| 419 void Init( | 418 void Init( |
| 420 uint32 _left, | 419 uint32 _left, |
| 421 uint32 _top, | 420 uint32 _top, |
| 422 uint32 _width, | 421 uint32 _width, |
| 423 uint32 _height, | 422 uint32 _height, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 OffsetOf_SetViewport_width_not_12); | 468 OffsetOf_SetViewport_width_not_12); |
| 470 COMPILE_ASSERT(offsetof(SetViewport, height) == 16, | 469 COMPILE_ASSERT(offsetof(SetViewport, height) == 16, |
| 471 OffsetOf_SetViewport_height_not_16); | 470 OffsetOf_SetViewport_height_not_16); |
| 472 COMPILE_ASSERT(offsetof(SetViewport, z_min) == 20, | 471 COMPILE_ASSERT(offsetof(SetViewport, z_min) == 20, |
| 473 OffsetOf_SetViewport_z_min_not_20); | 472 OffsetOf_SetViewport_z_min_not_20); |
| 474 COMPILE_ASSERT(offsetof(SetViewport, z_max) == 24, | 473 COMPILE_ASSERT(offsetof(SetViewport, z_max) == 24, |
| 475 OffsetOf_SetViewport_z_max_not_24); | 474 OffsetOf_SetViewport_z_max_not_24); |
| 476 | 475 |
| 477 struct CreateVertexBuffer { | 476 struct CreateVertexBuffer { |
| 478 typedef CreateVertexBuffer ValueType; | 477 typedef CreateVertexBuffer ValueType; |
| 479 static const CommandId kCmdId = command_buffer::kCreateVertexBuffer; | 478 static const CommandId kCmdId = kCreateVertexBuffer; |
| 480 static const ArgFlags kArgFlags = kFixed; | 479 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 481 | 480 |
| 482 void SetHeader() { | 481 void SetHeader() { |
| 483 header.SetCmd<ValueType>(); | 482 header.SetCmd<ValueType>(); |
| 484 } | 483 } |
| 485 | 484 |
| 486 void Init(ResourceId _vertex_buffer_id, uint32 _size, | 485 void Init(ResourceId _vertex_buffer_id, uint32 _size, |
| 487 vertex_buffer::Flags _flags) { | 486 vertex_buffer::Flags _flags) { |
| 488 SetHeader(); | 487 SetHeader(); |
| 489 vertex_buffer_id = _vertex_buffer_id; | 488 vertex_buffer_id = _vertex_buffer_id; |
| 490 size = _size; | 489 size = _size; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 509 OffsetOf_CreateVertexBuffer_header_not_0); | 508 OffsetOf_CreateVertexBuffer_header_not_0); |
| 510 COMPILE_ASSERT(offsetof(CreateVertexBuffer, vertex_buffer_id) == 4, | 509 COMPILE_ASSERT(offsetof(CreateVertexBuffer, vertex_buffer_id) == 4, |
| 511 OffsetOf_CreateVertexBuffer_vertex_buffer_id_not_4); | 510 OffsetOf_CreateVertexBuffer_vertex_buffer_id_not_4); |
| 512 COMPILE_ASSERT(offsetof(CreateVertexBuffer, size) == 8, | 511 COMPILE_ASSERT(offsetof(CreateVertexBuffer, size) == 8, |
| 513 OffsetOf_CreateVertexBuffer_size_not_8); | 512 OffsetOf_CreateVertexBuffer_size_not_8); |
| 514 COMPILE_ASSERT(offsetof(CreateVertexBuffer, flags) == 12, | 513 COMPILE_ASSERT(offsetof(CreateVertexBuffer, flags) == 12, |
| 515 OffsetOf_CreateVertexBuffer_flags_not_12); | 514 OffsetOf_CreateVertexBuffer_flags_not_12); |
| 516 | 515 |
| 517 struct DestroyVertexBuffer { | 516 struct DestroyVertexBuffer { |
| 518 typedef DestroyVertexBuffer ValueType; | 517 typedef DestroyVertexBuffer ValueType; |
| 519 static const CommandId kCmdId = command_buffer::kDestroyVertexBuffer; | 518 static const CommandId kCmdId = kDestroyVertexBuffer; |
| 520 static const ArgFlags kArgFlags = kFixed; | 519 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 521 | 520 |
| 522 void SetHeader() { | 521 void SetHeader() { |
| 523 header.SetCmd<ValueType>(); | 522 header.SetCmd<ValueType>(); |
| 524 } | 523 } |
| 525 | 524 |
| 526 void Init(ResourceId _vertex_buffer_id) { | 525 void Init(ResourceId _vertex_buffer_id) { |
| 527 SetHeader(); | 526 SetHeader(); |
| 528 vertex_buffer_id = _vertex_buffer_id; | 527 vertex_buffer_id = _vertex_buffer_id; |
| 529 } | 528 } |
| 530 | 529 |
| 531 static void* Set(void* cmd, ResourceId vertex_buffer_id) { | 530 static void* Set(void* cmd, ResourceId vertex_buffer_id) { |
| 532 static_cast<ValueType*>(cmd)->Init(vertex_buffer_id); | 531 static_cast<ValueType*>(cmd)->Init(vertex_buffer_id); |
| 533 return NextCmdAddress<ValueType>(cmd); | 532 return NextCmdAddress<ValueType>(cmd); |
| 534 } | 533 } |
| 535 | 534 |
| 536 CommandHeader header; | 535 CommandHeader header; |
| 537 ResourceId vertex_buffer_id; | 536 ResourceId vertex_buffer_id; |
| 538 }; | 537 }; |
| 539 | 538 |
| 540 COMPILE_ASSERT(sizeof(DestroyVertexBuffer) == 8, | 539 COMPILE_ASSERT(sizeof(DestroyVertexBuffer) == 8, |
| 541 Sizeof_DestroyVertexBuffer_is_not_8); | 540 Sizeof_DestroyVertexBuffer_is_not_8); |
| 542 COMPILE_ASSERT(offsetof(DestroyVertexBuffer, header) == 0, | 541 COMPILE_ASSERT(offsetof(DestroyVertexBuffer, header) == 0, |
| 543 OffsetOf_DestroyVertexBuffer_header_not_0); | 542 OffsetOf_DestroyVertexBuffer_header_not_0); |
| 544 COMPILE_ASSERT(offsetof(DestroyVertexBuffer, vertex_buffer_id) == 4, | 543 COMPILE_ASSERT(offsetof(DestroyVertexBuffer, vertex_buffer_id) == 4, |
| 545 OffsetOf_DestroyVertexBuffer_vertex_buffer_id_not_4); | 544 OffsetOf_DestroyVertexBuffer_vertex_buffer_id_not_4); |
| 546 | 545 |
| 547 struct SetVertexBufferDataImmediate { | 546 struct SetVertexBufferDataImmediate { |
| 548 typedef SetVertexBufferDataImmediate ValueType; | 547 typedef SetVertexBufferDataImmediate ValueType; |
| 549 static const CommandId kCmdId = command_buffer::kSetVertexBufferDataImmediate; | 548 static const CommandId kCmdId = kSetVertexBufferDataImmediate; |
| 550 static const ArgFlags kArgFlags = kAtLeastN; | 549 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 551 | 550 |
| 552 void SetHeader(uint32 size) { | 551 void SetHeader(uint32 size) { |
| 553 header.SetCmdBySize<ValueType>(size); | 552 header.SetCmdBySize<ValueType>(size); |
| 554 } | 553 } |
| 555 | 554 |
| 556 void Init(ResourceId _vertex_buffer_id, uint32 _offset, | 555 void Init(ResourceId _vertex_buffer_id, uint32 _offset, |
| 557 const void* data, uint32 size) { | 556 const void* data, uint32 size) { |
| 558 SetHeader(size); | 557 SetHeader(size); |
| 559 vertex_buffer_id = _vertex_buffer_id; | 558 vertex_buffer_id = _vertex_buffer_id; |
| 560 offset = _offset; | 559 offset = _offset; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 576 Sizeof_SetVertexBufferDataImmediate_is_not_12); | 575 Sizeof_SetVertexBufferDataImmediate_is_not_12); |
| 577 COMPILE_ASSERT(offsetof(SetVertexBufferDataImmediate, header) == 0, | 576 COMPILE_ASSERT(offsetof(SetVertexBufferDataImmediate, header) == 0, |
| 578 OffsetOf_SetVertexBufferDataImmediate_header_not_0); | 577 OffsetOf_SetVertexBufferDataImmediate_header_not_0); |
| 579 COMPILE_ASSERT(offsetof(SetVertexBufferDataImmediate, vertex_buffer_id) == 4, | 578 COMPILE_ASSERT(offsetof(SetVertexBufferDataImmediate, vertex_buffer_id) == 4, |
| 580 OffsetOf_SetVertexBufferDataImmediate_vertex_buffer_id_not_4); | 579 OffsetOf_SetVertexBufferDataImmediate_vertex_buffer_id_not_4); |
| 581 COMPILE_ASSERT(offsetof(SetVertexBufferDataImmediate, offset) == 8, | 580 COMPILE_ASSERT(offsetof(SetVertexBufferDataImmediate, offset) == 8, |
| 582 OffsetOf_SetVertexBufferDataImmediate_offset_not_8); | 581 OffsetOf_SetVertexBufferDataImmediate_offset_not_8); |
| 583 | 582 |
| 584 struct SetVertexBufferData { | 583 struct SetVertexBufferData { |
| 585 typedef SetVertexBufferData ValueType; | 584 typedef SetVertexBufferData ValueType; |
| 586 static const CommandId kCmdId = command_buffer::kSetVertexBufferData; | 585 static const CommandId kCmdId = kSetVertexBufferData; |
| 587 static const ArgFlags kArgFlags = kFixed; | 586 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 588 | 587 |
| 589 void SetHeader() { | 588 void SetHeader() { |
| 590 header.SetCmd<ValueType>(); | 589 header.SetCmd<ValueType>(); |
| 591 } | 590 } |
| 592 | 591 |
| 593 void Init(ResourceId _vertex_buffer_id, uint32 _offset, uint32 _size, | 592 void Init(ResourceId _vertex_buffer_id, uint32 _offset, uint32 _size, |
| 594 uint32 shared_memory_id, uint32 shared_memory_offset) { | 593 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 595 SetHeader(); | 594 SetHeader(); |
| 596 vertex_buffer_id = _vertex_buffer_id; | 595 vertex_buffer_id = _vertex_buffer_id; |
| 597 offset = _offset; | 596 offset = _offset; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 622 OffsetOf_SetVertexBufferData_vertex_buffer_id_not_4); | 621 OffsetOf_SetVertexBufferData_vertex_buffer_id_not_4); |
| 623 COMPILE_ASSERT(offsetof(SetVertexBufferData, offset) == 8, | 622 COMPILE_ASSERT(offsetof(SetVertexBufferData, offset) == 8, |
| 624 OffsetOf_SetVertexBufferData_offset_not_8); | 623 OffsetOf_SetVertexBufferData_offset_not_8); |
| 625 COMPILE_ASSERT(offsetof(SetVertexBufferData, size) == 12, | 624 COMPILE_ASSERT(offsetof(SetVertexBufferData, size) == 12, |
| 626 OffsetOf_SetVertexBufferData_size_not_12); | 625 OffsetOf_SetVertexBufferData_size_not_12); |
| 627 COMPILE_ASSERT(offsetof(SetVertexBufferData, shared_memory) == 16, | 626 COMPILE_ASSERT(offsetof(SetVertexBufferData, shared_memory) == 16, |
| 628 OffsetOf_SetVertexBufferData_shared_memory_not_16); | 627 OffsetOf_SetVertexBufferData_shared_memory_not_16); |
| 629 | 628 |
| 630 struct GetVertexBufferData { | 629 struct GetVertexBufferData { |
| 631 typedef GetVertexBufferData ValueType; | 630 typedef GetVertexBufferData ValueType; |
| 632 static const CommandId kCmdId = command_buffer::kGetVertexBufferData; | 631 static const CommandId kCmdId = kGetVertexBufferData; |
| 633 static const ArgFlags kArgFlags = kFixed; | 632 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 634 | 633 |
| 635 void SetHeader() { | 634 void SetHeader() { |
| 636 header.SetCmd<ValueType>(); | 635 header.SetCmd<ValueType>(); |
| 637 } | 636 } |
| 638 | 637 |
| 639 void Init(ResourceId _vertex_buffer_id, uint32 _offset, uint32 _size, | 638 void Init(ResourceId _vertex_buffer_id, uint32 _offset, uint32 _size, |
| 640 uint32 shared_memory_id, uint32 shared_memory_offset) { | 639 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 641 SetHeader(); | 640 SetHeader(); |
| 642 vertex_buffer_id = _vertex_buffer_id; | 641 vertex_buffer_id = _vertex_buffer_id; |
| 643 offset = _offset; | 642 offset = _offset; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 668 OffsetOf_GetVertexBufferData_vertex_buffer_id_not_4); | 667 OffsetOf_GetVertexBufferData_vertex_buffer_id_not_4); |
| 669 COMPILE_ASSERT(offsetof(GetVertexBufferData, offset) == 8, | 668 COMPILE_ASSERT(offsetof(GetVertexBufferData, offset) == 8, |
| 670 OffsetOf_GetVertexBufferData_offset_not_8); | 669 OffsetOf_GetVertexBufferData_offset_not_8); |
| 671 COMPILE_ASSERT(offsetof(GetVertexBufferData, size) == 12, | 670 COMPILE_ASSERT(offsetof(GetVertexBufferData, size) == 12, |
| 672 OffsetOf_GetVertexBufferData_size_not_12); | 671 OffsetOf_GetVertexBufferData_size_not_12); |
| 673 COMPILE_ASSERT(offsetof(GetVertexBufferData, shared_memory) == 16, | 672 COMPILE_ASSERT(offsetof(GetVertexBufferData, shared_memory) == 16, |
| 674 OffsetOf_GetVertexBufferData_shared_memory_not_16); | 673 OffsetOf_GetVertexBufferData_shared_memory_not_16); |
| 675 | 674 |
| 676 struct CreateIndexBuffer { | 675 struct CreateIndexBuffer { |
| 677 typedef CreateIndexBuffer ValueType; | 676 typedef CreateIndexBuffer ValueType; |
| 678 static const CommandId kCmdId = command_buffer::kCreateIndexBuffer; | 677 static const CommandId kCmdId = kCreateIndexBuffer; |
| 679 static const ArgFlags kArgFlags = kFixed; | 678 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 680 | 679 |
| 681 void SetHeader() { | 680 void SetHeader() { |
| 682 header.SetCmd<ValueType>(); | 681 header.SetCmd<ValueType>(); |
| 683 } | 682 } |
| 684 | 683 |
| 685 void Init(ResourceId _index_buffer_id, uint32 _size, | 684 void Init(ResourceId _index_buffer_id, uint32 _size, |
| 686 index_buffer::Flags _flags) { | 685 index_buffer::Flags _flags) { |
| 687 SetHeader(); | 686 SetHeader(); |
| 688 index_buffer_id = _index_buffer_id; | 687 index_buffer_id = _index_buffer_id; |
| 689 size = _size; | 688 size = _size; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 708 OffsetOf_CreateIndexBuffer_header_not_0); | 707 OffsetOf_CreateIndexBuffer_header_not_0); |
| 709 COMPILE_ASSERT(offsetof(CreateIndexBuffer, index_buffer_id) == 4, | 708 COMPILE_ASSERT(offsetof(CreateIndexBuffer, index_buffer_id) == 4, |
| 710 OffsetOf_CreateIndexBuffer_index_buffer_id_not_4); | 709 OffsetOf_CreateIndexBuffer_index_buffer_id_not_4); |
| 711 COMPILE_ASSERT(offsetof(CreateIndexBuffer, size) == 8, | 710 COMPILE_ASSERT(offsetof(CreateIndexBuffer, size) == 8, |
| 712 OffsetOf_CreateIndexBuffer_size_not_8); | 711 OffsetOf_CreateIndexBuffer_size_not_8); |
| 713 COMPILE_ASSERT(offsetof(CreateIndexBuffer, flags) == 12, | 712 COMPILE_ASSERT(offsetof(CreateIndexBuffer, flags) == 12, |
| 714 OffsetOf_CreateIndexBuffer_flags_not_12); | 713 OffsetOf_CreateIndexBuffer_flags_not_12); |
| 715 | 714 |
| 716 struct DestroyIndexBuffer { | 715 struct DestroyIndexBuffer { |
| 717 typedef DestroyIndexBuffer ValueType; | 716 typedef DestroyIndexBuffer ValueType; |
| 718 static const CommandId kCmdId = command_buffer::kDestroyIndexBuffer; | 717 static const CommandId kCmdId = kDestroyIndexBuffer; |
| 719 static const ArgFlags kArgFlags = kFixed; | 718 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 720 | 719 |
| 721 void SetHeader() { | 720 void SetHeader() { |
| 722 header.SetCmd<ValueType>(); | 721 header.SetCmd<ValueType>(); |
| 723 } | 722 } |
| 724 | 723 |
| 725 void Init(ResourceId _index_buffer_id) { | 724 void Init(ResourceId _index_buffer_id) { |
| 726 SetHeader(); | 725 SetHeader(); |
| 727 index_buffer_id = _index_buffer_id; | 726 index_buffer_id = _index_buffer_id; |
| 728 } | 727 } |
| 729 | 728 |
| 730 static void* Set(void* cmd, ResourceId index_buffer_id) { | 729 static void* Set(void* cmd, ResourceId index_buffer_id) { |
| 731 static_cast<ValueType*>(cmd)->Init(index_buffer_id); | 730 static_cast<ValueType*>(cmd)->Init(index_buffer_id); |
| 732 return NextCmdAddress<ValueType>(cmd); | 731 return NextCmdAddress<ValueType>(cmd); |
| 733 } | 732 } |
| 734 | 733 |
| 735 CommandHeader header; | 734 CommandHeader header; |
| 736 ResourceId index_buffer_id; | 735 ResourceId index_buffer_id; |
| 737 }; | 736 }; |
| 738 | 737 |
| 739 COMPILE_ASSERT(sizeof(DestroyIndexBuffer) == 8, | 738 COMPILE_ASSERT(sizeof(DestroyIndexBuffer) == 8, |
| 740 Sizeof_DestroyIndexBuffer_is_not_8); | 739 Sizeof_DestroyIndexBuffer_is_not_8); |
| 741 COMPILE_ASSERT(offsetof(DestroyIndexBuffer, header) == 0, | 740 COMPILE_ASSERT(offsetof(DestroyIndexBuffer, header) == 0, |
| 742 OffsetOf_DestroyIndexBuffer_header_not_0); | 741 OffsetOf_DestroyIndexBuffer_header_not_0); |
| 743 COMPILE_ASSERT(offsetof(DestroyIndexBuffer, index_buffer_id) == 4, | 742 COMPILE_ASSERT(offsetof(DestroyIndexBuffer, index_buffer_id) == 4, |
| 744 OffsetOf_DestroyIndexBuffer_index_buffer_id_not_4); | 743 OffsetOf_DestroyIndexBuffer_index_buffer_id_not_4); |
| 745 | 744 |
| 746 struct SetIndexBufferDataImmediate { | 745 struct SetIndexBufferDataImmediate { |
| 747 typedef SetIndexBufferDataImmediate ValueType; | 746 typedef SetIndexBufferDataImmediate ValueType; |
| 748 static const CommandId kCmdId = command_buffer::kSetIndexBufferDataImmediate; | 747 static const CommandId kCmdId = kSetIndexBufferDataImmediate; |
| 749 static const ArgFlags kArgFlags = kAtLeastN; | 748 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 750 | 749 |
| 751 void SetHeader(uint32 size) { | 750 void SetHeader(uint32 size) { |
| 752 header.SetCmdBySize<ValueType>(size); | 751 header.SetCmdBySize<ValueType>(size); |
| 753 } | 752 } |
| 754 | 753 |
| 755 void Init(ResourceId _index_buffer_id, uint32 _offset, | 754 void Init(ResourceId _index_buffer_id, uint32 _offset, |
| 756 const void* data, uint32 size) { | 755 const void* data, uint32 size) { |
| 757 SetHeader(size); | 756 SetHeader(size); |
| 758 index_buffer_id = _index_buffer_id; | 757 index_buffer_id = _index_buffer_id; |
| 759 offset = _offset; | 758 offset = _offset; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 775 Sizeof_SetIndexBufferDataImmediate_is_not_12); | 774 Sizeof_SetIndexBufferDataImmediate_is_not_12); |
| 776 COMPILE_ASSERT(offsetof(SetIndexBufferDataImmediate, header) == 0, | 775 COMPILE_ASSERT(offsetof(SetIndexBufferDataImmediate, header) == 0, |
| 777 OffsetOf_SetIndexBufferDataImmediate_header_not_0); | 776 OffsetOf_SetIndexBufferDataImmediate_header_not_0); |
| 778 COMPILE_ASSERT(offsetof(SetIndexBufferDataImmediate, index_buffer_id) == 4, | 777 COMPILE_ASSERT(offsetof(SetIndexBufferDataImmediate, index_buffer_id) == 4, |
| 779 OffsetOf_SetIndexBufferDataImmediate_index_buffer_id_not_4); | 778 OffsetOf_SetIndexBufferDataImmediate_index_buffer_id_not_4); |
| 780 COMPILE_ASSERT(offsetof(SetIndexBufferDataImmediate, offset) == 8, | 779 COMPILE_ASSERT(offsetof(SetIndexBufferDataImmediate, offset) == 8, |
| 781 OffsetOf_SetIndexBufferDataImmediate_offset_not_8); | 780 OffsetOf_SetIndexBufferDataImmediate_offset_not_8); |
| 782 | 781 |
| 783 struct SetIndexBufferData { | 782 struct SetIndexBufferData { |
| 784 typedef SetIndexBufferData ValueType; | 783 typedef SetIndexBufferData ValueType; |
| 785 static const CommandId kCmdId = command_buffer::kSetIndexBufferData; | 784 static const CommandId kCmdId = kSetIndexBufferData; |
| 786 static const ArgFlags kArgFlags = kFixed; | 785 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 787 | 786 |
| 788 void SetHeader() { | 787 void SetHeader() { |
| 789 header.SetCmd<ValueType>(); | 788 header.SetCmd<ValueType>(); |
| 790 } | 789 } |
| 791 | 790 |
| 792 void Init(ResourceId _index_buffer_id, uint32 _offset, uint32 _size, | 791 void Init(ResourceId _index_buffer_id, uint32 _offset, uint32 _size, |
| 793 uint32 shared_memory_id, uint32 shared_memory_offset) { | 792 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 794 SetHeader(); | 793 SetHeader(); |
| 795 index_buffer_id = _index_buffer_id; | 794 index_buffer_id = _index_buffer_id; |
| 796 offset = _offset; | 795 offset = _offset; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 821 OffsetOf_SetIndexBufferData_index_buffer_id_not_4); | 820 OffsetOf_SetIndexBufferData_index_buffer_id_not_4); |
| 822 COMPILE_ASSERT(offsetof(SetIndexBufferData, offset) == 8, | 821 COMPILE_ASSERT(offsetof(SetIndexBufferData, offset) == 8, |
| 823 OffsetOf_SetIndexBufferData_offset_not_8); | 822 OffsetOf_SetIndexBufferData_offset_not_8); |
| 824 COMPILE_ASSERT(offsetof(SetIndexBufferData, size) == 12, | 823 COMPILE_ASSERT(offsetof(SetIndexBufferData, size) == 12, |
| 825 OffsetOf_SetIndexBufferData_size_not_12); | 824 OffsetOf_SetIndexBufferData_size_not_12); |
| 826 COMPILE_ASSERT(offsetof(SetIndexBufferData, shared_memory) == 16, | 825 COMPILE_ASSERT(offsetof(SetIndexBufferData, shared_memory) == 16, |
| 827 OffsetOf_SetIndexBufferData_shared_memory_not_16); | 826 OffsetOf_SetIndexBufferData_shared_memory_not_16); |
| 828 | 827 |
| 829 struct GetIndexBufferData { | 828 struct GetIndexBufferData { |
| 830 typedef GetIndexBufferData ValueType; | 829 typedef GetIndexBufferData ValueType; |
| 831 static const CommandId kCmdId = command_buffer::kGetIndexBufferData; | 830 static const CommandId kCmdId = kGetIndexBufferData; |
| 832 static const ArgFlags kArgFlags = kFixed; | 831 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 833 | 832 |
| 834 void SetHeader() { | 833 void SetHeader() { |
| 835 header.SetCmd<ValueType>(); | 834 header.SetCmd<ValueType>(); |
| 836 } | 835 } |
| 837 | 836 |
| 838 void Init(ResourceId _index_buffer_id, uint32 _offset, uint32 _size, | 837 void Init(ResourceId _index_buffer_id, uint32 _offset, uint32 _size, |
| 839 uint32 shared_memory_id, uint32 shared_memory_offset) { | 838 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 840 SetHeader(); | 839 SetHeader(); |
| 841 index_buffer_id = _index_buffer_id; | 840 index_buffer_id = _index_buffer_id; |
| 842 offset = _offset; | 841 offset = _offset; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 867 OffsetOf_GetIndexBufferData_index_buffer_id_not_4); | 866 OffsetOf_GetIndexBufferData_index_buffer_id_not_4); |
| 868 COMPILE_ASSERT(offsetof(GetIndexBufferData, offset) == 8, | 867 COMPILE_ASSERT(offsetof(GetIndexBufferData, offset) == 8, |
| 869 OffsetOf_GetIndexBufferData_offset_not_8); | 868 OffsetOf_GetIndexBufferData_offset_not_8); |
| 870 COMPILE_ASSERT(offsetof(GetIndexBufferData, size) == 12, | 869 COMPILE_ASSERT(offsetof(GetIndexBufferData, size) == 12, |
| 871 OffsetOf_GetIndexBufferData_size_not_12); | 870 OffsetOf_GetIndexBufferData_size_not_12); |
| 872 COMPILE_ASSERT(offsetof(GetIndexBufferData, shared_memory) == 16, | 871 COMPILE_ASSERT(offsetof(GetIndexBufferData, shared_memory) == 16, |
| 873 OffsetOf_GetIndexBufferData_shared_memory_not_16); | 872 OffsetOf_GetIndexBufferData_shared_memory_not_16); |
| 874 | 873 |
| 875 struct CreateVertexStruct { | 874 struct CreateVertexStruct { |
| 876 typedef CreateVertexStruct ValueType; | 875 typedef CreateVertexStruct ValueType; |
| 877 static const CommandId kCmdId = command_buffer::kCreateVertexStruct; | 876 static const CommandId kCmdId = kCreateVertexStruct; |
| 878 static const ArgFlags kArgFlags = kFixed; | 877 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 879 | 878 |
| 880 void SetHeader() { | 879 void SetHeader() { |
| 881 header.SetCmd<ValueType>(); | 880 header.SetCmd<ValueType>(); |
| 882 } | 881 } |
| 883 | 882 |
| 884 void Init(ResourceId _vertex_struct_id, uint32 _input_count) { | 883 void Init(ResourceId _vertex_struct_id, uint32 _input_count) { |
| 885 SetHeader(); | 884 SetHeader(); |
| 886 vertex_struct_id = _vertex_struct_id; | 885 vertex_struct_id = _vertex_struct_id; |
| 887 input_count = _input_count; | 886 input_count = _input_count; |
| 888 } | 887 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 901 Sizeof_CreateVertexStruct_is_not_12); | 900 Sizeof_CreateVertexStruct_is_not_12); |
| 902 COMPILE_ASSERT(offsetof(CreateVertexStruct, header) == 0, | 901 COMPILE_ASSERT(offsetof(CreateVertexStruct, header) == 0, |
| 903 OffsetOf_CreateVertexStruct_header_not_0); | 902 OffsetOf_CreateVertexStruct_header_not_0); |
| 904 COMPILE_ASSERT(offsetof(CreateVertexStruct, vertex_struct_id) == 4, | 903 COMPILE_ASSERT(offsetof(CreateVertexStruct, vertex_struct_id) == 4, |
| 905 OffsetOf_CreateVertexStruct_vertex_struct_id_not_4); | 904 OffsetOf_CreateVertexStruct_vertex_struct_id_not_4); |
| 906 COMPILE_ASSERT(offsetof(CreateVertexStruct, input_count) == 8, | 905 COMPILE_ASSERT(offsetof(CreateVertexStruct, input_count) == 8, |
| 907 OffsetOf_CreateVertexStruct_input_count_not_8); | 906 OffsetOf_CreateVertexStruct_input_count_not_8); |
| 908 | 907 |
| 909 struct DestroyVertexStruct { | 908 struct DestroyVertexStruct { |
| 910 typedef DestroyVertexStruct ValueType; | 909 typedef DestroyVertexStruct ValueType; |
| 911 static const CommandId kCmdId = command_buffer::kDestroyVertexStruct; | 910 static const CommandId kCmdId = kDestroyVertexStruct; |
| 912 static const ArgFlags kArgFlags = kFixed; | 911 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 913 | 912 |
| 914 void SetHeader() { | 913 void SetHeader() { |
| 915 header.SetCmd<ValueType>(); | 914 header.SetCmd<ValueType>(); |
| 916 } | 915 } |
| 917 | 916 |
| 918 void Init(ResourceId _vertex_struct_id) { | 917 void Init(ResourceId _vertex_struct_id) { |
| 919 SetHeader(); | 918 SetHeader(); |
| 920 vertex_struct_id = _vertex_struct_id; | 919 vertex_struct_id = _vertex_struct_id; |
| 921 } | 920 } |
| 922 | 921 |
| 923 static void* Set(void* cmd, ResourceId vertex_struct_id) { | 922 static void* Set(void* cmd, ResourceId vertex_struct_id) { |
| 924 static_cast<ValueType*>(cmd)->Init(vertex_struct_id); | 923 static_cast<ValueType*>(cmd)->Init(vertex_struct_id); |
| 925 return NextCmdAddress<ValueType>(cmd); | 924 return NextCmdAddress<ValueType>(cmd); |
| 926 } | 925 } |
| 927 | 926 |
| 928 CommandHeader header; | 927 CommandHeader header; |
| 929 ResourceId vertex_struct_id; | 928 ResourceId vertex_struct_id; |
| 930 }; | 929 }; |
| 931 | 930 |
| 932 COMPILE_ASSERT(sizeof(DestroyVertexStruct) == 8, | 931 COMPILE_ASSERT(sizeof(DestroyVertexStruct) == 8, |
| 933 Sizeof_DestroyVertexStruct_is_not_8); | 932 Sizeof_DestroyVertexStruct_is_not_8); |
| 934 COMPILE_ASSERT(offsetof(DestroyVertexStruct, header) == 0, | 933 COMPILE_ASSERT(offsetof(DestroyVertexStruct, header) == 0, |
| 935 OffsetOf_DestroyVertexStruct_header_not_0); | 934 OffsetOf_DestroyVertexStruct_header_not_0); |
| 936 COMPILE_ASSERT(offsetof(DestroyVertexStruct, vertex_struct_id) == 4, | 935 COMPILE_ASSERT(offsetof(DestroyVertexStruct, vertex_struct_id) == 4, |
| 937 OffsetOf_DestroyVertexStruct_vertex_struct_id_not_4); | 936 OffsetOf_DestroyVertexStruct_vertex_struct_id_not_4); |
| 938 | 937 |
| 939 struct SetVertexInput { | 938 struct SetVertexInput { |
| 940 typedef SetVertexInput ValueType; | 939 typedef SetVertexInput ValueType; |
| 941 static const CommandId kCmdId = command_buffer::kSetVertexInput; | 940 static const CommandId kCmdId = kSetVertexInput; |
| 942 static const ArgFlags kArgFlags = kFixed; | 941 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 943 | 942 |
| 944 // type_stride_semantic field. | 943 // type_stride_semantic field. |
| 945 typedef BitField<0, 4> SemanticIndex; | 944 typedef BitField<0, 4> SemanticIndex; |
| 946 typedef BitField<4, 4> Semantic; | 945 typedef BitField<4, 4> Semantic; |
| 947 typedef BitField<8, 8> Type; | 946 typedef BitField<8, 8> Type; |
| 948 typedef BitField<16, 16> Stride; | 947 typedef BitField<16, 16> Stride; |
| 949 | 948 |
| 950 void SetHeader() { | 949 void SetHeader() { |
| 951 header.SetCmd<ValueType>(); | 950 header.SetCmd<ValueType>(); |
| 952 } | 951 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 OffsetOf_SetVertexInput_input_index_not_8); | 1010 OffsetOf_SetVertexInput_input_index_not_8); |
| 1012 COMPILE_ASSERT(offsetof(SetVertexInput, vertex_buffer_id) == 12, | 1011 COMPILE_ASSERT(offsetof(SetVertexInput, vertex_buffer_id) == 12, |
| 1013 OffsetOf_SetVertexInput_vertex_buffer_id_not_12); | 1012 OffsetOf_SetVertexInput_vertex_buffer_id_not_12); |
| 1014 COMPILE_ASSERT(offsetof(SetVertexInput, offset) == 16, | 1013 COMPILE_ASSERT(offsetof(SetVertexInput, offset) == 16, |
| 1015 OffsetOf_SetVertexInput_offset_not_16); | 1014 OffsetOf_SetVertexInput_offset_not_16); |
| 1016 COMPILE_ASSERT(offsetof(SetVertexInput, type_stride_semantic) == 20, | 1015 COMPILE_ASSERT(offsetof(SetVertexInput, type_stride_semantic) == 20, |
| 1017 OffsetOf_SetVertexInput_type_stride_semantic_not_20); | 1016 OffsetOf_SetVertexInput_type_stride_semantic_not_20); |
| 1018 | 1017 |
| 1019 struct SetVertexStruct { | 1018 struct SetVertexStruct { |
| 1020 typedef SetVertexStruct ValueType; | 1019 typedef SetVertexStruct ValueType; |
| 1021 static const CommandId kCmdId = command_buffer::kSetVertexStruct; | 1020 static const CommandId kCmdId = kSetVertexStruct; |
| 1022 static const ArgFlags kArgFlags = kFixed; | 1021 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1023 | 1022 |
| 1024 void SetHeader() { | 1023 void SetHeader() { |
| 1025 header.SetCmd<ValueType>(); | 1024 header.SetCmd<ValueType>(); |
| 1026 } | 1025 } |
| 1027 | 1026 |
| 1028 void Init(ResourceId _vertex_struct_id) { | 1027 void Init(ResourceId _vertex_struct_id) { |
| 1029 SetHeader(); | 1028 SetHeader(); |
| 1030 vertex_struct_id = _vertex_struct_id; | 1029 vertex_struct_id = _vertex_struct_id; |
| 1031 } | 1030 } |
| 1032 | 1031 |
| 1033 static void* Set(void* cmd, ResourceId vertex_struct_id) { | 1032 static void* Set(void* cmd, ResourceId vertex_struct_id) { |
| 1034 static_cast<ValueType*>(cmd)->Init(vertex_struct_id); | 1033 static_cast<ValueType*>(cmd)->Init(vertex_struct_id); |
| 1035 return NextCmdAddress<ValueType>(cmd); | 1034 return NextCmdAddress<ValueType>(cmd); |
| 1036 } | 1035 } |
| 1037 | 1036 |
| 1038 CommandHeader header; | 1037 CommandHeader header; |
| 1039 ResourceId vertex_struct_id; | 1038 ResourceId vertex_struct_id; |
| 1040 }; | 1039 }; |
| 1041 | 1040 |
| 1042 COMPILE_ASSERT(sizeof(SetVertexStruct) == 8, | 1041 COMPILE_ASSERT(sizeof(SetVertexStruct) == 8, |
| 1043 Sizeof_SetVertexStruct_is_not_8); | 1042 Sizeof_SetVertexStruct_is_not_8); |
| 1044 COMPILE_ASSERT(offsetof(SetVertexStruct, header) == 0, | 1043 COMPILE_ASSERT(offsetof(SetVertexStruct, header) == 0, |
| 1045 OffsetOf_SetVertexStruct_header_not_0); | 1044 OffsetOf_SetVertexStruct_header_not_0); |
| 1046 COMPILE_ASSERT(offsetof(SetVertexStruct, vertex_struct_id) == 4, | 1045 COMPILE_ASSERT(offsetof(SetVertexStruct, vertex_struct_id) == 4, |
| 1047 OffsetOf_SetVertexStruct_vertex_struct_id_not_4); | 1046 OffsetOf_SetVertexStruct_vertex_struct_id_not_4); |
| 1048 | 1047 |
| 1049 struct Draw { | 1048 struct Draw { |
| 1050 typedef Draw ValueType; | 1049 typedef Draw ValueType; |
| 1051 static const CommandId kCmdId = command_buffer::kDraw; | 1050 static const CommandId kCmdId = kDraw; |
| 1052 static const ArgFlags kArgFlags = kFixed; | 1051 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1053 | 1052 |
| 1054 void SetHeader() { | 1053 void SetHeader() { |
| 1055 header.SetCmd<ValueType>(); | 1054 header.SetCmd<ValueType>(); |
| 1056 } | 1055 } |
| 1057 | 1056 |
| 1058 void Init(PrimitiveType _primitive_type, uint32 _first, uint32 _count) { | 1057 void Init(PrimitiveType _primitive_type, uint32 _first, uint32 _count) { |
| 1059 SetHeader(); | 1058 SetHeader(); |
| 1060 primitive_type = _primitive_type; | 1059 primitive_type = _primitive_type; |
| 1061 first = _first; | 1060 first = _first; |
| 1062 count = _count; | 1061 count = _count; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1079 OffsetOf_Draw_header_not_0); | 1078 OffsetOf_Draw_header_not_0); |
| 1080 COMPILE_ASSERT(offsetof(Draw, primitive_type) == 4, | 1079 COMPILE_ASSERT(offsetof(Draw, primitive_type) == 4, |
| 1081 OffsetOf_Draw_primitive_type_not_4); | 1080 OffsetOf_Draw_primitive_type_not_4); |
| 1082 COMPILE_ASSERT(offsetof(Draw, first) == 8, | 1081 COMPILE_ASSERT(offsetof(Draw, first) == 8, |
| 1083 OffsetOf_Draw_first_not_8); | 1082 OffsetOf_Draw_first_not_8); |
| 1084 COMPILE_ASSERT(offsetof(Draw, count) == 12, | 1083 COMPILE_ASSERT(offsetof(Draw, count) == 12, |
| 1085 OffsetOf_Draw_count_not_12); | 1084 OffsetOf_Draw_count_not_12); |
| 1086 | 1085 |
| 1087 struct DrawIndexed { | 1086 struct DrawIndexed { |
| 1088 typedef DrawIndexed ValueType; | 1087 typedef DrawIndexed ValueType; |
| 1089 static const CommandId kCmdId = command_buffer::kDrawIndexed; | 1088 static const CommandId kCmdId = kDrawIndexed; |
| 1090 static const ArgFlags kArgFlags = kFixed; | 1089 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1091 | 1090 |
| 1092 void SetHeader() { | 1091 void SetHeader() { |
| 1093 header.SetCmd<ValueType>(); | 1092 header.SetCmd<ValueType>(); |
| 1094 } | 1093 } |
| 1095 | 1094 |
| 1096 void Init( | 1095 void Init( |
| 1097 PrimitiveType _primitive_type, | 1096 PrimitiveType _primitive_type, |
| 1098 ResourceId _index_buffer_id, | 1097 ResourceId _index_buffer_id, |
| 1099 uint32 _first, | 1098 uint32 _first, |
| 1100 uint32 _count, | 1099 uint32 _count, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 OffsetOf_DrawIndexed_first_not_12); | 1145 OffsetOf_DrawIndexed_first_not_12); |
| 1147 COMPILE_ASSERT(offsetof(DrawIndexed, count) == 16, | 1146 COMPILE_ASSERT(offsetof(DrawIndexed, count) == 16, |
| 1148 OffsetOf_DrawIndexed_count_not_16); | 1147 OffsetOf_DrawIndexed_count_not_16); |
| 1149 COMPILE_ASSERT(offsetof(DrawIndexed, min_index) == 20, | 1148 COMPILE_ASSERT(offsetof(DrawIndexed, min_index) == 20, |
| 1150 OffsetOf_DrawIndexed_min_index_not_20); | 1149 OffsetOf_DrawIndexed_min_index_not_20); |
| 1151 COMPILE_ASSERT(offsetof(DrawIndexed, max_index) == 24, | 1150 COMPILE_ASSERT(offsetof(DrawIndexed, max_index) == 24, |
| 1152 OffsetOf_DrawIndexed_max_index_not_24); | 1151 OffsetOf_DrawIndexed_max_index_not_24); |
| 1153 | 1152 |
| 1154 struct CreateEffect { | 1153 struct CreateEffect { |
| 1155 typedef CreateEffect ValueType; | 1154 typedef CreateEffect ValueType; |
| 1156 static const CommandId kCmdId = command_buffer::kCreateEffect; | 1155 static const CommandId kCmdId = kCreateEffect; |
| 1157 static const ArgFlags kArgFlags = kFixed; | 1156 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1158 | 1157 |
| 1159 void SetHeader() { | 1158 void SetHeader() { |
| 1160 header.SetCmd<ValueType>(); | 1159 header.SetCmd<ValueType>(); |
| 1161 } | 1160 } |
| 1162 | 1161 |
| 1163 void Init(ResourceId _effect_id, uint32 _size, | 1162 void Init(ResourceId _effect_id, uint32 _size, |
| 1164 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1163 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1165 SetHeader(); | 1164 SetHeader(); |
| 1166 effect_id = _effect_id; | 1165 effect_id = _effect_id; |
| 1167 size = _size; | 1166 size = _size; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1186 OffsetOf_CreateEffect_header_not_0); | 1185 OffsetOf_CreateEffect_header_not_0); |
| 1187 COMPILE_ASSERT(offsetof(CreateEffect, effect_id) == 4, | 1186 COMPILE_ASSERT(offsetof(CreateEffect, effect_id) == 4, |
| 1188 OffsetOf_CreateEffect_effect_id_not_4); | 1187 OffsetOf_CreateEffect_effect_id_not_4); |
| 1189 COMPILE_ASSERT(offsetof(CreateEffect, size) == 8, | 1188 COMPILE_ASSERT(offsetof(CreateEffect, size) == 8, |
| 1190 OffsetOf_CreateEffect_size_not_8); | 1189 OffsetOf_CreateEffect_size_not_8); |
| 1191 COMPILE_ASSERT(offsetof(CreateEffect, shared_memory) == 12, | 1190 COMPILE_ASSERT(offsetof(CreateEffect, shared_memory) == 12, |
| 1192 OffsetOf_CreateEffect_shared_memory_not_12); | 1191 OffsetOf_CreateEffect_shared_memory_not_12); |
| 1193 | 1192 |
| 1194 struct CreateEffectImmediate { | 1193 struct CreateEffectImmediate { |
| 1195 typedef CreateEffectImmediate ValueType; | 1194 typedef CreateEffectImmediate ValueType; |
| 1196 static const CommandId kCmdId = command_buffer::kCreateEffectImmediate; | 1195 static const CommandId kCmdId = kCreateEffectImmediate; |
| 1197 static const ArgFlags kArgFlags = kAtLeastN; | 1196 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 1198 | 1197 |
| 1199 void SetHeader(uint32 size) { | 1198 void SetHeader(uint32 size) { |
| 1200 header.SetCmdBySize<ValueType>(size); | 1199 header.SetCmdBySize<ValueType>(size); |
| 1201 } | 1200 } |
| 1202 | 1201 |
| 1203 void Init(ResourceId _effect_id, uint32 _size, const void* data) { | 1202 void Init(ResourceId _effect_id, uint32 _size, const void* data) { |
| 1204 SetHeader(_size); | 1203 SetHeader(_size); |
| 1205 effect_id = _effect_id; | 1204 effect_id = _effect_id; |
| 1206 size = _size; | 1205 size = _size; |
| 1207 } | 1206 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1221 Sizeof_CreateEffectImmediate_is_not_12); | 1220 Sizeof_CreateEffectImmediate_is_not_12); |
| 1222 COMPILE_ASSERT(offsetof(CreateEffectImmediate, header) == 0, | 1221 COMPILE_ASSERT(offsetof(CreateEffectImmediate, header) == 0, |
| 1223 OffsetOf_CreateEffectImmediate_header_not_0); | 1222 OffsetOf_CreateEffectImmediate_header_not_0); |
| 1224 COMPILE_ASSERT(offsetof(CreateEffectImmediate, effect_id) == 4, | 1223 COMPILE_ASSERT(offsetof(CreateEffectImmediate, effect_id) == 4, |
| 1225 OffsetOf_CreateEffectImmediate_effect_id_not_4); | 1224 OffsetOf_CreateEffectImmediate_effect_id_not_4); |
| 1226 COMPILE_ASSERT(offsetof(CreateEffectImmediate, size) == 8, | 1225 COMPILE_ASSERT(offsetof(CreateEffectImmediate, size) == 8, |
| 1227 OffsetOf_CreateEffectImmediate_size_not_8); | 1226 OffsetOf_CreateEffectImmediate_size_not_8); |
| 1228 | 1227 |
| 1229 struct DestroyEffect { | 1228 struct DestroyEffect { |
| 1230 typedef DestroyEffect ValueType; | 1229 typedef DestroyEffect ValueType; |
| 1231 static const CommandId kCmdId = command_buffer::kDestroyEffect; | 1230 static const CommandId kCmdId = kDestroyEffect; |
| 1232 static const ArgFlags kArgFlags = kFixed; | 1231 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1233 | 1232 |
| 1234 void SetHeader() { | 1233 void SetHeader() { |
| 1235 header.SetCmd<ValueType>(); | 1234 header.SetCmd<ValueType>(); |
| 1236 } | 1235 } |
| 1237 | 1236 |
| 1238 void Init(ResourceId _effect_id) { | 1237 void Init(ResourceId _effect_id) { |
| 1239 SetHeader(); | 1238 SetHeader(); |
| 1240 effect_id = _effect_id; | 1239 effect_id = _effect_id; |
| 1241 } | 1240 } |
| 1242 | 1241 |
| 1243 static void* Set(void* cmd, ResourceId effect_id) { | 1242 static void* Set(void* cmd, ResourceId effect_id) { |
| 1244 static_cast<ValueType*>(cmd)->Init(effect_id); | 1243 static_cast<ValueType*>(cmd)->Init(effect_id); |
| 1245 return NextCmdAddress<ValueType>(cmd); | 1244 return NextCmdAddress<ValueType>(cmd); |
| 1246 } | 1245 } |
| 1247 | 1246 |
| 1248 CommandHeader header; | 1247 CommandHeader header; |
| 1249 ResourceId effect_id; | 1248 ResourceId effect_id; |
| 1250 }; | 1249 }; |
| 1251 | 1250 |
| 1252 COMPILE_ASSERT(sizeof(DestroyEffect) == 8, Sizeof_DestroyEffect_is_not_8); | 1251 COMPILE_ASSERT(sizeof(DestroyEffect) == 8, Sizeof_DestroyEffect_is_not_8); |
| 1253 COMPILE_ASSERT(offsetof(DestroyEffect, header) == 0, | 1252 COMPILE_ASSERT(offsetof(DestroyEffect, header) == 0, |
| 1254 OffsetOf_DestroyEffect_header_not_0); | 1253 OffsetOf_DestroyEffect_header_not_0); |
| 1255 COMPILE_ASSERT(offsetof(DestroyEffect, effect_id) == 4, | 1254 COMPILE_ASSERT(offsetof(DestroyEffect, effect_id) == 4, |
| 1256 OffsetOf_DestroyEffect_effect_id_not_4); | 1255 OffsetOf_DestroyEffect_effect_id_not_4); |
| 1257 | 1256 |
| 1258 struct SetEffect { | 1257 struct SetEffect { |
| 1259 typedef SetEffect ValueType; | 1258 typedef SetEffect ValueType; |
| 1260 static const CommandId kCmdId = command_buffer::kSetEffect; | 1259 static const CommandId kCmdId = kSetEffect; |
| 1261 static const ArgFlags kArgFlags = kFixed; | 1260 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1262 | 1261 |
| 1263 void SetHeader() { | 1262 void SetHeader() { |
| 1264 header.SetCmd<ValueType>(); | 1263 header.SetCmd<ValueType>(); |
| 1265 } | 1264 } |
| 1266 | 1265 |
| 1267 void Init(ResourceId _effect_id) { | 1266 void Init(ResourceId _effect_id) { |
| 1268 SetHeader(); | 1267 SetHeader(); |
| 1269 effect_id = _effect_id; | 1268 effect_id = _effect_id; |
| 1270 } | 1269 } |
| 1271 | 1270 |
| 1272 static void* Set(void* cmd, ResourceId effect_id) { | 1271 static void* Set(void* cmd, ResourceId effect_id) { |
| 1273 static_cast<ValueType*>(cmd)->Init(effect_id); | 1272 static_cast<ValueType*>(cmd)->Init(effect_id); |
| 1274 return NextCmdAddress<ValueType>(cmd); | 1273 return NextCmdAddress<ValueType>(cmd); |
| 1275 } | 1274 } |
| 1276 | 1275 |
| 1277 CommandHeader header; | 1276 CommandHeader header; |
| 1278 ResourceId effect_id; | 1277 ResourceId effect_id; |
| 1279 }; | 1278 }; |
| 1280 | 1279 |
| 1281 COMPILE_ASSERT(sizeof(SetEffect) == 8, Sizeof_SetEffect_is_not_8); | 1280 COMPILE_ASSERT(sizeof(SetEffect) == 8, Sizeof_SetEffect_is_not_8); |
| 1282 COMPILE_ASSERT(offsetof(SetEffect, header) == 0, | 1281 COMPILE_ASSERT(offsetof(SetEffect, header) == 0, |
| 1283 OffsetOf_SetEffect_header_not_0); | 1282 OffsetOf_SetEffect_header_not_0); |
| 1284 COMPILE_ASSERT(offsetof(SetEffect, effect_id) == 4, | 1283 COMPILE_ASSERT(offsetof(SetEffect, effect_id) == 4, |
| 1285 OffsetOf_SetEffect_effect_id_not_4); | 1284 OffsetOf_SetEffect_effect_id_not_4); |
| 1286 | 1285 |
| 1287 struct GetParamCount { | 1286 struct GetParamCount { |
| 1288 typedef GetParamCount ValueType; | 1287 typedef GetParamCount ValueType; |
| 1289 static const CommandId kCmdId = command_buffer::kGetParamCount; | 1288 static const CommandId kCmdId = kGetParamCount; |
| 1290 static const ArgFlags kArgFlags = kFixed; | 1289 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1291 | 1290 |
| 1292 void SetHeader() { | 1291 void SetHeader() { |
| 1293 header.SetCmd<ValueType>(); | 1292 header.SetCmd<ValueType>(); |
| 1294 } | 1293 } |
| 1295 | 1294 |
| 1296 void Init(ResourceId _effect_id, uint32 _size, | 1295 void Init(ResourceId _effect_id, uint32 _size, |
| 1297 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1296 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1298 SetHeader(); | 1297 SetHeader(); |
| 1299 effect_id = _effect_id; | 1298 effect_id = _effect_id; |
| 1300 size = _size; | 1299 size = _size; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1319 OffsetOf_GetParamCount_header_not_0); | 1318 OffsetOf_GetParamCount_header_not_0); |
| 1320 COMPILE_ASSERT(offsetof(GetParamCount, effect_id) == 4, | 1319 COMPILE_ASSERT(offsetof(GetParamCount, effect_id) == 4, |
| 1321 OffsetOf_GetParamCount_effect_id_not_4); | 1320 OffsetOf_GetParamCount_effect_id_not_4); |
| 1322 COMPILE_ASSERT(offsetof(GetParamCount, size) == 8, | 1321 COMPILE_ASSERT(offsetof(GetParamCount, size) == 8, |
| 1323 OffsetOf_GetParamCount_size_not_8); | 1322 OffsetOf_GetParamCount_size_not_8); |
| 1324 COMPILE_ASSERT(offsetof(GetParamCount, shared_memory) == 12, | 1323 COMPILE_ASSERT(offsetof(GetParamCount, shared_memory) == 12, |
| 1325 OffsetOf_GetParamCount_shared_memory_not_12); | 1324 OffsetOf_GetParamCount_shared_memory_not_12); |
| 1326 | 1325 |
| 1327 struct CreateParam { | 1326 struct CreateParam { |
| 1328 typedef CreateParam ValueType; | 1327 typedef CreateParam ValueType; |
| 1329 static const CommandId kCmdId = command_buffer::kCreateParam; | 1328 static const CommandId kCmdId = kCreateParam; |
| 1330 static const ArgFlags kArgFlags = kFixed; | 1329 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1331 | 1330 |
| 1332 void SetHeader() { | 1331 void SetHeader() { |
| 1333 header.SetCmd<ValueType>(); | 1332 header.SetCmd<ValueType>(); |
| 1334 } | 1333 } |
| 1335 | 1334 |
| 1336 void Init(ResourceId _param_id, ResourceId _effect_id, uint32 _index) { | 1335 void Init(ResourceId _param_id, ResourceId _effect_id, uint32 _index) { |
| 1337 SetHeader(); | 1336 SetHeader(); |
| 1338 param_id = _param_id; | 1337 param_id = _param_id; |
| 1339 effect_id = _effect_id; | 1338 effect_id = _effect_id; |
| 1340 index = _index; | 1339 index = _index; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1357 OffsetOf_CreateParam_header_not_0); | 1356 OffsetOf_CreateParam_header_not_0); |
| 1358 COMPILE_ASSERT(offsetof(CreateParam, param_id) == 4, | 1357 COMPILE_ASSERT(offsetof(CreateParam, param_id) == 4, |
| 1359 OffsetOf_CreateParam_param_id_not_4); | 1358 OffsetOf_CreateParam_param_id_not_4); |
| 1360 COMPILE_ASSERT(offsetof(CreateParam, effect_id) == 8, | 1359 COMPILE_ASSERT(offsetof(CreateParam, effect_id) == 8, |
| 1361 OffsetOf_CreateParam_effect_id_not_8); | 1360 OffsetOf_CreateParam_effect_id_not_8); |
| 1362 COMPILE_ASSERT(offsetof(CreateParam, index) == 12, | 1361 COMPILE_ASSERT(offsetof(CreateParam, index) == 12, |
| 1363 OffsetOf_CreateParam_index_not_12); | 1362 OffsetOf_CreateParam_index_not_12); |
| 1364 | 1363 |
| 1365 struct CreateParamByName { | 1364 struct CreateParamByName { |
| 1366 typedef CreateParamByName ValueType; | 1365 typedef CreateParamByName ValueType; |
| 1367 static const CommandId kCmdId = command_buffer::kCreateParamByName; | 1366 static const CommandId kCmdId = kCreateParamByName; |
| 1368 static const ArgFlags kArgFlags = kFixed; | 1367 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1369 | 1368 |
| 1370 void SetHeader() { | 1369 void SetHeader() { |
| 1371 header.SetCmd<ValueType>(); | 1370 header.SetCmd<ValueType>(); |
| 1372 } | 1371 } |
| 1373 | 1372 |
| 1374 void Init(ResourceId _param_id, ResourceId _effect_id, uint32 _size, | 1373 void Init(ResourceId _param_id, ResourceId _effect_id, uint32 _size, |
| 1375 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1374 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1376 SetHeader(); | 1375 SetHeader(); |
| 1377 param_id = _param_id; | 1376 param_id = _param_id; |
| 1378 effect_id = _effect_id; | 1377 effect_id = _effect_id; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1403 OffsetOf_CreateParamByName_param_id_not_4); | 1402 OffsetOf_CreateParamByName_param_id_not_4); |
| 1404 COMPILE_ASSERT(offsetof(CreateParamByName, effect_id) == 8, | 1403 COMPILE_ASSERT(offsetof(CreateParamByName, effect_id) == 8, |
| 1405 OffsetOf_CreateParamByName_effect_id_not_8); | 1404 OffsetOf_CreateParamByName_effect_id_not_8); |
| 1406 COMPILE_ASSERT(offsetof(CreateParamByName, size) == 12, | 1405 COMPILE_ASSERT(offsetof(CreateParamByName, size) == 12, |
| 1407 OffsetOf_CreateParamByName_size_not_12); | 1406 OffsetOf_CreateParamByName_size_not_12); |
| 1408 COMPILE_ASSERT(offsetof(CreateParamByName, shared_memory) == 16, | 1407 COMPILE_ASSERT(offsetof(CreateParamByName, shared_memory) == 16, |
| 1409 OffsetOf_CreateParamByName_shared_memory_not_16); | 1408 OffsetOf_CreateParamByName_shared_memory_not_16); |
| 1410 | 1409 |
| 1411 struct CreateParamByNameImmediate { | 1410 struct CreateParamByNameImmediate { |
| 1412 typedef CreateParamByNameImmediate ValueType; | 1411 typedef CreateParamByNameImmediate ValueType; |
| 1413 static const CommandId kCmdId = command_buffer::kCreateParamByNameImmediate; | 1412 static const CommandId kCmdId = kCreateParamByNameImmediate; |
| 1414 static const ArgFlags kArgFlags = kAtLeastN; | 1413 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 1415 | 1414 |
| 1416 void SetHeader(uint32 size) { | 1415 void SetHeader(uint32 size) { |
| 1417 header.SetCmdBySize<ValueType>(size); | 1416 header.SetCmdBySize<ValueType>(size); |
| 1418 } | 1417 } |
| 1419 | 1418 |
| 1420 void Init(ResourceId _param_id, ResourceId _effect_id, uint32 _size, | 1419 void Init(ResourceId _param_id, ResourceId _effect_id, uint32 _size, |
| 1421 const void* data) { | 1420 const void* data) { |
| 1422 SetHeader(_size); | 1421 SetHeader(_size); |
| 1423 param_id = _param_id; | 1422 param_id = _param_id; |
| 1424 effect_id = _effect_id; | 1423 effect_id = _effect_id; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1444 OffsetOf_CreateParamByNameImmediate_header_not_0); | 1443 OffsetOf_CreateParamByNameImmediate_header_not_0); |
| 1445 COMPILE_ASSERT(offsetof(CreateParamByNameImmediate, param_id) == 4, | 1444 COMPILE_ASSERT(offsetof(CreateParamByNameImmediate, param_id) == 4, |
| 1446 OffsetOf_CreateParamByNameImmediate_param_id_not_4); | 1445 OffsetOf_CreateParamByNameImmediate_param_id_not_4); |
| 1447 COMPILE_ASSERT(offsetof(CreateParamByNameImmediate, effect_id) == 8, | 1446 COMPILE_ASSERT(offsetof(CreateParamByNameImmediate, effect_id) == 8, |
| 1448 OffsetOf_CreateParamByNameImmediate_effect_id_not_8); | 1447 OffsetOf_CreateParamByNameImmediate_effect_id_not_8); |
| 1449 COMPILE_ASSERT(offsetof(CreateParamByNameImmediate, size) == 12, | 1448 COMPILE_ASSERT(offsetof(CreateParamByNameImmediate, size) == 12, |
| 1450 OffsetOf_CreateParamByNameImmediate_size_not_12); | 1449 OffsetOf_CreateParamByNameImmediate_size_not_12); |
| 1451 | 1450 |
| 1452 struct DestroyParam { | 1451 struct DestroyParam { |
| 1453 typedef DestroyParam ValueType; | 1452 typedef DestroyParam ValueType; |
| 1454 static const CommandId kCmdId = command_buffer::kDestroyParam; | 1453 static const CommandId kCmdId = kDestroyParam; |
| 1455 static const ArgFlags kArgFlags = kFixed; | 1454 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1456 | 1455 |
| 1457 void SetHeader() { | 1456 void SetHeader() { |
| 1458 header.SetCmd<ValueType>(); | 1457 header.SetCmd<ValueType>(); |
| 1459 } | 1458 } |
| 1460 | 1459 |
| 1461 void Init(ResourceId _param_id) { | 1460 void Init(ResourceId _param_id) { |
| 1462 SetHeader(); | 1461 SetHeader(); |
| 1463 param_id = _param_id; | 1462 param_id = _param_id; |
| 1464 } | 1463 } |
| 1465 | 1464 |
| 1466 static void* Set(void* cmd, ResourceId param_id) { | 1465 static void* Set(void* cmd, ResourceId param_id) { |
| 1467 static_cast<ValueType*>(cmd)->Init(param_id); | 1466 static_cast<ValueType*>(cmd)->Init(param_id); |
| 1468 return NextCmdAddress<ValueType>(cmd); | 1467 return NextCmdAddress<ValueType>(cmd); |
| 1469 } | 1468 } |
| 1470 | 1469 |
| 1471 CommandHeader header; | 1470 CommandHeader header; |
| 1472 ResourceId param_id; | 1471 ResourceId param_id; |
| 1473 }; | 1472 }; |
| 1474 | 1473 |
| 1475 COMPILE_ASSERT(sizeof(DestroyParam) == 8, Sizeof_DestroyParam_is_not_8); | 1474 COMPILE_ASSERT(sizeof(DestroyParam) == 8, Sizeof_DestroyParam_is_not_8); |
| 1476 COMPILE_ASSERT(offsetof(DestroyParam, header) == 0, | 1475 COMPILE_ASSERT(offsetof(DestroyParam, header) == 0, |
| 1477 OffsetOf_DestroyParam_header_not_0); | 1476 OffsetOf_DestroyParam_header_not_0); |
| 1478 COMPILE_ASSERT(offsetof(DestroyParam, param_id) == 4, | 1477 COMPILE_ASSERT(offsetof(DestroyParam, param_id) == 4, |
| 1479 OffsetOf_DestroyParam_param_id_not_4); | 1478 OffsetOf_DestroyParam_param_id_not_4); |
| 1480 | 1479 |
| 1481 struct SetParamData { | 1480 struct SetParamData { |
| 1482 typedef SetParamData ValueType; | 1481 typedef SetParamData ValueType; |
| 1483 static const CommandId kCmdId = command_buffer::kSetParamData; | 1482 static const CommandId kCmdId = kSetParamData; |
| 1484 static const ArgFlags kArgFlags = kFixed; | 1483 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1485 | 1484 |
| 1486 void SetHeader() { | 1485 void SetHeader() { |
| 1487 header.SetCmd<ValueType>(); | 1486 header.SetCmd<ValueType>(); |
| 1488 } | 1487 } |
| 1489 | 1488 |
| 1490 void Init(ResourceId _param_id, uint32 _size, | 1489 void Init(ResourceId _param_id, uint32 _size, |
| 1491 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1490 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1492 SetHeader(); | 1491 SetHeader(); |
| 1493 param_id = _param_id; | 1492 param_id = _param_id; |
| 1494 size = _size; | 1493 size = _size; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1513 OffsetOf_SetParamData_header_not_0); | 1512 OffsetOf_SetParamData_header_not_0); |
| 1514 COMPILE_ASSERT(offsetof(SetParamData, param_id) == 4, | 1513 COMPILE_ASSERT(offsetof(SetParamData, param_id) == 4, |
| 1515 OffsetOf_SetParamData_param_id_not_4); | 1514 OffsetOf_SetParamData_param_id_not_4); |
| 1516 COMPILE_ASSERT(offsetof(SetParamData, size) == 8, | 1515 COMPILE_ASSERT(offsetof(SetParamData, size) == 8, |
| 1517 OffsetOf_SetParamData_size_not_8); | 1516 OffsetOf_SetParamData_size_not_8); |
| 1518 COMPILE_ASSERT(offsetof(SetParamData, shared_memory) == 12, | 1517 COMPILE_ASSERT(offsetof(SetParamData, shared_memory) == 12, |
| 1519 OffsetOf_SetParamData_shared_memory_not_12); | 1518 OffsetOf_SetParamData_shared_memory_not_12); |
| 1520 | 1519 |
| 1521 struct SetParamDataImmediate { | 1520 struct SetParamDataImmediate { |
| 1522 typedef SetParamDataImmediate ValueType; | 1521 typedef SetParamDataImmediate ValueType; |
| 1523 static const CommandId kCmdId = command_buffer::kSetParamDataImmediate; | 1522 static const CommandId kCmdId = kSetParamDataImmediate; |
| 1524 static const ArgFlags kArgFlags = kAtLeastN; | 1523 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 1525 | 1524 |
| 1526 void SetHeader(uint32 size) { | 1525 void SetHeader(uint32 size) { |
| 1527 header.SetCmdBySize<ValueType>(size); | 1526 header.SetCmdBySize<ValueType>(size); |
| 1528 } | 1527 } |
| 1529 | 1528 |
| 1530 void Init(ResourceId _param_id, uint32 _size, const void* data) { | 1529 void Init(ResourceId _param_id, uint32 _size, const void* data) { |
| 1531 SetHeader(_size); | 1530 SetHeader(_size); |
| 1532 param_id = _param_id; | 1531 param_id = _param_id; |
| 1533 size = _size; | 1532 size = _size; |
| 1534 memcpy(ImmediateDataAddress(this), data, _size); | 1533 memcpy(ImmediateDataAddress(this), data, _size); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1549 Sizeof_SetParamDataImmediate_is_not_12); | 1548 Sizeof_SetParamDataImmediate_is_not_12); |
| 1550 COMPILE_ASSERT(offsetof(SetParamDataImmediate, header) == 0, | 1549 COMPILE_ASSERT(offsetof(SetParamDataImmediate, header) == 0, |
| 1551 OffsetOf_SetParamDataImmediate_header_not_0); | 1550 OffsetOf_SetParamDataImmediate_header_not_0); |
| 1552 COMPILE_ASSERT(offsetof(SetParamDataImmediate, param_id) == 4, | 1551 COMPILE_ASSERT(offsetof(SetParamDataImmediate, param_id) == 4, |
| 1553 OffsetOf_SetParamDataImmediate_param_id_not_4); | 1552 OffsetOf_SetParamDataImmediate_param_id_not_4); |
| 1554 COMPILE_ASSERT(offsetof(SetParamDataImmediate, size) == 8, | 1553 COMPILE_ASSERT(offsetof(SetParamDataImmediate, size) == 8, |
| 1555 OffsetOf_SetParamDataImmediate_size_not_8); | 1554 OffsetOf_SetParamDataImmediate_size_not_8); |
| 1556 | 1555 |
| 1557 struct GetParamDesc { | 1556 struct GetParamDesc { |
| 1558 typedef GetParamDesc ValueType; | 1557 typedef GetParamDesc ValueType; |
| 1559 static const CommandId kCmdId = command_buffer::kGetParamDesc; | 1558 static const CommandId kCmdId = kGetParamDesc; |
| 1560 static const ArgFlags kArgFlags = kFixed; | 1559 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1561 | 1560 |
| 1562 void SetHeader() { | 1561 void SetHeader() { |
| 1563 header.SetCmd<ValueType>(); | 1562 header.SetCmd<ValueType>(); |
| 1564 } | 1563 } |
| 1565 | 1564 |
| 1566 void Init(ResourceId _param_id, uint32 _size, | 1565 void Init(ResourceId _param_id, uint32 _size, |
| 1567 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1566 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1568 SetHeader(); | 1567 SetHeader(); |
| 1569 param_id = _param_id; | 1568 param_id = _param_id; |
| 1570 size = _size; | 1569 size = _size; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1589 OffsetOf_GetParamDesc_header_not_0); | 1588 OffsetOf_GetParamDesc_header_not_0); |
| 1590 COMPILE_ASSERT(offsetof(GetParamDesc, param_id) == 4, | 1589 COMPILE_ASSERT(offsetof(GetParamDesc, param_id) == 4, |
| 1591 OffsetOf_GetParamDesc_id_not_4); | 1590 OffsetOf_GetParamDesc_id_not_4); |
| 1592 COMPILE_ASSERT(offsetof(GetParamDesc, size) == 8, | 1591 COMPILE_ASSERT(offsetof(GetParamDesc, size) == 8, |
| 1593 OffsetOf_GetParamDesc_size_not_8); | 1592 OffsetOf_GetParamDesc_size_not_8); |
| 1594 COMPILE_ASSERT(offsetof(GetParamDesc, shared_memory) == 12, | 1593 COMPILE_ASSERT(offsetof(GetParamDesc, shared_memory) == 12, |
| 1595 OffsetOf_GetParamDesc_shared_memory_not_12); | 1594 OffsetOf_GetParamDesc_shared_memory_not_12); |
| 1596 | 1595 |
| 1597 struct GetStreamCount { | 1596 struct GetStreamCount { |
| 1598 typedef GetStreamCount ValueType; | 1597 typedef GetStreamCount ValueType; |
| 1599 static const CommandId kCmdId = command_buffer::kGetStreamCount; | 1598 static const CommandId kCmdId = kGetStreamCount; |
| 1600 static const ArgFlags kArgFlags = kFixed; | 1599 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1601 | 1600 |
| 1602 void SetHeader() { | 1601 void SetHeader() { |
| 1603 header.SetCmd<ValueType>(); | 1602 header.SetCmd<ValueType>(); |
| 1604 } | 1603 } |
| 1605 | 1604 |
| 1606 void Init(ResourceId _effect_id, uint32 _size, | 1605 void Init(ResourceId _effect_id, uint32 _size, |
| 1607 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1606 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1608 SetHeader(); | 1607 SetHeader(); |
| 1609 effect_id = _effect_id; | 1608 effect_id = _effect_id; |
| 1610 size = _size; | 1609 size = _size; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1630 OffsetOf_GetStreamCount_header_not_0); | 1629 OffsetOf_GetStreamCount_header_not_0); |
| 1631 COMPILE_ASSERT(offsetof(GetStreamCount, effect_id) == 4, | 1630 COMPILE_ASSERT(offsetof(GetStreamCount, effect_id) == 4, |
| 1632 OffsetOf_GetStreamCount_effect_id_not_4); | 1631 OffsetOf_GetStreamCount_effect_id_not_4); |
| 1633 COMPILE_ASSERT(offsetof(GetStreamCount, size) == 8, | 1632 COMPILE_ASSERT(offsetof(GetStreamCount, size) == 8, |
| 1634 OffsetOf_GetStreamCount_size_not_8); | 1633 OffsetOf_GetStreamCount_size_not_8); |
| 1635 COMPILE_ASSERT(offsetof(GetStreamCount, shared_memory) == 12, | 1634 COMPILE_ASSERT(offsetof(GetStreamCount, shared_memory) == 12, |
| 1636 OffsetOf_GetStreamCount_shared_memory_not_12); | 1635 OffsetOf_GetStreamCount_shared_memory_not_12); |
| 1637 | 1636 |
| 1638 struct GetStreamDesc { | 1637 struct GetStreamDesc { |
| 1639 typedef GetStreamDesc ValueType; | 1638 typedef GetStreamDesc ValueType; |
| 1640 static const CommandId kCmdId = command_buffer::kGetStreamDesc; | 1639 static const CommandId kCmdId = kGetStreamDesc; |
| 1641 static const ArgFlags kArgFlags = kFixed; | 1640 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1642 | 1641 |
| 1643 void SetHeader() { | 1642 void SetHeader() { |
| 1644 header.SetCmd<ValueType>(); | 1643 header.SetCmd<ValueType>(); |
| 1645 } | 1644 } |
| 1646 | 1645 |
| 1647 void Init(ResourceId _effect_id, uint32 _index, uint32 _size, | 1646 void Init(ResourceId _effect_id, uint32 _index, uint32 _size, |
| 1648 uint32 shared_memory_id, uint32 shared_memory_offset) { | 1647 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 1649 SetHeader(); | 1648 SetHeader(); |
| 1650 effect_id = _effect_id; | 1649 effect_id = _effect_id; |
| 1651 index = _index; | 1650 index = _index; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1674 OffsetOf_GetStreamDesc_effect_id_not_4); | 1673 OffsetOf_GetStreamDesc_effect_id_not_4); |
| 1675 COMPILE_ASSERT(offsetof(GetStreamDesc, index) == 8, | 1674 COMPILE_ASSERT(offsetof(GetStreamDesc, index) == 8, |
| 1676 OffsetOf_GetStreamDesc_index_not_8); | 1675 OffsetOf_GetStreamDesc_index_not_8); |
| 1677 COMPILE_ASSERT(offsetof(GetStreamDesc, size) == 12, | 1676 COMPILE_ASSERT(offsetof(GetStreamDesc, size) == 12, |
| 1678 OffsetOf_GetStreamDesc_size_not_12); | 1677 OffsetOf_GetStreamDesc_size_not_12); |
| 1679 COMPILE_ASSERT(offsetof(GetStreamDesc, shared_memory) == 16, | 1678 COMPILE_ASSERT(offsetof(GetStreamDesc, shared_memory) == 16, |
| 1680 OffsetOf_GetStreamDesc_shared_memory_not_16); | 1679 OffsetOf_GetStreamDesc_shared_memory_not_16); |
| 1681 | 1680 |
| 1682 struct DestroyTexture { | 1681 struct DestroyTexture { |
| 1683 typedef DestroyTexture ValueType; | 1682 typedef DestroyTexture ValueType; |
| 1684 static const CommandId kCmdId = command_buffer::kDestroyTexture; | 1683 static const CommandId kCmdId = kDestroyTexture; |
| 1685 static const ArgFlags kArgFlags = kFixed; | 1684 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1686 | 1685 |
| 1687 void SetHeader() { | 1686 void SetHeader() { |
| 1688 header.SetCmd<ValueType>(); | 1687 header.SetCmd<ValueType>(); |
| 1689 } | 1688 } |
| 1690 | 1689 |
| 1691 void Init(ResourceId _texture_id) { | 1690 void Init(ResourceId _texture_id) { |
| 1692 SetHeader(); | 1691 SetHeader(); |
| 1693 texture_id = _texture_id; | 1692 texture_id = _texture_id; |
| 1694 } | 1693 } |
| 1695 | 1694 |
| 1696 static void* Set(void* cmd, ResourceId texture_id) { | 1695 static void* Set(void* cmd, ResourceId texture_id) { |
| 1697 static_cast<ValueType*>(cmd)->Init(texture_id); | 1696 static_cast<ValueType*>(cmd)->Init(texture_id); |
| 1698 return NextCmdAddress<ValueType>(cmd); | 1697 return NextCmdAddress<ValueType>(cmd); |
| 1699 } | 1698 } |
| 1700 | 1699 |
| 1701 CommandHeader header; | 1700 CommandHeader header; |
| 1702 ResourceId texture_id; | 1701 ResourceId texture_id; |
| 1703 }; | 1702 }; |
| 1704 | 1703 |
| 1705 COMPILE_ASSERT(sizeof(DestroyTexture) == 8, Sizeof_DestroyTexture_is_not_8); | 1704 COMPILE_ASSERT(sizeof(DestroyTexture) == 8, Sizeof_DestroyTexture_is_not_8); |
| 1706 COMPILE_ASSERT(offsetof(DestroyTexture, header) == 0, | 1705 COMPILE_ASSERT(offsetof(DestroyTexture, header) == 0, |
| 1707 OffsetOf_DestroyTexture_header_not_0); | 1706 OffsetOf_DestroyTexture_header_not_0); |
| 1708 COMPILE_ASSERT(offsetof(DestroyTexture, texture_id) == 4, | 1707 COMPILE_ASSERT(offsetof(DestroyTexture, texture_id) == 4, |
| 1709 OffsetOf_DestroyTexture_texture_id_not_4); | 1708 OffsetOf_DestroyTexture_texture_id_not_4); |
| 1710 | 1709 |
| 1711 struct CreateTexture2d { | 1710 struct CreateTexture2d { |
| 1712 typedef CreateTexture2d ValueType; | 1711 typedef CreateTexture2d ValueType; |
| 1713 static const CommandId kCmdId = command_buffer::kCreateTexture2d; | 1712 static const CommandId kCmdId = kCreateTexture2d; |
| 1714 static const ArgFlags kArgFlags = kFixed; | 1713 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1715 | 1714 |
| 1716 // argument 1 | 1715 // argument 1 |
| 1717 typedef BitField<0, 16> Width; | 1716 typedef BitField<0, 16> Width; |
| 1718 typedef BitField<16, 16> Height; | 1717 typedef BitField<16, 16> Height; |
| 1719 // argument 2 | 1718 // argument 2 |
| 1720 typedef BitField<0, 4> Levels; | 1719 typedef BitField<0, 4> Levels; |
| 1721 typedef BitField<4, 4> Unused; | 1720 typedef BitField<4, 4> Unused; |
| 1722 typedef BitField<8, 8> Format; | 1721 typedef BitField<8, 8> Format; |
| 1723 typedef BitField<16, 16> Flags; | 1722 typedef BitField<16, 16> Flags; |
| 1724 | 1723 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1762 OffsetOf_CreateTexture2d_header_not_0); | 1761 OffsetOf_CreateTexture2d_header_not_0); |
| 1763 COMPILE_ASSERT(offsetof(CreateTexture2d, texture_id) == 4, | 1762 COMPILE_ASSERT(offsetof(CreateTexture2d, texture_id) == 4, |
| 1764 OffsetOf_CreateTexture2d_texture_id_not_4); | 1763 OffsetOf_CreateTexture2d_texture_id_not_4); |
| 1765 COMPILE_ASSERT(offsetof(CreateTexture2d, width_height) == 8, | 1764 COMPILE_ASSERT(offsetof(CreateTexture2d, width_height) == 8, |
| 1766 OffsetOf_CreateTexture2d_width_height_not_8); | 1765 OffsetOf_CreateTexture2d_width_height_not_8); |
| 1767 COMPILE_ASSERT(offsetof(CreateTexture2d, levels_format_flags) == 12, | 1766 COMPILE_ASSERT(offsetof(CreateTexture2d, levels_format_flags) == 12, |
| 1768 OffsetOf_CreateTexture2d_levels_format_flags_not_12); | 1767 OffsetOf_CreateTexture2d_levels_format_flags_not_12); |
| 1769 | 1768 |
| 1770 struct CreateTexture3d { | 1769 struct CreateTexture3d { |
| 1771 typedef CreateTexture3d ValueType; | 1770 typedef CreateTexture3d ValueType; |
| 1772 static const CommandId kCmdId = command_buffer::kCreateTexture3d; | 1771 static const CommandId kCmdId = kCreateTexture3d; |
| 1773 static const ArgFlags kArgFlags = kFixed; | 1772 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1774 | 1773 |
| 1775 // argument 1 | 1774 // argument 1 |
| 1776 typedef BitField<0, 16> Width; | 1775 typedef BitField<0, 16> Width; |
| 1777 typedef BitField<16, 16> Height; | 1776 typedef BitField<16, 16> Height; |
| 1778 // argument 2 | 1777 // argument 2 |
| 1779 typedef BitField<0, 16> Depth; | 1778 typedef BitField<0, 16> Depth; |
| 1780 typedef BitField<16, 16> Unused1; | 1779 typedef BitField<16, 16> Unused1; |
| 1781 // argument 3 | 1780 // argument 3 |
| 1782 typedef BitField<0, 4> Levels; | 1781 typedef BitField<0, 4> Levels; |
| 1783 typedef BitField<4, 4> Unused2; | 1782 typedef BitField<4, 4> Unused2; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1829 OffsetOf_CreateTexture3d_texture_id_not_4); | 1828 OffsetOf_CreateTexture3d_texture_id_not_4); |
| 1830 COMPILE_ASSERT(offsetof(CreateTexture3d, width_height) == 8, | 1829 COMPILE_ASSERT(offsetof(CreateTexture3d, width_height) == 8, |
| 1831 OffsetOf_CreateTexture3d_width_height_not_8); | 1830 OffsetOf_CreateTexture3d_width_height_not_8); |
| 1832 COMPILE_ASSERT(offsetof(CreateTexture3d, depth_unused) == 12, | 1831 COMPILE_ASSERT(offsetof(CreateTexture3d, depth_unused) == 12, |
| 1833 OffsetOf_CreateTexture3d_depth_unused_not_12); | 1832 OffsetOf_CreateTexture3d_depth_unused_not_12); |
| 1834 COMPILE_ASSERT(offsetof(CreateTexture3d, levels_format_flags) == 16, | 1833 COMPILE_ASSERT(offsetof(CreateTexture3d, levels_format_flags) == 16, |
| 1835 OffsetOf_CreateTexture3d_levels_format_flags_not_16); | 1834 OffsetOf_CreateTexture3d_levels_format_flags_not_16); |
| 1836 | 1835 |
| 1837 struct CreateTextureCube { | 1836 struct CreateTextureCube { |
| 1838 typedef CreateTextureCube ValueType; | 1837 typedef CreateTextureCube ValueType; |
| 1839 static const CommandId kCmdId = command_buffer::kCreateTextureCube; | 1838 static const CommandId kCmdId = kCreateTextureCube; |
| 1840 static const ArgFlags kArgFlags = kFixed; | 1839 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1841 | 1840 |
| 1842 // argument 1 | 1841 // argument 1 |
| 1843 typedef BitField<0, 16> Side; | 1842 typedef BitField<0, 16> Side; |
| 1844 typedef BitField<16, 16> Unused1; | 1843 typedef BitField<16, 16> Unused1; |
| 1845 // argument 2 | 1844 // argument 2 |
| 1846 typedef BitField<0, 4> Levels; | 1845 typedef BitField<0, 4> Levels; |
| 1847 typedef BitField<4, 4> Unused2; | 1846 typedef BitField<4, 4> Unused2; |
| 1848 typedef BitField<8, 8> Format; | 1847 typedef BitField<8, 8> Format; |
| 1849 typedef BitField<16, 16> Flags; | 1848 typedef BitField<16, 16> Flags; |
| 1850 | 1849 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 OffsetOf_CreateTextureCube_header_not_0); | 1885 OffsetOf_CreateTextureCube_header_not_0); |
| 1887 COMPILE_ASSERT(offsetof(CreateTextureCube, texture_id) == 4, | 1886 COMPILE_ASSERT(offsetof(CreateTextureCube, texture_id) == 4, |
| 1888 OffsetOf_CreateTextureCube_texture_id_not_4); | 1887 OffsetOf_CreateTextureCube_texture_id_not_4); |
| 1889 COMPILE_ASSERT(offsetof(CreateTextureCube, edge_length) == 8, | 1888 COMPILE_ASSERT(offsetof(CreateTextureCube, edge_length) == 8, |
| 1890 OffsetOf_CreateTextureCube_edge_length_not_8); | 1889 OffsetOf_CreateTextureCube_edge_length_not_8); |
| 1891 COMPILE_ASSERT(offsetof(CreateTextureCube, levels_format_flags) == 12, | 1890 COMPILE_ASSERT(offsetof(CreateTextureCube, levels_format_flags) == 12, |
| 1892 OffsetOf_CreateTextureCube_levels_format_flags_not_12); | 1891 OffsetOf_CreateTextureCube_levels_format_flags_not_12); |
| 1893 | 1892 |
| 1894 struct SetTextureData { | 1893 struct SetTextureData { |
| 1895 typedef SetTextureData ValueType; | 1894 typedef SetTextureData ValueType; |
| 1896 static const CommandId kCmdId = command_buffer::kSetTextureData; | 1895 static const CommandId kCmdId = kSetTextureData; |
| 1897 static const ArgFlags kArgFlags = kFixed; | 1896 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 1898 | 1897 |
| 1899 // argument 1 | 1898 // argument 1 |
| 1900 typedef BitField<0, 16> X; | 1899 typedef BitField<0, 16> X; |
| 1901 typedef BitField<16, 16> Y; | 1900 typedef BitField<16, 16> Y; |
| 1902 // argument 2 | 1901 // argument 2 |
| 1903 typedef BitField<0, 16> Width; | 1902 typedef BitField<0, 16> Width; |
| 1904 typedef BitField<16, 16> Height; | 1903 typedef BitField<16, 16> Height; |
| 1905 // argument 3 | 1904 // argument 3 |
| 1906 typedef BitField<0, 16> Z; | 1905 typedef BitField<0, 16> Z; |
| 1907 typedef BitField<16, 16> Depth; | 1906 typedef BitField<16, 16> Depth; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 OffsetOf_SetTextureData_row_pitch_not_24); | 2005 OffsetOf_SetTextureData_row_pitch_not_24); |
| 2007 COMPILE_ASSERT(offsetof(SetTextureData, slice_pitch) == 28, | 2006 COMPILE_ASSERT(offsetof(SetTextureData, slice_pitch) == 28, |
| 2008 OffsetOf_SetTextureData_slice_pitch_not_28); | 2007 OffsetOf_SetTextureData_slice_pitch_not_28); |
| 2009 COMPILE_ASSERT(offsetof(SetTextureData, size) == 32, | 2008 COMPILE_ASSERT(offsetof(SetTextureData, size) == 32, |
| 2010 OffsetOf_SetTextureData_size_not_32); | 2009 OffsetOf_SetTextureData_size_not_32); |
| 2011 COMPILE_ASSERT(offsetof(SetTextureData, shared_memory) == 36, | 2010 COMPILE_ASSERT(offsetof(SetTextureData, shared_memory) == 36, |
| 2012 OffsetOf_SetTextureData_shared_memory_not_36); | 2011 OffsetOf_SetTextureData_shared_memory_not_36); |
| 2013 | 2012 |
| 2014 struct SetTextureDataImmediate { | 2013 struct SetTextureDataImmediate { |
| 2015 typedef SetTextureDataImmediate ValueType; | 2014 typedef SetTextureDataImmediate ValueType; |
| 2016 static const CommandId kCmdId = command_buffer::kSetTextureDataImmediate; | 2015 static const CommandId kCmdId = kSetTextureDataImmediate; |
| 2017 static const ArgFlags kArgFlags = kAtLeastN; | 2016 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 2018 | 2017 |
| 2019 // argument 1 | 2018 // argument 1 |
| 2020 typedef BitField<0, 16> X; | 2019 typedef BitField<0, 16> X; |
| 2021 typedef BitField<16, 16> Y; | 2020 typedef BitField<16, 16> Y; |
| 2022 // argument 2 | 2021 // argument 2 |
| 2023 typedef BitField<0, 16> Width; | 2022 typedef BitField<0, 16> Width; |
| 2024 typedef BitField<16, 16> Height; | 2023 typedef BitField<16, 16> Height; |
| 2025 // argument 3 | 2024 // argument 3 |
| 2026 typedef BitField<0, 16> Z; | 2025 typedef BitField<0, 16> Z; |
| 2027 typedef BitField<16, 16> Depth; | 2026 typedef BitField<16, 16> Depth; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 OffsetOf_SetTextureDataImmediate_level_face_not_20); | 2119 OffsetOf_SetTextureDataImmediate_level_face_not_20); |
| 2121 COMPILE_ASSERT(offsetof(SetTextureDataImmediate, row_pitch) == 24, | 2120 COMPILE_ASSERT(offsetof(SetTextureDataImmediate, row_pitch) == 24, |
| 2122 OffsetOf_SetTextureDataImmediate_row_pitch_not_24); | 2121 OffsetOf_SetTextureDataImmediate_row_pitch_not_24); |
| 2123 COMPILE_ASSERT(offsetof(SetTextureDataImmediate, slice_pitch) == 28, | 2122 COMPILE_ASSERT(offsetof(SetTextureDataImmediate, slice_pitch) == 28, |
| 2124 OffsetOf_SetTextureDataImmediate_slice_pitch_not_28); | 2123 OffsetOf_SetTextureDataImmediate_slice_pitch_not_28); |
| 2125 COMPILE_ASSERT(offsetof(SetTextureDataImmediate, size) == 32, | 2124 COMPILE_ASSERT(offsetof(SetTextureDataImmediate, size) == 32, |
| 2126 OffsetOf_SetTextureDataImmediate_size_not_32); | 2125 OffsetOf_SetTextureDataImmediate_size_not_32); |
| 2127 | 2126 |
| 2128 struct GetTextureData { | 2127 struct GetTextureData { |
| 2129 typedef GetTextureData ValueType; | 2128 typedef GetTextureData ValueType; |
| 2130 static const CommandId kCmdId = command_buffer::kGetTextureData; | 2129 static const CommandId kCmdId = kGetTextureData; |
| 2131 static const ArgFlags kArgFlags = kFixed; | 2130 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2132 | 2131 |
| 2133 // argument 1 | 2132 // argument 1 |
| 2134 typedef BitField<0, 16> X; | 2133 typedef BitField<0, 16> X; |
| 2135 typedef BitField<16, 16> Y; | 2134 typedef BitField<16, 16> Y; |
| 2136 // argument 2 | 2135 // argument 2 |
| 2137 typedef BitField<0, 16> Width; | 2136 typedef BitField<0, 16> Width; |
| 2138 typedef BitField<16, 16> Height; | 2137 typedef BitField<16, 16> Height; |
| 2139 // argument 3 | 2138 // argument 3 |
| 2140 typedef BitField<0, 16> Z; | 2139 typedef BitField<0, 16> Z; |
| 2141 typedef BitField<16, 16> Depth; | 2140 typedef BitField<16, 16> Depth; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2240 OffsetOf_GetTextureData_row_pitch_not_24); | 2239 OffsetOf_GetTextureData_row_pitch_not_24); |
| 2241 COMPILE_ASSERT(offsetof(GetTextureData, slice_pitch) == 28, | 2240 COMPILE_ASSERT(offsetof(GetTextureData, slice_pitch) == 28, |
| 2242 OffsetOf_GetTextureData_slice_pitch_not_28); | 2241 OffsetOf_GetTextureData_slice_pitch_not_28); |
| 2243 COMPILE_ASSERT(offsetof(GetTextureData, size) == 32, | 2242 COMPILE_ASSERT(offsetof(GetTextureData, size) == 32, |
| 2244 OffsetOf_GetTextureData_size_not_32); | 2243 OffsetOf_GetTextureData_size_not_32); |
| 2245 COMPILE_ASSERT(offsetof(GetTextureData, shared_memory) == 36, | 2244 COMPILE_ASSERT(offsetof(GetTextureData, shared_memory) == 36, |
| 2246 OffsetOf_GetTextureData_shared_memory_not_36); | 2245 OffsetOf_GetTextureData_shared_memory_not_36); |
| 2247 | 2246 |
| 2248 struct CreateSampler { | 2247 struct CreateSampler { |
| 2249 typedef CreateSampler ValueType; | 2248 typedef CreateSampler ValueType; |
| 2250 static const CommandId kCmdId = command_buffer::kCreateSampler; | 2249 static const CommandId kCmdId = kCreateSampler; |
| 2251 static const ArgFlags kArgFlags = kFixed; | 2250 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2252 | 2251 |
| 2253 void SetHeader() { | 2252 void SetHeader() { |
| 2254 header.SetCmd<ValueType>(); | 2253 header.SetCmd<ValueType>(); |
| 2255 } | 2254 } |
| 2256 | 2255 |
| 2257 void Init(ResourceId _sampler_id) { | 2256 void Init(ResourceId _sampler_id) { |
| 2258 SetHeader(); | 2257 SetHeader(); |
| 2259 sampler_id = _sampler_id; | 2258 sampler_id = _sampler_id; |
| 2260 } | 2259 } |
| 2261 | 2260 |
| 2262 static void* Set(void* cmd, ResourceId sampler_id) { | 2261 static void* Set(void* cmd, ResourceId sampler_id) { |
| 2263 static_cast<ValueType*>(cmd)->Init(sampler_id); | 2262 static_cast<ValueType*>(cmd)->Init(sampler_id); |
| 2264 return NextCmdAddress<ValueType>(cmd); | 2263 return NextCmdAddress<ValueType>(cmd); |
| 2265 } | 2264 } |
| 2266 | 2265 |
| 2267 CommandHeader header; | 2266 CommandHeader header; |
| 2268 ResourceId sampler_id; | 2267 ResourceId sampler_id; |
| 2269 }; | 2268 }; |
| 2270 | 2269 |
| 2271 COMPILE_ASSERT(sizeof(CreateSampler) == 8, Sizeof_CreateSampler_is_not_8); | 2270 COMPILE_ASSERT(sizeof(CreateSampler) == 8, Sizeof_CreateSampler_is_not_8); |
| 2272 COMPILE_ASSERT(offsetof(CreateSampler, header) == 0, | 2271 COMPILE_ASSERT(offsetof(CreateSampler, header) == 0, |
| 2273 OffsetOf_CreateSampler_header_not_0); | 2272 OffsetOf_CreateSampler_header_not_0); |
| 2274 COMPILE_ASSERT(offsetof(CreateSampler, sampler_id) == 4, | 2273 COMPILE_ASSERT(offsetof(CreateSampler, sampler_id) == 4, |
| 2275 OffsetOf_CreateSampler_sampler_id_not_4); | 2274 OffsetOf_CreateSampler_sampler_id_not_4); |
| 2276 | 2275 |
| 2277 struct DestroySampler { | 2276 struct DestroySampler { |
| 2278 typedef DestroySampler ValueType; | 2277 typedef DestroySampler ValueType; |
| 2279 static const CommandId kCmdId = command_buffer::kDestroySampler; | 2278 static const CommandId kCmdId = kDestroySampler; |
| 2280 static const ArgFlags kArgFlags = kFixed; | 2279 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2281 | 2280 |
| 2282 void SetHeader() { | 2281 void SetHeader() { |
| 2283 header.SetCmd<ValueType>(); | 2282 header.SetCmd<ValueType>(); |
| 2284 } | 2283 } |
| 2285 | 2284 |
| 2286 void Init(ResourceId _sampler_id) { | 2285 void Init(ResourceId _sampler_id) { |
| 2287 SetHeader(); | 2286 SetHeader(); |
| 2288 sampler_id = _sampler_id; | 2287 sampler_id = _sampler_id; |
| 2289 } | 2288 } |
| 2290 | 2289 |
| 2291 static void* Set(void* cmd, ResourceId sampler_id) { | 2290 static void* Set(void* cmd, ResourceId sampler_id) { |
| 2292 static_cast<ValueType*>(cmd)->Init(sampler_id); | 2291 static_cast<ValueType*>(cmd)->Init(sampler_id); |
| 2293 return NextCmdAddress<ValueType>(cmd); | 2292 return NextCmdAddress<ValueType>(cmd); |
| 2294 } | 2293 } |
| 2295 | 2294 |
| 2296 CommandHeader header; | 2295 CommandHeader header; |
| 2297 ResourceId sampler_id; | 2296 ResourceId sampler_id; |
| 2298 }; | 2297 }; |
| 2299 | 2298 |
| 2300 COMPILE_ASSERT(sizeof(DestroySampler) == 8, Sizeof_DestroySampler_is_not_8); | 2299 COMPILE_ASSERT(sizeof(DestroySampler) == 8, Sizeof_DestroySampler_is_not_8); |
| 2301 COMPILE_ASSERT(offsetof(DestroySampler, header) == 0, | 2300 COMPILE_ASSERT(offsetof(DestroySampler, header) == 0, |
| 2302 OffsetOf_DestroySampler_header_not_0); | 2301 OffsetOf_DestroySampler_header_not_0); |
| 2303 COMPILE_ASSERT(offsetof(DestroySampler, sampler_id) == 4, | 2302 COMPILE_ASSERT(offsetof(DestroySampler, sampler_id) == 4, |
| 2304 OffsetOf_DestroySampler_sampler_id_not_4); | 2303 OffsetOf_DestroySampler_sampler_id_not_4); |
| 2305 | 2304 |
| 2306 struct SetSamplerStates { | 2305 struct SetSamplerStates { |
| 2307 typedef SetSamplerStates ValueType; | 2306 typedef SetSamplerStates ValueType; |
| 2308 static const CommandId kCmdId = command_buffer::kSetSamplerStates; | 2307 static const CommandId kCmdId = kSetSamplerStates; |
| 2309 static const ArgFlags kArgFlags = kFixed; | 2308 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2310 | 2309 |
| 2311 // argument 2 | 2310 // argument 2 |
| 2312 typedef BitField<0, 3> AddressingU; | 2311 typedef BitField<0, 3> AddressingU; |
| 2313 typedef BitField<3, 3> AddressingV; | 2312 typedef BitField<3, 3> AddressingV; |
| 2314 typedef BitField<6, 3> AddressingW; | 2313 typedef BitField<6, 3> AddressingW; |
| 2315 typedef BitField<9, 3> MagFilter; | 2314 typedef BitField<9, 3> MagFilter; |
| 2316 typedef BitField<12, 3> MinFilter; | 2315 typedef BitField<12, 3> MinFilter; |
| 2317 typedef BitField<15, 3> MipFilter; | 2316 typedef BitField<15, 3> MipFilter; |
| 2318 typedef BitField<18, 6> Unused; | 2317 typedef BitField<18, 6> Unused; |
| 2319 typedef BitField<24, 8> MaxAnisotropy; | 2318 typedef BitField<24, 8> MaxAnisotropy; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 Sizeof_SetSamplerStates_is_not_12); | 2373 Sizeof_SetSamplerStates_is_not_12); |
| 2375 COMPILE_ASSERT(offsetof(SetSamplerStates, header) == 0, | 2374 COMPILE_ASSERT(offsetof(SetSamplerStates, header) == 0, |
| 2376 OffsetOf_SetSamplerStates_header_not_0); | 2375 OffsetOf_SetSamplerStates_header_not_0); |
| 2377 COMPILE_ASSERT(offsetof(SetSamplerStates, sampler_id) == 4, | 2376 COMPILE_ASSERT(offsetof(SetSamplerStates, sampler_id) == 4, |
| 2378 OffsetOf_SetSamplerStates_sampler_id_not_4); | 2377 OffsetOf_SetSamplerStates_sampler_id_not_4); |
| 2379 COMPILE_ASSERT(offsetof(SetSamplerStates, sampler_states) == 8, | 2378 COMPILE_ASSERT(offsetof(SetSamplerStates, sampler_states) == 8, |
| 2380 OffsetOf_SetSamplerStates_sampler_states_not_8); | 2379 OffsetOf_SetSamplerStates_sampler_states_not_8); |
| 2381 | 2380 |
| 2382 struct SetSamplerBorderColor { | 2381 struct SetSamplerBorderColor { |
| 2383 typedef SetSamplerBorderColor ValueType; | 2382 typedef SetSamplerBorderColor ValueType; |
| 2384 static const CommandId kCmdId = command_buffer::kSetSamplerBorderColor; | 2383 static const CommandId kCmdId = kSetSamplerBorderColor; |
| 2385 static const ArgFlags kArgFlags = kFixed; | 2384 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2386 | 2385 |
| 2387 void SetHeader() { | 2386 void SetHeader() { |
| 2388 header.SetCmd<ValueType>(); | 2387 header.SetCmd<ValueType>(); |
| 2389 } | 2388 } |
| 2390 | 2389 |
| 2391 void Init(ResourceId _sampler_id, | 2390 void Init(ResourceId _sampler_id, |
| 2392 float _red, float _green, float _blue, float _alpha) { | 2391 float _red, float _green, float _blue, float _alpha) { |
| 2393 SetHeader(); | 2392 SetHeader(); |
| 2394 sampler_id = _sampler_id; | 2393 sampler_id = _sampler_id; |
| 2395 red = _red; | 2394 red = _red; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2422 OffsetOf_SetSamplerBorderColor_red_not_8); | 2421 OffsetOf_SetSamplerBorderColor_red_not_8); |
| 2423 COMPILE_ASSERT(offsetof(SetSamplerBorderColor, blue) == 12, | 2422 COMPILE_ASSERT(offsetof(SetSamplerBorderColor, blue) == 12, |
| 2424 OffsetOf_SetSamplerBorderColor_blue_not_12); | 2423 OffsetOf_SetSamplerBorderColor_blue_not_12); |
| 2425 COMPILE_ASSERT(offsetof(SetSamplerBorderColor, green) == 16, | 2424 COMPILE_ASSERT(offsetof(SetSamplerBorderColor, green) == 16, |
| 2426 OffsetOf_SetSamplerBorderColor_green_not_16); | 2425 OffsetOf_SetSamplerBorderColor_green_not_16); |
| 2427 COMPILE_ASSERT(offsetof(SetSamplerBorderColor, alpha) == 20, | 2426 COMPILE_ASSERT(offsetof(SetSamplerBorderColor, alpha) == 20, |
| 2428 OffsetOf_SetSamplerBorderColor_alpha_not_20); | 2427 OffsetOf_SetSamplerBorderColor_alpha_not_20); |
| 2429 | 2428 |
| 2430 struct SetSamplerTexture { | 2429 struct SetSamplerTexture { |
| 2431 typedef SetSamplerTexture ValueType; | 2430 typedef SetSamplerTexture ValueType; |
| 2432 static const CommandId kCmdId = command_buffer::kSetSamplerTexture; | 2431 static const CommandId kCmdId = kSetSamplerTexture; |
| 2433 static const ArgFlags kArgFlags = kFixed; | 2432 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2434 | 2433 |
| 2435 void SetHeader() { | 2434 void SetHeader() { |
| 2436 header.SetCmd<ValueType>(); | 2435 header.SetCmd<ValueType>(); |
| 2437 } | 2436 } |
| 2438 | 2437 |
| 2439 void Init(ResourceId _sampler_id, ResourceId _texture_id) { | 2438 void Init(ResourceId _sampler_id, ResourceId _texture_id) { |
| 2440 SetHeader(); | 2439 SetHeader(); |
| 2441 sampler_id = _sampler_id; | 2440 sampler_id = _sampler_id; |
| 2442 texture_id = _texture_id; | 2441 texture_id = _texture_id; |
| 2443 } | 2442 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2456 Sizeof_SetSamplerTexture_is_not_12); | 2455 Sizeof_SetSamplerTexture_is_not_12); |
| 2457 COMPILE_ASSERT(offsetof(SetSamplerTexture, header) == 0, | 2456 COMPILE_ASSERT(offsetof(SetSamplerTexture, header) == 0, |
| 2458 OffsetOf_SetSamplerTexture_header_not_0); | 2457 OffsetOf_SetSamplerTexture_header_not_0); |
| 2459 COMPILE_ASSERT(offsetof(SetSamplerTexture, sampler_id) == 4, | 2458 COMPILE_ASSERT(offsetof(SetSamplerTexture, sampler_id) == 4, |
| 2460 OffsetOf_SetSamplerTexture_sampler_id_not_4); | 2459 OffsetOf_SetSamplerTexture_sampler_id_not_4); |
| 2461 COMPILE_ASSERT(offsetof(SetSamplerTexture, texture_id) == 8, | 2460 COMPILE_ASSERT(offsetof(SetSamplerTexture, texture_id) == 8, |
| 2462 OffsetOf_SetSamplerTexture_texture_id_not_8); | 2461 OffsetOf_SetSamplerTexture_texture_id_not_8); |
| 2463 | 2462 |
| 2464 struct SetScissor { | 2463 struct SetScissor { |
| 2465 typedef SetScissor ValueType; | 2464 typedef SetScissor ValueType; |
| 2466 static const CommandId kCmdId = command_buffer::kSetScissor; | 2465 static const CommandId kCmdId = kSetScissor; |
| 2467 static const ArgFlags kArgFlags = kFixed; | 2466 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2468 | 2467 |
| 2469 // argument 0 | 2468 // argument 0 |
| 2470 typedef BitField<0, 15> X; | 2469 typedef BitField<0, 15> X; |
| 2471 typedef BitField<15, 1> Unused; | 2470 typedef BitField<15, 1> Unused; |
| 2472 typedef BitField<16, 15> Y; | 2471 typedef BitField<16, 15> Y; |
| 2473 typedef BitField<31, 1> Enable; | 2472 typedef BitField<31, 1> Enable; |
| 2474 // argument 1 | 2473 // argument 1 |
| 2475 typedef BitField<0, 16> Width; | 2474 typedef BitField<0, 16> Width; |
| 2476 typedef BitField<16, 16> Height; | 2475 typedef BitField<16, 16> Height; |
| 2477 | 2476 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2517 COMPILE_ASSERT(sizeof(SetScissor) == 12, Sizeof_SetScissor_is_not_12); | 2516 COMPILE_ASSERT(sizeof(SetScissor) == 12, Sizeof_SetScissor_is_not_12); |
| 2518 COMPILE_ASSERT(offsetof(SetScissor, header) == 0, | 2517 COMPILE_ASSERT(offsetof(SetScissor, header) == 0, |
| 2519 OffsetOf_SetScissor_header_not_0); | 2518 OffsetOf_SetScissor_header_not_0); |
| 2520 COMPILE_ASSERT(offsetof(SetScissor, x_y_enable) == 4, | 2519 COMPILE_ASSERT(offsetof(SetScissor, x_y_enable) == 4, |
| 2521 OffsetOf_SetScissor_x_y_enable_not_4); | 2520 OffsetOf_SetScissor_x_y_enable_not_4); |
| 2522 COMPILE_ASSERT(offsetof(SetScissor, width_height) == 8, | 2521 COMPILE_ASSERT(offsetof(SetScissor, width_height) == 8, |
| 2523 OffsetOf_SetScissor_width_height_not_8); | 2522 OffsetOf_SetScissor_width_height_not_8); |
| 2524 | 2523 |
| 2525 struct SetPolygonOffset { | 2524 struct SetPolygonOffset { |
| 2526 typedef SetPolygonOffset ValueType; | 2525 typedef SetPolygonOffset ValueType; |
| 2527 static const CommandId kCmdId = command_buffer::kSetPolygonOffset; | 2526 static const CommandId kCmdId = kSetPolygonOffset; |
| 2528 static const ArgFlags kArgFlags = kFixed; | 2527 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2529 | 2528 |
| 2530 void SetHeader() { | 2529 void SetHeader() { |
| 2531 header.SetCmd<ValueType>(); | 2530 header.SetCmd<ValueType>(); |
| 2532 } | 2531 } |
| 2533 | 2532 |
| 2534 void Init(float _slope_factor, float _units) { | 2533 void Init(float _slope_factor, float _units) { |
| 2535 SetHeader(); | 2534 SetHeader(); |
| 2536 slope_factor = _slope_factor; | 2535 slope_factor = _slope_factor; |
| 2537 units = _units; | 2536 units = _units; |
| 2538 } | 2537 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2551 Sizeof_SetPolygonOffset_is_not_12); | 2550 Sizeof_SetPolygonOffset_is_not_12); |
| 2552 COMPILE_ASSERT(offsetof(SetPolygonOffset, header) == 0, | 2551 COMPILE_ASSERT(offsetof(SetPolygonOffset, header) == 0, |
| 2553 OffsetOf_SetPolygonOffset_header_not_0); | 2552 OffsetOf_SetPolygonOffset_header_not_0); |
| 2554 COMPILE_ASSERT(offsetof(SetPolygonOffset, slope_factor) == 4, | 2553 COMPILE_ASSERT(offsetof(SetPolygonOffset, slope_factor) == 4, |
| 2555 OffsetOf_SetPolygonOffset_slope_factor_not_4); | 2554 OffsetOf_SetPolygonOffset_slope_factor_not_4); |
| 2556 COMPILE_ASSERT(offsetof(SetPolygonOffset, units) == 8, | 2555 COMPILE_ASSERT(offsetof(SetPolygonOffset, units) == 8, |
| 2557 OffsetOf_SetPolygonOffset_units_not_8); | 2556 OffsetOf_SetPolygonOffset_units_not_8); |
| 2558 | 2557 |
| 2559 struct SetPointLineRaster { | 2558 struct SetPointLineRaster { |
| 2560 typedef SetPointLineRaster ValueType; | 2559 typedef SetPointLineRaster ValueType; |
| 2561 static const CommandId kCmdId = command_buffer::kSetPointLineRaster; | 2560 static const CommandId kCmdId = kSetPointLineRaster; |
| 2562 static const ArgFlags kArgFlags = kFixed; | 2561 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2563 | 2562 |
| 2564 // argument 0 | 2563 // argument 0 |
| 2565 typedef BitField<0, 1> LineSmoothEnable; | 2564 typedef BitField<0, 1> LineSmoothEnable; |
| 2566 typedef BitField<1, 1> PointSpriteEnable; | 2565 typedef BitField<1, 1> PointSpriteEnable; |
| 2567 typedef BitField<2, 30> Unused; | 2566 typedef BitField<2, 30> Unused; |
| 2568 | 2567 |
| 2569 void SetHeader() { | 2568 void SetHeader() { |
| 2570 header.SetCmd<ValueType>(); | 2569 header.SetCmd<ValueType>(); |
| 2571 } | 2570 } |
| 2572 | 2571 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2596 Sizeof_SetPointLineRaster_is_not_12); | 2595 Sizeof_SetPointLineRaster_is_not_12); |
| 2597 COMPILE_ASSERT(offsetof(SetPointLineRaster, header) == 0, | 2596 COMPILE_ASSERT(offsetof(SetPointLineRaster, header) == 0, |
| 2598 OffsetOf_SetPointLineRaster_header_not_0); | 2597 OffsetOf_SetPointLineRaster_header_not_0); |
| 2599 COMPILE_ASSERT(offsetof(SetPointLineRaster, enables) == 4, | 2598 COMPILE_ASSERT(offsetof(SetPointLineRaster, enables) == 4, |
| 2600 OffsetOf_SetPointLineRaster_enables_not_4); | 2599 OffsetOf_SetPointLineRaster_enables_not_4); |
| 2601 COMPILE_ASSERT(offsetof(SetPointLineRaster, point_size) == 8, | 2600 COMPILE_ASSERT(offsetof(SetPointLineRaster, point_size) == 8, |
| 2602 OffsetOf_SetPointLineRaster_point_size_not_8); | 2601 OffsetOf_SetPointLineRaster_point_size_not_8); |
| 2603 | 2602 |
| 2604 struct SetPolygonRaster { | 2603 struct SetPolygonRaster { |
| 2605 typedef SetPolygonRaster ValueType; | 2604 typedef SetPolygonRaster ValueType; |
| 2606 static const CommandId kCmdId = command_buffer::kSetPolygonRaster; | 2605 static const CommandId kCmdId = kSetPolygonRaster; |
| 2607 static const ArgFlags kArgFlags = kFixed; | 2606 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2608 | 2607 |
| 2609 // argument 0 | 2608 // argument 0 |
| 2610 typedef BitField<0, 2> FillMode; | 2609 typedef BitField<0, 2> FillMode; |
| 2611 typedef BitField<2, 2> CullMode; | 2610 typedef BitField<2, 2> CullMode; |
| 2612 typedef BitField<4, 28> Unused; | 2611 typedef BitField<4, 28> Unused; |
| 2613 | 2612 |
| 2614 void SetHeader() { | 2613 void SetHeader() { |
| 2615 header.SetCmd<ValueType>(); | 2614 header.SetCmd<ValueType>(); |
| 2616 } | 2615 } |
| 2617 | 2616 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2633 | 2632 |
| 2634 COMPILE_ASSERT(sizeof(SetPolygonRaster) == 8, | 2633 COMPILE_ASSERT(sizeof(SetPolygonRaster) == 8, |
| 2635 Sizeof_SetPolygonRaster_is_not_8); | 2634 Sizeof_SetPolygonRaster_is_not_8); |
| 2636 COMPILE_ASSERT(offsetof(SetPolygonRaster, header) == 0, | 2635 COMPILE_ASSERT(offsetof(SetPolygonRaster, header) == 0, |
| 2637 OffsetOf_SetPolygonRaster_header_not_0); | 2636 OffsetOf_SetPolygonRaster_header_not_0); |
| 2638 COMPILE_ASSERT(offsetof(SetPolygonRaster, fill_cull) == 4, | 2637 COMPILE_ASSERT(offsetof(SetPolygonRaster, fill_cull) == 4, |
| 2639 OffsetOf_SetPolygonRaster_fill_cull_not_4); | 2638 OffsetOf_SetPolygonRaster_fill_cull_not_4); |
| 2640 | 2639 |
| 2641 struct SetAlphaTest { | 2640 struct SetAlphaTest { |
| 2642 typedef SetAlphaTest ValueType; | 2641 typedef SetAlphaTest ValueType; |
| 2643 static const CommandId kCmdId = command_buffer::kSetAlphaTest; | 2642 static const CommandId kCmdId = kSetAlphaTest; |
| 2644 static const ArgFlags kArgFlags = kFixed; | 2643 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2645 | 2644 |
| 2646 // argument 0 | 2645 // argument 0 |
| 2647 typedef BitField<0, 3> Func; | 2646 typedef BitField<0, 3> Func; |
| 2648 typedef BitField<3, 28> Unused; | 2647 typedef BitField<3, 28> Unused; |
| 2649 typedef BitField<31, 1> Enable; | 2648 typedef BitField<31, 1> Enable; |
| 2650 | 2649 |
| 2651 void SetHeader() { | 2650 void SetHeader() { |
| 2652 header.SetCmd<ValueType>(); | 2651 header.SetCmd<ValueType>(); |
| 2653 } | 2652 } |
| 2654 | 2653 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2672 COMPILE_ASSERT(sizeof(SetAlphaTest) == 12, Sizeof_SetAlphaTest_is_not_12); | 2671 COMPILE_ASSERT(sizeof(SetAlphaTest) == 12, Sizeof_SetAlphaTest_is_not_12); |
| 2673 COMPILE_ASSERT(offsetof(SetAlphaTest, header) == 0, | 2672 COMPILE_ASSERT(offsetof(SetAlphaTest, header) == 0, |
| 2674 OffsetOf_SetAlphaTest_header_not_0); | 2673 OffsetOf_SetAlphaTest_header_not_0); |
| 2675 COMPILE_ASSERT(offsetof(SetAlphaTest, func_enable) == 4, | 2674 COMPILE_ASSERT(offsetof(SetAlphaTest, func_enable) == 4, |
| 2676 OffsetOf_SetAlphaTest_func_enable_not_4); | 2675 OffsetOf_SetAlphaTest_func_enable_not_4); |
| 2677 COMPILE_ASSERT(offsetof(SetAlphaTest, value) == 8, | 2676 COMPILE_ASSERT(offsetof(SetAlphaTest, value) == 8, |
| 2678 OffsetOf_SetAlphaTest_value_not_8); | 2677 OffsetOf_SetAlphaTest_value_not_8); |
| 2679 | 2678 |
| 2680 struct SetDepthTest { | 2679 struct SetDepthTest { |
| 2681 typedef SetDepthTest ValueType; | 2680 typedef SetDepthTest ValueType; |
| 2682 static const CommandId kCmdId = command_buffer::kSetDepthTest; | 2681 static const CommandId kCmdId = kSetDepthTest; |
| 2683 static const ArgFlags kArgFlags = kFixed; | 2682 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2684 | 2683 |
| 2685 // argument 0 | 2684 // argument 0 |
| 2686 typedef BitField<0, 3> Func; | 2685 typedef BitField<0, 3> Func; |
| 2687 typedef BitField<3, 27> Unused; | 2686 typedef BitField<3, 27> Unused; |
| 2688 typedef BitField<30, 1> WriteEnable; | 2687 typedef BitField<30, 1> WriteEnable; |
| 2689 typedef BitField<31, 1> Enable; | 2688 typedef BitField<31, 1> Enable; |
| 2690 | 2689 |
| 2691 void SetHeader() { | 2690 void SetHeader() { |
| 2692 header.SetCmd<ValueType>(); | 2691 header.SetCmd<ValueType>(); |
| 2693 } | 2692 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2712 }; | 2711 }; |
| 2713 | 2712 |
| 2714 COMPILE_ASSERT(sizeof(SetDepthTest) == 8, Sizeof_SetDepthTest_is_not_8); | 2713 COMPILE_ASSERT(sizeof(SetDepthTest) == 8, Sizeof_SetDepthTest_is_not_8); |
| 2715 COMPILE_ASSERT(offsetof(SetDepthTest, header) == 0, | 2714 COMPILE_ASSERT(offsetof(SetDepthTest, header) == 0, |
| 2716 OffsetOf_SetDepthTest_header_not_0); | 2715 OffsetOf_SetDepthTest_header_not_0); |
| 2717 COMPILE_ASSERT(offsetof(SetDepthTest, func_enable) == 4, | 2716 COMPILE_ASSERT(offsetof(SetDepthTest, func_enable) == 4, |
| 2718 OffsetOf_SetDepthTest_func_enable_not_4); | 2717 OffsetOf_SetDepthTest_func_enable_not_4); |
| 2719 | 2718 |
| 2720 struct SetStencilTest { | 2719 struct SetStencilTest { |
| 2721 typedef SetStencilTest ValueType; | 2720 typedef SetStencilTest ValueType; |
| 2722 static const CommandId kCmdId = command_buffer::kSetStencilTest; | 2721 static const CommandId kCmdId = kSetStencilTest; |
| 2723 static const ArgFlags kArgFlags = kFixed; | 2722 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2724 | 2723 |
| 2725 // argument 0 | 2724 // argument 0 |
| 2726 typedef BitField<0, 8> WriteMask; | 2725 typedef BitField<0, 8> WriteMask; |
| 2727 typedef BitField<8, 8> CompareMask; | 2726 typedef BitField<8, 8> CompareMask; |
| 2728 typedef BitField<16, 8> ReferenceValue; | 2727 typedef BitField<16, 8> ReferenceValue; |
| 2729 typedef BitField<24, 6> Unused0; | 2728 typedef BitField<24, 6> Unused0; |
| 2730 typedef BitField<30, 1> SeparateCCW; | 2729 typedef BitField<30, 1> SeparateCCW; |
| 2731 typedef BitField<31, 1> Enable; | 2730 typedef BitField<31, 1> Enable; |
| 2732 // argument 1 | 2731 // argument 1 |
| 2733 typedef BitField<0, 3> CWFunc; | 2732 typedef BitField<0, 3> CWFunc; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2818 Sizeof_SetStencilTest_is_not_12); | 2817 Sizeof_SetStencilTest_is_not_12); |
| 2819 COMPILE_ASSERT(offsetof(SetStencilTest, header) == 0, | 2818 COMPILE_ASSERT(offsetof(SetStencilTest, header) == 0, |
| 2820 OffsetOf_SetStencilTest_header_not_0); | 2819 OffsetOf_SetStencilTest_header_not_0); |
| 2821 COMPILE_ASSERT(offsetof(SetStencilTest, stencil_args0) == 4, | 2820 COMPILE_ASSERT(offsetof(SetStencilTest, stencil_args0) == 4, |
| 2822 OffsetOf_SetStencilTest_stencil_args0_not_4); | 2821 OffsetOf_SetStencilTest_stencil_args0_not_4); |
| 2823 COMPILE_ASSERT(offsetof(SetStencilTest, stencil_args1) == 8, | 2822 COMPILE_ASSERT(offsetof(SetStencilTest, stencil_args1) == 8, |
| 2824 OffsetOf_SetStencilTest_stencil_args1_not_8); | 2823 OffsetOf_SetStencilTest_stencil_args1_not_8); |
| 2825 | 2824 |
| 2826 struct SetColorWrite { | 2825 struct SetColorWrite { |
| 2827 typedef SetColorWrite ValueType; | 2826 typedef SetColorWrite ValueType; |
| 2828 static const CommandId kCmdId = command_buffer::kSetColorWrite; | 2827 static const CommandId kCmdId = kSetColorWrite; |
| 2829 static const ArgFlags kArgFlags = kFixed; | 2828 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2830 | 2829 |
| 2831 // argument 0 | 2830 // argument 0 |
| 2832 typedef BitField<0, 1> RedMask; | 2831 typedef BitField<0, 1> RedMask; |
| 2833 typedef BitField<1, 1> GreenMask; | 2832 typedef BitField<1, 1> GreenMask; |
| 2834 typedef BitField<2, 1> BlueMask; | 2833 typedef BitField<2, 1> BlueMask; |
| 2835 typedef BitField<3, 1> AlphaMask; | 2834 typedef BitField<3, 1> AlphaMask; |
| 2836 typedef BitField<0, 4> AllColorsMask; // alias for RGBA | 2835 typedef BitField<0, 4> AllColorsMask; // alias for RGBA |
| 2837 typedef BitField<4, 27> Unused; | 2836 typedef BitField<4, 27> Unused; |
| 2838 typedef BitField<31, 1> DitherEnable; | 2837 typedef BitField<31, 1> DitherEnable; |
| 2839 | 2838 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2861 }; | 2860 }; |
| 2862 | 2861 |
| 2863 COMPILE_ASSERT(sizeof(SetColorWrite) == 8, Sizeof_SetColorWrite_is_not_8); | 2862 COMPILE_ASSERT(sizeof(SetColorWrite) == 8, Sizeof_SetColorWrite_is_not_8); |
| 2864 COMPILE_ASSERT(offsetof(SetColorWrite, header) == 0, | 2863 COMPILE_ASSERT(offsetof(SetColorWrite, header) == 0, |
| 2865 OffsetOf_SetColorWrite_header_not_0); | 2864 OffsetOf_SetColorWrite_header_not_0); |
| 2866 COMPILE_ASSERT(offsetof(SetColorWrite, flags) == 4, | 2865 COMPILE_ASSERT(offsetof(SetColorWrite, flags) == 4, |
| 2867 OffsetOf_SetColorWrite_flags_not_4); | 2866 OffsetOf_SetColorWrite_flags_not_4); |
| 2868 | 2867 |
| 2869 struct SetBlending { | 2868 struct SetBlending { |
| 2870 typedef SetBlending ValueType; | 2869 typedef SetBlending ValueType; |
| 2871 static const CommandId kCmdId = command_buffer::kSetBlending; | 2870 static const CommandId kCmdId = kSetBlending; |
| 2872 static const ArgFlags kArgFlags = kFixed; | 2871 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2873 | 2872 |
| 2874 // argument 0 | 2873 // argument 0 |
| 2875 typedef BitField<0, 4> ColorSrcFunc; | 2874 typedef BitField<0, 4> ColorSrcFunc; |
| 2876 typedef BitField<4, 4> ColorDstFunc; | 2875 typedef BitField<4, 4> ColorDstFunc; |
| 2877 typedef BitField<8, 3> ColorEq; | 2876 typedef BitField<8, 3> ColorEq; |
| 2878 typedef BitField<11, 5> Unused0; | 2877 typedef BitField<11, 5> Unused0; |
| 2879 typedef BitField<16, 4> AlphaSrcFunc; | 2878 typedef BitField<16, 4> AlphaSrcFunc; |
| 2880 typedef BitField<20, 4> AlphaDstFunc; | 2879 typedef BitField<20, 4> AlphaDstFunc; |
| 2881 typedef BitField<24, 3> AlphaEq; | 2880 typedef BitField<24, 3> AlphaEq; |
| 2882 typedef BitField<27, 3> Unused1; | 2881 typedef BitField<27, 3> Unused1; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2936 }; | 2935 }; |
| 2937 | 2936 |
| 2938 COMPILE_ASSERT(sizeof(SetBlending) == 8, Sizeof_SetBlending_is_not_8); | 2937 COMPILE_ASSERT(sizeof(SetBlending) == 8, Sizeof_SetBlending_is_not_8); |
| 2939 COMPILE_ASSERT(offsetof(SetBlending, header) == 0, | 2938 COMPILE_ASSERT(offsetof(SetBlending, header) == 0, |
| 2940 OffsetOf_SetBlending_header_not_0); | 2939 OffsetOf_SetBlending_header_not_0); |
| 2941 COMPILE_ASSERT(offsetof(SetBlending, blend_settings) == 4, | 2940 COMPILE_ASSERT(offsetof(SetBlending, blend_settings) == 4, |
| 2942 OffsetOf_SetBlending_blend_settings_not_4); | 2941 OffsetOf_SetBlending_blend_settings_not_4); |
| 2943 | 2942 |
| 2944 struct SetBlendingColor { | 2943 struct SetBlendingColor { |
| 2945 typedef SetBlendingColor ValueType; | 2944 typedef SetBlendingColor ValueType; |
| 2946 static const CommandId kCmdId = command_buffer::kSetBlendingColor; | 2945 static const CommandId kCmdId = kSetBlendingColor; |
| 2947 static const ArgFlags kArgFlags = kFixed; | 2946 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2948 | 2947 |
| 2949 void SetHeader() { | 2948 void SetHeader() { |
| 2950 header.SetCmd<ValueType>(); | 2949 header.SetCmd<ValueType>(); |
| 2951 } | 2950 } |
| 2952 | 2951 |
| 2953 void Init(float _red, float _green, float _blue, float _alpha) { | 2952 void Init(float _red, float _green, float _blue, float _alpha) { |
| 2954 SetHeader(); | 2953 SetHeader(); |
| 2955 red = _red; | 2954 red = _red; |
| 2956 green = _green; | 2955 green = _green; |
| 2957 blue = _blue; | 2956 blue = _blue; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2979 OffsetOf_SetBlendingColor_red_not_4); | 2978 OffsetOf_SetBlendingColor_red_not_4); |
| 2980 COMPILE_ASSERT(offsetof(SetBlendingColor, blue) == 8, | 2979 COMPILE_ASSERT(offsetof(SetBlendingColor, blue) == 8, |
| 2981 OffsetOf_SetBlendingColor_blue_not_8); | 2980 OffsetOf_SetBlendingColor_blue_not_8); |
| 2982 COMPILE_ASSERT(offsetof(SetBlendingColor, green) == 12, | 2981 COMPILE_ASSERT(offsetof(SetBlendingColor, green) == 12, |
| 2983 OffsetOf_SetBlendingColor_green_not_12); | 2982 OffsetOf_SetBlendingColor_green_not_12); |
| 2984 COMPILE_ASSERT(offsetof(SetBlendingColor, alpha) == 16, | 2983 COMPILE_ASSERT(offsetof(SetBlendingColor, alpha) == 16, |
| 2985 OffsetOf_SetBlendingColor_alpha_not_16); | 2984 OffsetOf_SetBlendingColor_alpha_not_16); |
| 2986 | 2985 |
| 2987 struct CreateRenderSurface { | 2986 struct CreateRenderSurface { |
| 2988 typedef CreateRenderSurface ValueType; | 2987 typedef CreateRenderSurface ValueType; |
| 2989 static const CommandId kCmdId = command_buffer::kCreateRenderSurface; | 2988 static const CommandId kCmdId = kCreateRenderSurface; |
| 2990 static const ArgFlags kArgFlags = kFixed; | 2989 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 2991 | 2990 |
| 2992 // argument 1 | 2991 // argument 1 |
| 2993 typedef BitField<0, 16> Width; | 2992 typedef BitField<0, 16> Width; |
| 2994 typedef BitField<16, 16> Height; | 2993 typedef BitField<16, 16> Height; |
| 2995 // argument 2 may refer to side or depth | 2994 // argument 2 may refer to side or depth |
| 2996 typedef BitField<0, 16> Levels; | 2995 typedef BitField<0, 16> Levels; |
| 2997 typedef BitField<16, 16> Side; | 2996 typedef BitField<16, 16> Side; |
| 2998 | 2997 |
| 2999 void SetHeader() { | 2998 void SetHeader() { |
| 3000 header.SetCmd<ValueType>(); | 2999 header.SetCmd<ValueType>(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3038 OffsetOf_CreateRenderSurface_render_surface_id_not_4); | 3037 OffsetOf_CreateRenderSurface_render_surface_id_not_4); |
| 3039 COMPILE_ASSERT(offsetof(CreateRenderSurface, width_height) == 8, | 3038 COMPILE_ASSERT(offsetof(CreateRenderSurface, width_height) == 8, |
| 3040 OffsetOf_CreateRenderSurface_width_height_not_8); | 3039 OffsetOf_CreateRenderSurface_width_height_not_8); |
| 3041 COMPILE_ASSERT(offsetof(CreateRenderSurface, levels_side) == 12, | 3040 COMPILE_ASSERT(offsetof(CreateRenderSurface, levels_side) == 12, |
| 3042 OffsetOf_CreateRenderSurface_levels_side_not_12); | 3041 OffsetOf_CreateRenderSurface_levels_side_not_12); |
| 3043 COMPILE_ASSERT(offsetof(CreateRenderSurface, texture_id) == 16, | 3042 COMPILE_ASSERT(offsetof(CreateRenderSurface, texture_id) == 16, |
| 3044 OffsetOf_CreateRenderSurface_texture_id_not_16); | 3043 OffsetOf_CreateRenderSurface_texture_id_not_16); |
| 3045 | 3044 |
| 3046 struct DestroyRenderSurface { | 3045 struct DestroyRenderSurface { |
| 3047 typedef DestroyRenderSurface ValueType; | 3046 typedef DestroyRenderSurface ValueType; |
| 3048 static const CommandId kCmdId = command_buffer::kDestroyRenderSurface; | 3047 static const CommandId kCmdId = kDestroyRenderSurface; |
| 3049 static const ArgFlags kArgFlags = kFixed; | 3048 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 3050 | 3049 |
| 3051 void SetHeader() { | 3050 void SetHeader() { |
| 3052 header.SetCmd<ValueType>(); | 3051 header.SetCmd<ValueType>(); |
| 3053 } | 3052 } |
| 3054 | 3053 |
| 3055 void Init(ResourceId _render_surface_id) { | 3054 void Init(ResourceId _render_surface_id) { |
| 3056 SetHeader(); | 3055 SetHeader(); |
| 3057 render_surface_id = _render_surface_id; | 3056 render_surface_id = _render_surface_id; |
| 3058 } | 3057 } |
| 3059 | 3058 |
| 3060 static void* Set(void* cmd, ResourceId render_surface_id) { | 3059 static void* Set(void* cmd, ResourceId render_surface_id) { |
| 3061 static_cast<ValueType*>(cmd)->Init(render_surface_id); | 3060 static_cast<ValueType*>(cmd)->Init(render_surface_id); |
| 3062 return NextCmdAddress<ValueType>(cmd); | 3061 return NextCmdAddress<ValueType>(cmd); |
| 3063 } | 3062 } |
| 3064 | 3063 |
| 3065 CommandHeader header; | 3064 CommandHeader header; |
| 3066 ResourceId render_surface_id; | 3065 ResourceId render_surface_id; |
| 3067 }; | 3066 }; |
| 3068 | 3067 |
| 3069 COMPILE_ASSERT(sizeof(DestroyRenderSurface) == 8, | 3068 COMPILE_ASSERT(sizeof(DestroyRenderSurface) == 8, |
| 3070 Sizeof_DestroyRenderSurface_is_not_8); | 3069 Sizeof_DestroyRenderSurface_is_not_8); |
| 3071 COMPILE_ASSERT(offsetof(DestroyRenderSurface, header) == 0, | 3070 COMPILE_ASSERT(offsetof(DestroyRenderSurface, header) == 0, |
| 3072 OffsetOf_DestroyRenderSurface_header_not_0); | 3071 OffsetOf_DestroyRenderSurface_header_not_0); |
| 3073 COMPILE_ASSERT(offsetof(DestroyRenderSurface, render_surface_id) == 4, | 3072 COMPILE_ASSERT(offsetof(DestroyRenderSurface, render_surface_id) == 4, |
| 3074 OffsetOf_DestroyRenderSurface_render_surface_id_not_4); | 3073 OffsetOf_DestroyRenderSurface_render_surface_id_not_4); |
| 3075 | 3074 |
| 3076 struct CreateDepthSurface { | 3075 struct CreateDepthSurface { |
| 3077 typedef CreateDepthSurface ValueType; | 3076 typedef CreateDepthSurface ValueType; |
| 3078 static const CommandId kCmdId = command_buffer::kCreateDepthSurface; | 3077 static const CommandId kCmdId = kCreateDepthSurface; |
| 3079 static const ArgFlags kArgFlags = kFixed; | 3078 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 3080 | 3079 |
| 3081 // argument 1 | 3080 // argument 1 |
| 3082 typedef BitField<0, 16> Width; | 3081 typedef BitField<0, 16> Width; |
| 3083 typedef BitField<16, 16> Height; | 3082 typedef BitField<16, 16> Height; |
| 3084 | 3083 |
| 3085 void SetHeader() { | 3084 void SetHeader() { |
| 3086 header.SetCmd<ValueType>(); | 3085 header.SetCmd<ValueType>(); |
| 3087 } | 3086 } |
| 3088 | 3087 |
| 3089 void Init(ResourceId _depth_surface_id, uint32 _width, uint32 _height) { | 3088 void Init(ResourceId _depth_surface_id, uint32 _width, uint32 _height) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3108 Sizeof_CreateDepthSurface_is_not_12); | 3107 Sizeof_CreateDepthSurface_is_not_12); |
| 3109 COMPILE_ASSERT(offsetof(CreateDepthSurface, header) == 0, | 3108 COMPILE_ASSERT(offsetof(CreateDepthSurface, header) == 0, |
| 3110 OffsetOf_CreateDepthSurface_header_not_0); | 3109 OffsetOf_CreateDepthSurface_header_not_0); |
| 3111 COMPILE_ASSERT(offsetof(CreateDepthSurface, depth_surface_id) == 4, | 3110 COMPILE_ASSERT(offsetof(CreateDepthSurface, depth_surface_id) == 4, |
| 3112 OffsetOf_CreateDepthSurface_depth_surface_id_not_4); | 3111 OffsetOf_CreateDepthSurface_depth_surface_id_not_4); |
| 3113 COMPILE_ASSERT(offsetof(CreateDepthSurface, width_height) == 8, | 3112 COMPILE_ASSERT(offsetof(CreateDepthSurface, width_height) == 8, |
| 3114 OffsetOf_CreateDepthSurface_width_height_not_8); | 3113 OffsetOf_CreateDepthSurface_width_height_not_8); |
| 3115 | 3114 |
| 3116 struct DestroyDepthSurface { | 3115 struct DestroyDepthSurface { |
| 3117 typedef DestroyDepthSurface ValueType; | 3116 typedef DestroyDepthSurface ValueType; |
| 3118 static const CommandId kCmdId = command_buffer::kDestroyDepthSurface; | 3117 static const CommandId kCmdId = kDestroyDepthSurface; |
| 3119 static const ArgFlags kArgFlags = kFixed; | 3118 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 3120 | 3119 |
| 3121 void SetHeader() { | 3120 void SetHeader() { |
| 3122 header.SetCmd<ValueType>(); | 3121 header.SetCmd<ValueType>(); |
| 3123 } | 3122 } |
| 3124 | 3123 |
| 3125 void Init(ResourceId _depth_surface_id) { | 3124 void Init(ResourceId _depth_surface_id) { |
| 3126 SetHeader(); | 3125 SetHeader(); |
| 3127 depth_surface_id = _depth_surface_id; | 3126 depth_surface_id = _depth_surface_id; |
| 3128 } | 3127 } |
| 3129 | 3128 |
| 3130 static void* Set(void* cmd, ResourceId depth_surface_id) { | 3129 static void* Set(void* cmd, ResourceId depth_surface_id) { |
| 3131 static_cast<ValueType*>(cmd)->Init(depth_surface_id); | 3130 static_cast<ValueType*>(cmd)->Init(depth_surface_id); |
| 3132 return NextCmdAddress<ValueType>(cmd); | 3131 return NextCmdAddress<ValueType>(cmd); |
| 3133 } | 3132 } |
| 3134 | 3133 |
| 3135 CommandHeader header; | 3134 CommandHeader header; |
| 3136 ResourceId depth_surface_id; | 3135 ResourceId depth_surface_id; |
| 3137 }; | 3136 }; |
| 3138 | 3137 |
| 3139 COMPILE_ASSERT(sizeof(DestroyDepthSurface) == 8, | 3138 COMPILE_ASSERT(sizeof(DestroyDepthSurface) == 8, |
| 3140 Sizeof_DestroyDepthSurface_is_not_8); | 3139 Sizeof_DestroyDepthSurface_is_not_8); |
| 3141 COMPILE_ASSERT(offsetof(DestroyDepthSurface, header) == 0, | 3140 COMPILE_ASSERT(offsetof(DestroyDepthSurface, header) == 0, |
| 3142 OffsetOf_DestroyDepthSurface_header_not_0); | 3141 OffsetOf_DestroyDepthSurface_header_not_0); |
| 3143 COMPILE_ASSERT(offsetof(DestroyDepthSurface, depth_surface_id) == 4, | 3142 COMPILE_ASSERT(offsetof(DestroyDepthSurface, depth_surface_id) == 4, |
| 3144 OffsetOf_DestroyDepthdepth_surface_id_not_4); | 3143 OffsetOf_DestroyDepthdepth_surface_id_not_4); |
| 3145 | 3144 |
| 3146 struct SetRenderSurface { | 3145 struct SetRenderSurface { |
| 3147 typedef SetRenderSurface ValueType; | 3146 typedef SetRenderSurface ValueType; |
| 3148 static const CommandId kCmdId = command_buffer::kSetRenderSurface; | 3147 static const CommandId kCmdId = kSetRenderSurface; |
| 3149 static const ArgFlags kArgFlags = kFixed; | 3148 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 3150 | 3149 |
| 3151 void SetHeader() { | 3150 void SetHeader() { |
| 3152 header.SetCmd<ValueType>(); | 3151 header.SetCmd<ValueType>(); |
| 3153 } | 3152 } |
| 3154 | 3153 |
| 3155 void Init(ResourceId _render_surface_id, ResourceId _depth_surface_id) { | 3154 void Init(ResourceId _render_surface_id, ResourceId _depth_surface_id) { |
| 3156 SetHeader(); | 3155 SetHeader(); |
| 3157 render_surface_id = _render_surface_id; | 3156 render_surface_id = _render_surface_id; |
| 3158 depth_surface_id = _depth_surface_id; | 3157 depth_surface_id = _depth_surface_id; |
| 3159 } | 3158 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3173 Sizeof_SetRenderSurface_is_not_12); | 3172 Sizeof_SetRenderSurface_is_not_12); |
| 3174 COMPILE_ASSERT(offsetof(SetRenderSurface, header) == 0, | 3173 COMPILE_ASSERT(offsetof(SetRenderSurface, header) == 0, |
| 3175 OffsetOf_SetRenderSurface_header_not_0); | 3174 OffsetOf_SetRenderSurface_header_not_0); |
| 3176 COMPILE_ASSERT(offsetof(SetRenderSurface, render_surface_id) == 4, | 3175 COMPILE_ASSERT(offsetof(SetRenderSurface, render_surface_id) == 4, |
| 3177 OffsetOf_SetRenderSurface_render_surface_id_not_4); | 3176 OffsetOf_SetRenderSurface_render_surface_id_not_4); |
| 3178 COMPILE_ASSERT(offsetof(SetRenderSurface, depth_surface_id) == 8, | 3177 COMPILE_ASSERT(offsetof(SetRenderSurface, depth_surface_id) == 8, |
| 3179 OffsetOf_SetRenderSurface_depth_surface_id_not_8); | 3178 OffsetOf_SetRenderSurface_depth_surface_id_not_8); |
| 3180 | 3179 |
| 3181 struct SetBackSurfaces { | 3180 struct SetBackSurfaces { |
| 3182 typedef SetBackSurfaces ValueType; | 3181 typedef SetBackSurfaces ValueType; |
| 3183 static const CommandId kCmdId = command_buffer::kSetBackSurfaces; | 3182 static const CommandId kCmdId = kSetBackSurfaces; |
| 3184 static const ArgFlags kArgFlags = kFixed; | 3183 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| 3185 | 3184 |
| 3186 void SetHeader() { | 3185 void SetHeader() { |
| 3187 header.SetCmd<ValueType>(); | 3186 header.SetCmd<ValueType>(); |
| 3188 } | 3187 } |
| 3189 | 3188 |
| 3190 void Init() { | 3189 void Init() { |
| 3191 SetHeader(); | 3190 SetHeader(); |
| 3192 } | 3191 } |
| 3193 | 3192 |
| 3194 static void* Set(void* cmd) { | 3193 static void* Set(void* cmd) { |
| 3195 static_cast<ValueType*>(cmd)->Init(); | 3194 static_cast<ValueType*>(cmd)->Init(); |
| 3196 return NextCmdAddress<ValueType>(cmd); | 3195 return NextCmdAddress<ValueType>(cmd); |
| 3197 } | 3196 } |
| 3198 | 3197 |
| 3199 CommandHeader header; | 3198 CommandHeader header; |
| 3200 }; | 3199 }; |
| 3201 | 3200 |
| 3202 COMPILE_ASSERT(sizeof(SetBackSurfaces) == 4, | 3201 COMPILE_ASSERT(sizeof(SetBackSurfaces) == 4, |
| 3203 Sizeof_SetBackSurfaces_is_not_4); | 3202 Sizeof_SetBackSurfaces_is_not_4); |
| 3204 COMPILE_ASSERT(offsetof(SetBackSurfaces, header) == 0, | 3203 COMPILE_ASSERT(offsetof(SetBackSurfaces, header) == 0, |
| 3205 OffsetOf_SetBackSurfaces_header_not_0); | 3204 OffsetOf_SetBackSurfaces_header_not_0); |
| 3206 | 3205 |
| 3207 O3D_POP_STRUCTURE_PACKING; | 3206 O3D_POP_STRUCTURE_PACKING; |
| 3208 | 3207 |
| 3209 } // namespace o3d | 3208 } // namespace o3d |
| 3210 } // namespace command_buffer | 3209 } // namespace command_buffer |
| 3211 } // namespace o3d | 3210 } // namespace o3d |
| 3212 | 3211 |
| 3213 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ | 3212 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ |
| OLD | NEW |