| // This file is auto-generated. DO NOT EDIT! |
| |
| #pragma pack(push, 1) |
| |
| struct ActiveTexture { |
| typedef ActiveTexture ValueType; |
| static const CommandId kCmdId = kActiveTexture; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _texture) { |
| SetHeader(); |
| texture = _texture; |
| } |
| |
| void* Set(void* cmd, GLenum _texture) { |
| static_cast<ValueType*>(cmd)->Init(_texture); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 texture; |
| }; |
| |
| COMPILE_ASSERT(sizeof(ActiveTexture) == 8, |
| Sizeof_ActiveTexture_is_not_8); |
| COMPILE_ASSERT(offsetof(ActiveTexture, header) == 0, |
| OffsetOf_ActiveTexture_header_not_0); |
| COMPILE_ASSERT(offsetof(ActiveTexture, texture) == 4, |
| OffsetOf_ActiveTexture_texture_not_4); |
| |
| struct AttachShader { |
| typedef AttachShader ValueType; |
| static const CommandId kCmdId = kAttachShader; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _program, GLuint _shader) { |
| SetHeader(); |
| program = _program; |
| shader = _shader; |
| } |
| |
| void* Set(void* cmd, GLuint _program, GLuint _shader) { |
| static_cast<ValueType*>(cmd)->Init(_program, _shader); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 program; |
| uint32 shader; |
| }; |
| |
| COMPILE_ASSERT(sizeof(AttachShader) == 12, |
| Sizeof_AttachShader_is_not_12); |
| COMPILE_ASSERT(offsetof(AttachShader, header) == 0, |
| OffsetOf_AttachShader_header_not_0); |
| COMPILE_ASSERT(offsetof(AttachShader, program) == 4, |
| OffsetOf_AttachShader_program_not_4); |
| COMPILE_ASSERT(offsetof(AttachShader, shader) == 8, |
| OffsetOf_AttachShader_shader_not_8); |
| |
| struct BindAttribLocation { |
| typedef BindAttribLocation ValueType; |
| static const CommandId kCmdId = kBindAttribLocation; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLuint _program, GLuint _index, uint32 _name_shm_id, |
| uint32 _name_shm_offset, uint32 _data_size) { |
| SetHeader(); |
| program = _program; |
| index = _index; |
| name_shm_id = _name_shm_id; |
| name_shm_offset = _name_shm_offset; |
| data_size = _data_size; |
| } |
| |
| void* Set( |
| void* cmd, GLuint _program, GLuint _index, uint32 _name_shm_id, |
| uint32 _name_shm_offset, uint32 _data_size) { |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _program, _index, _name_shm_id, _name_shm_offset, _data_size); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 program; |
| uint32 index; |
| uint32 name_shm_id; |
| uint32 name_shm_offset; |
| uint32 data_size; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BindAttribLocation) == 24, |
| Sizeof_BindAttribLocation_is_not_24); |
| COMPILE_ASSERT(offsetof(BindAttribLocation, header) == 0, |
| OffsetOf_BindAttribLocation_header_not_0); |
| COMPILE_ASSERT(offsetof(BindAttribLocation, program) == 4, |
| OffsetOf_BindAttribLocation_program_not_4); |
| COMPILE_ASSERT(offsetof(BindAttribLocation, index) == 8, |
| OffsetOf_BindAttribLocation_index_not_8); |
| COMPILE_ASSERT(offsetof(BindAttribLocation, name_shm_id) == 12, |
| OffsetOf_BindAttribLocation_name_shm_id_not_12); |
| COMPILE_ASSERT(offsetof(BindAttribLocation, name_shm_offset) == 16, |
| OffsetOf_BindAttribLocation_name_shm_offset_not_16); |
| COMPILE_ASSERT(offsetof(BindAttribLocation, data_size) == 20, |
| OffsetOf_BindAttribLocation_data_size_not_20); |
| |
| struct BindAttribLocationImmediate { |
| typedef BindAttribLocationImmediate ValueType; |
| static const CommandId kCmdId = kBindAttribLocationImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(const char* s) { |
| return strlen(s); |
| } |
| |
| static uint32 ComputeSize(const char* s) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(s)); // NOLINT |
| } |
| |
| void SetHeader(const char* s) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); |
| } |
| |
| void Init(GLuint _program, GLuint _index, const char* _name) { |
| SetHeader(_name); |
| program = _program; |
| index = _index; |
| data_size = strlen(_name); |
| memcpy(ImmediateDataAddress(this), _name, data_size); |
| } |
| |
| void* Set(void* cmd, GLuint _program, GLuint _index, const char* _name) { |
| static_cast<ValueType*>(cmd)->Init(_program, _index, _name); |
| const uint32 size = ComputeSize(_name); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 program; |
| uint32 index; |
| uint32 data_size; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BindAttribLocationImmediate) == 16, |
| Sizeof_BindAttribLocationImmediate_is_not_16); |
| COMPILE_ASSERT(offsetof(BindAttribLocationImmediate, header) == 0, |
| OffsetOf_BindAttribLocationImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(BindAttribLocationImmediate, program) == 4, |
| OffsetOf_BindAttribLocationImmediate_program_not_4); |
| COMPILE_ASSERT(offsetof(BindAttribLocationImmediate, index) == 8, |
| OffsetOf_BindAttribLocationImmediate_index_not_8); |
| COMPILE_ASSERT(offsetof(BindAttribLocationImmediate, data_size) == 12, |
| OffsetOf_BindAttribLocationImmediate_data_size_not_12); |
| |
| struct BindBuffer { |
| typedef BindBuffer ValueType; |
| static const CommandId kCmdId = kBindBuffer; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _target, GLuint _buffer) { |
| SetHeader(); |
| target = _target; |
| buffer = _buffer; |
| } |
| |
| void* Set(void* cmd, GLenum _target, GLuint _buffer) { |
| static_cast<ValueType*>(cmd)->Init(_target, _buffer); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 buffer; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BindBuffer) == 12, |
| Sizeof_BindBuffer_is_not_12); |
| COMPILE_ASSERT(offsetof(BindBuffer, header) == 0, |
| OffsetOf_BindBuffer_header_not_0); |
| COMPILE_ASSERT(offsetof(BindBuffer, target) == 4, |
| OffsetOf_BindBuffer_target_not_4); |
| COMPILE_ASSERT(offsetof(BindBuffer, buffer) == 8, |
| OffsetOf_BindBuffer_buffer_not_8); |
| |
| struct BindFramebuffer { |
| typedef BindFramebuffer ValueType; |
| static const CommandId kCmdId = kBindFramebuffer; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _target, GLuint _framebuffer) { |
| SetHeader(); |
| target = _target; |
| framebuffer = _framebuffer; |
| } |
| |
| void* Set(void* cmd, GLenum _target, GLuint _framebuffer) { |
| static_cast<ValueType*>(cmd)->Init(_target, _framebuffer); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 framebuffer; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BindFramebuffer) == 12, |
| Sizeof_BindFramebuffer_is_not_12); |
| COMPILE_ASSERT(offsetof(BindFramebuffer, header) == 0, |
| OffsetOf_BindFramebuffer_header_not_0); |
| COMPILE_ASSERT(offsetof(BindFramebuffer, target) == 4, |
| OffsetOf_BindFramebuffer_target_not_4); |
| COMPILE_ASSERT(offsetof(BindFramebuffer, framebuffer) == 8, |
| OffsetOf_BindFramebuffer_framebuffer_not_8); |
| |
| struct BindRenderbuffer { |
| typedef BindRenderbuffer ValueType; |
| static const CommandId kCmdId = kBindRenderbuffer; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _target, GLuint _renderbuffer) { |
| SetHeader(); |
| target = _target; |
| renderbuffer = _renderbuffer; |
| } |
| |
| void* Set(void* cmd, GLenum _target, GLuint _renderbuffer) { |
| static_cast<ValueType*>(cmd)->Init(_target, _renderbuffer); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 renderbuffer; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BindRenderbuffer) == 12, |
| Sizeof_BindRenderbuffer_is_not_12); |
| COMPILE_ASSERT(offsetof(BindRenderbuffer, header) == 0, |
| OffsetOf_BindRenderbuffer_header_not_0); |
| COMPILE_ASSERT(offsetof(BindRenderbuffer, target) == 4, |
| OffsetOf_BindRenderbuffer_target_not_4); |
| COMPILE_ASSERT(offsetof(BindRenderbuffer, renderbuffer) == 8, |
| OffsetOf_BindRenderbuffer_renderbuffer_not_8); |
| |
| struct BindTexture { |
| typedef BindTexture ValueType; |
| static const CommandId kCmdId = kBindTexture; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _target, GLuint _texture) { |
| SetHeader(); |
| target = _target; |
| texture = _texture; |
| } |
| |
| void* Set(void* cmd, GLenum _target, GLuint _texture) { |
| static_cast<ValueType*>(cmd)->Init(_target, _texture); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 texture; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BindTexture) == 12, |
| Sizeof_BindTexture_is_not_12); |
| COMPILE_ASSERT(offsetof(BindTexture, header) == 0, |
| OffsetOf_BindTexture_header_not_0); |
| COMPILE_ASSERT(offsetof(BindTexture, target) == 4, |
| OffsetOf_BindTexture_target_not_4); |
| COMPILE_ASSERT(offsetof(BindTexture, texture) == 8, |
| OffsetOf_BindTexture_texture_not_8); |
| |
| struct BlendColor { |
| typedef BlendColor ValueType; |
| static const CommandId kCmdId = kBlendColor; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLclampf _red, GLclampf _green, GLclampf _blue, GLclampf _alpha) { |
| SetHeader(); |
| red = _red; |
| green = _green; |
| blue = _blue; |
| alpha = _alpha; |
| } |
| |
| void* Set( |
| void* cmd, GLclampf _red, GLclampf _green, GLclampf _blue, |
| GLclampf _alpha) { |
| static_cast<ValueType*>(cmd)->Init(_red, _green, _blue, _alpha); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| float red; |
| float green; |
| float blue; |
| float alpha; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BlendColor) == 20, |
| Sizeof_BlendColor_is_not_20); |
| COMPILE_ASSERT(offsetof(BlendColor, header) == 0, |
| OffsetOf_BlendColor_header_not_0); |
| COMPILE_ASSERT(offsetof(BlendColor, red) == 4, |
| OffsetOf_BlendColor_red_not_4); |
| COMPILE_ASSERT(offsetof(BlendColor, green) == 8, |
| OffsetOf_BlendColor_green_not_8); |
| COMPILE_ASSERT(offsetof(BlendColor, blue) == 12, |
| OffsetOf_BlendColor_blue_not_12); |
| COMPILE_ASSERT(offsetof(BlendColor, alpha) == 16, |
| OffsetOf_BlendColor_alpha_not_16); |
| |
| struct BlendEquation { |
| typedef BlendEquation ValueType; |
| static const CommandId kCmdId = kBlendEquation; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _mode) { |
| SetHeader(); |
| mode = _mode; |
| } |
| |
| void* Set(void* cmd, GLenum _mode) { |
| static_cast<ValueType*>(cmd)->Init(_mode); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 mode; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BlendEquation) == 8, |
| Sizeof_BlendEquation_is_not_8); |
| COMPILE_ASSERT(offsetof(BlendEquation, header) == 0, |
| OffsetOf_BlendEquation_header_not_0); |
| COMPILE_ASSERT(offsetof(BlendEquation, mode) == 4, |
| OffsetOf_BlendEquation_mode_not_4); |
| |
| struct BlendEquationSeparate { |
| typedef BlendEquationSeparate ValueType; |
| static const CommandId kCmdId = kBlendEquationSeparate; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _modeRGB, GLenum _modeAlpha) { |
| SetHeader(); |
| modeRGB = _modeRGB; |
| modeAlpha = _modeAlpha; |
| } |
| |
| void* Set(void* cmd, GLenum _modeRGB, GLenum _modeAlpha) { |
| static_cast<ValueType*>(cmd)->Init(_modeRGB, _modeAlpha); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 modeRGB; |
| uint32 modeAlpha; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BlendEquationSeparate) == 12, |
| Sizeof_BlendEquationSeparate_is_not_12); |
| COMPILE_ASSERT(offsetof(BlendEquationSeparate, header) == 0, |
| OffsetOf_BlendEquationSeparate_header_not_0); |
| COMPILE_ASSERT(offsetof(BlendEquationSeparate, modeRGB) == 4, |
| OffsetOf_BlendEquationSeparate_modeRGB_not_4); |
| COMPILE_ASSERT(offsetof(BlendEquationSeparate, modeAlpha) == 8, |
| OffsetOf_BlendEquationSeparate_modeAlpha_not_8); |
| |
| struct BlendFunc { |
| typedef BlendFunc ValueType; |
| static const CommandId kCmdId = kBlendFunc; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _sfactor, GLenum _dfactor) { |
| SetHeader(); |
| sfactor = _sfactor; |
| dfactor = _dfactor; |
| } |
| |
| void* Set(void* cmd, GLenum _sfactor, GLenum _dfactor) { |
| static_cast<ValueType*>(cmd)->Init(_sfactor, _dfactor); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 sfactor; |
| uint32 dfactor; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BlendFunc) == 12, |
| Sizeof_BlendFunc_is_not_12); |
| COMPILE_ASSERT(offsetof(BlendFunc, header) == 0, |
| OffsetOf_BlendFunc_header_not_0); |
| COMPILE_ASSERT(offsetof(BlendFunc, sfactor) == 4, |
| OffsetOf_BlendFunc_sfactor_not_4); |
| COMPILE_ASSERT(offsetof(BlendFunc, dfactor) == 8, |
| OffsetOf_BlendFunc_dfactor_not_8); |
| |
| struct BlendFuncSeparate { |
| typedef BlendFuncSeparate ValueType; |
| static const CommandId kCmdId = kBlendFuncSeparate; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _srcRGB, GLenum _dstRGB, GLenum _srcAlpha, GLenum _dstAlpha) { |
| SetHeader(); |
| srcRGB = _srcRGB; |
| dstRGB = _dstRGB; |
| srcAlpha = _srcAlpha; |
| dstAlpha = _dstAlpha; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _srcRGB, GLenum _dstRGB, GLenum _srcAlpha, |
| GLenum _dstAlpha) { |
| static_cast<ValueType*>(cmd)->Init(_srcRGB, _dstRGB, _srcAlpha, _dstAlpha); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 srcRGB; |
| uint32 dstRGB; |
| uint32 srcAlpha; |
| uint32 dstAlpha; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BlendFuncSeparate) == 20, |
| Sizeof_BlendFuncSeparate_is_not_20); |
| COMPILE_ASSERT(offsetof(BlendFuncSeparate, header) == 0, |
| OffsetOf_BlendFuncSeparate_header_not_0); |
| COMPILE_ASSERT(offsetof(BlendFuncSeparate, srcRGB) == 4, |
| OffsetOf_BlendFuncSeparate_srcRGB_not_4); |
| COMPILE_ASSERT(offsetof(BlendFuncSeparate, dstRGB) == 8, |
| OffsetOf_BlendFuncSeparate_dstRGB_not_8); |
| COMPILE_ASSERT(offsetof(BlendFuncSeparate, srcAlpha) == 12, |
| OffsetOf_BlendFuncSeparate_srcAlpha_not_12); |
| COMPILE_ASSERT(offsetof(BlendFuncSeparate, dstAlpha) == 16, |
| OffsetOf_BlendFuncSeparate_dstAlpha_not_16); |
| |
| struct BufferData { |
| typedef BufferData ValueType; |
| static const CommandId kCmdId = kBufferData; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLsizeiptr _size, uint32 _data_shm_id, |
| uint32 _data_shm_offset, GLenum _usage) { |
| SetHeader(); |
| target = _target; |
| size = _size; |
| data_shm_id = _data_shm_id; |
| data_shm_offset = _data_shm_offset; |
| usage = _usage; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLsizeiptr _size, uint32 _data_shm_id, |
| uint32 _data_shm_offset, GLenum _usage) { |
| static_cast<ValueType*>( |
| cmd)->Init(_target, _size, _data_shm_id, _data_shm_offset, _usage); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 size; |
| uint32 data_shm_id; |
| uint32 data_shm_offset; |
| uint32 usage; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BufferData) == 24, |
| Sizeof_BufferData_is_not_24); |
| COMPILE_ASSERT(offsetof(BufferData, header) == 0, |
| OffsetOf_BufferData_header_not_0); |
| COMPILE_ASSERT(offsetof(BufferData, target) == 4, |
| OffsetOf_BufferData_target_not_4); |
| COMPILE_ASSERT(offsetof(BufferData, size) == 8, |
| OffsetOf_BufferData_size_not_8); |
| COMPILE_ASSERT(offsetof(BufferData, data_shm_id) == 12, |
| OffsetOf_BufferData_data_shm_id_not_12); |
| COMPILE_ASSERT(offsetof(BufferData, data_shm_offset) == 16, |
| OffsetOf_BufferData_data_shm_offset_not_16); |
| COMPILE_ASSERT(offsetof(BufferData, usage) == 20, |
| OffsetOf_BufferData_usage_not_20); |
| |
| struct BufferDataImmediate { |
| typedef BufferDataImmediate ValueType; |
| static const CommandId kCmdId = kBufferDataImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeSize(uint32 size_in_bytes) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + // NOLINT |
| RoundSizeToMultipleOfEntries(size_in_bytes)); |
| } |
| |
| void SetHeader(uint32 size_in_bytes) { |
| header.SetCmdByTotalSize<ValueType>(size_in_bytes); |
| } |
| |
| void Init(GLenum _target, GLsizeiptr _size, GLenum _usage) { |
| uint32 total_size = 0; // TODO(gman): get correct size. |
| SetHeader(total_size); |
| target = _target; |
| size = _size; |
| usage = _usage; |
| } |
| |
| void* Set(void* cmd, GLenum _target, GLsizeiptr _size, GLenum _usage) { |
| uint32 total_size = 0; // TODO(gman): get correct size. |
| static_cast<ValueType*>(cmd)->Init(_target, _size, _usage); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 size; |
| uint32 usage; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BufferDataImmediate) == 16, |
| Sizeof_BufferDataImmediate_is_not_16); |
| COMPILE_ASSERT(offsetof(BufferDataImmediate, header) == 0, |
| OffsetOf_BufferDataImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(BufferDataImmediate, target) == 4, |
| OffsetOf_BufferDataImmediate_target_not_4); |
| COMPILE_ASSERT(offsetof(BufferDataImmediate, size) == 8, |
| OffsetOf_BufferDataImmediate_size_not_8); |
| COMPILE_ASSERT(offsetof(BufferDataImmediate, usage) == 12, |
| OffsetOf_BufferDataImmediate_usage_not_12); |
| |
| struct BufferSubData { |
| typedef BufferSubData ValueType; |
| static const CommandId kCmdId = kBufferSubData; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLintptr _offset, GLsizeiptr _size, uint32 _data_shm_id, |
| uint32 _data_shm_offset) { |
| SetHeader(); |
| target = _target; |
| offset = _offset; |
| size = _size; |
| data_shm_id = _data_shm_id; |
| data_shm_offset = _data_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLintptr _offset, GLsizeiptr _size, |
| uint32 _data_shm_id, uint32 _data_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_target, _offset, _size, _data_shm_id, _data_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 offset; |
| uint32 size; |
| uint32 data_shm_id; |
| uint32 data_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BufferSubData) == 24, |
| Sizeof_BufferSubData_is_not_24); |
| COMPILE_ASSERT(offsetof(BufferSubData, header) == 0, |
| OffsetOf_BufferSubData_header_not_0); |
| COMPILE_ASSERT(offsetof(BufferSubData, target) == 4, |
| OffsetOf_BufferSubData_target_not_4); |
| COMPILE_ASSERT(offsetof(BufferSubData, offset) == 8, |
| OffsetOf_BufferSubData_offset_not_8); |
| COMPILE_ASSERT(offsetof(BufferSubData, size) == 12, |
| OffsetOf_BufferSubData_size_not_12); |
| COMPILE_ASSERT(offsetof(BufferSubData, data_shm_id) == 16, |
| OffsetOf_BufferSubData_data_shm_id_not_16); |
| COMPILE_ASSERT(offsetof(BufferSubData, data_shm_offset) == 20, |
| OffsetOf_BufferSubData_data_shm_offset_not_20); |
| |
| struct BufferSubDataImmediate { |
| typedef BufferSubDataImmediate ValueType; |
| static const CommandId kCmdId = kBufferSubDataImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeSize(uint32 size_in_bytes) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + // NOLINT |
| RoundSizeToMultipleOfEntries(size_in_bytes)); |
| } |
| |
| void SetHeader(uint32 size_in_bytes) { |
| header.SetCmdByTotalSize<ValueType>(size_in_bytes); |
| } |
| |
| void Init(GLenum _target, GLintptr _offset, GLsizeiptr _size) { |
| uint32 total_size = ComputeSize(_size); |
| SetHeader(total_size); |
| target = _target; |
| offset = _offset; |
| size = _size; |
| } |
| |
| void* Set(void* cmd, GLenum _target, GLintptr _offset, GLsizeiptr _size) { |
| uint32 total_size = ComputeSize(_size); |
| static_cast<ValueType*>(cmd)->Init(_target, _offset, _size); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 offset; |
| uint32 size; |
| }; |
| |
| COMPILE_ASSERT(sizeof(BufferSubDataImmediate) == 16, |
| Sizeof_BufferSubDataImmediate_is_not_16); |
| COMPILE_ASSERT(offsetof(BufferSubDataImmediate, header) == 0, |
| OffsetOf_BufferSubDataImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(BufferSubDataImmediate, target) == 4, |
| OffsetOf_BufferSubDataImmediate_target_not_4); |
| COMPILE_ASSERT(offsetof(BufferSubDataImmediate, offset) == 8, |
| OffsetOf_BufferSubDataImmediate_offset_not_8); |
| COMPILE_ASSERT(offsetof(BufferSubDataImmediate, size) == 12, |
| OffsetOf_BufferSubDataImmediate_size_not_12); |
| |
| struct CheckFramebufferStatus { |
| typedef CheckFramebufferStatus ValueType; |
| static const CommandId kCmdId = kCheckFramebufferStatus; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _target) { |
| SetHeader(); |
| target = _target; |
| } |
| |
| void* Set(void* cmd, GLenum _target) { |
| static_cast<ValueType*>(cmd)->Init(_target); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CheckFramebufferStatus) == 8, |
| Sizeof_CheckFramebufferStatus_is_not_8); |
| COMPILE_ASSERT(offsetof(CheckFramebufferStatus, header) == 0, |
| OffsetOf_CheckFramebufferStatus_header_not_0); |
| COMPILE_ASSERT(offsetof(CheckFramebufferStatus, target) == 4, |
| OffsetOf_CheckFramebufferStatus_target_not_4); |
| |
| struct Clear { |
| typedef Clear ValueType; |
| static const CommandId kCmdId = kClear; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLbitfield _mask) { |
| SetHeader(); |
| mask = _mask; |
| } |
| |
| void* Set(void* cmd, GLbitfield _mask) { |
| static_cast<ValueType*>(cmd)->Init(_mask); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 mask; |
| }; |
| |
| COMPILE_ASSERT(sizeof(Clear) == 8, |
| Sizeof_Clear_is_not_8); |
| COMPILE_ASSERT(offsetof(Clear, header) == 0, |
| OffsetOf_Clear_header_not_0); |
| COMPILE_ASSERT(offsetof(Clear, mask) == 4, |
| OffsetOf_Clear_mask_not_4); |
| |
| struct ClearColor { |
| typedef ClearColor ValueType; |
| static const CommandId kCmdId = kClearColor; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLclampf _red, GLclampf _green, GLclampf _blue, GLclampf _alpha) { |
| SetHeader(); |
| red = _red; |
| green = _green; |
| blue = _blue; |
| alpha = _alpha; |
| } |
| |
| void* Set( |
| void* cmd, GLclampf _red, GLclampf _green, GLclampf _blue, |
| GLclampf _alpha) { |
| static_cast<ValueType*>(cmd)->Init(_red, _green, _blue, _alpha); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| float red; |
| float green; |
| float blue; |
| float alpha; |
| }; |
| |
| COMPILE_ASSERT(sizeof(ClearColor) == 20, |
| Sizeof_ClearColor_is_not_20); |
| COMPILE_ASSERT(offsetof(ClearColor, header) == 0, |
| OffsetOf_ClearColor_header_not_0); |
| COMPILE_ASSERT(offsetof(ClearColor, red) == 4, |
| OffsetOf_ClearColor_red_not_4); |
| COMPILE_ASSERT(offsetof(ClearColor, green) == 8, |
| OffsetOf_ClearColor_green_not_8); |
| COMPILE_ASSERT(offsetof(ClearColor, blue) == 12, |
| OffsetOf_ClearColor_blue_not_12); |
| COMPILE_ASSERT(offsetof(ClearColor, alpha) == 16, |
| OffsetOf_ClearColor_alpha_not_16); |
| |
| struct ClearDepthf { |
| typedef ClearDepthf ValueType; |
| static const CommandId kCmdId = kClearDepthf; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLclampf _depth) { |
| SetHeader(); |
| depth = _depth; |
| } |
| |
| void* Set(void* cmd, GLclampf _depth) { |
| static_cast<ValueType*>(cmd)->Init(_depth); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| float depth; |
| }; |
| |
| COMPILE_ASSERT(sizeof(ClearDepthf) == 8, |
| Sizeof_ClearDepthf_is_not_8); |
| COMPILE_ASSERT(offsetof(ClearDepthf, header) == 0, |
| OffsetOf_ClearDepthf_header_not_0); |
| COMPILE_ASSERT(offsetof(ClearDepthf, depth) == 4, |
| OffsetOf_ClearDepthf_depth_not_4); |
| |
| struct ClearStencil { |
| typedef ClearStencil ValueType; |
| static const CommandId kCmdId = kClearStencil; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLint _s) { |
| SetHeader(); |
| s = _s; |
| } |
| |
| void* Set(void* cmd, GLint _s) { |
| static_cast<ValueType*>(cmd)->Init(_s); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 s; |
| }; |
| |
| COMPILE_ASSERT(sizeof(ClearStencil) == 8, |
| Sizeof_ClearStencil_is_not_8); |
| COMPILE_ASSERT(offsetof(ClearStencil, header) == 0, |
| OffsetOf_ClearStencil_header_not_0); |
| COMPILE_ASSERT(offsetof(ClearStencil, s) == 4, |
| OffsetOf_ClearStencil_s_not_4); |
| |
| struct ColorMask { |
| typedef ColorMask ValueType; |
| static const CommandId kCmdId = kColorMask; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLboolean _red, GLboolean _green, GLboolean _blue, GLboolean _alpha) { |
| SetHeader(); |
| red = _red; |
| green = _green; |
| blue = _blue; |
| alpha = _alpha; |
| } |
| |
| void* Set( |
| void* cmd, GLboolean _red, GLboolean _green, GLboolean _blue, |
| GLboolean _alpha) { |
| static_cast<ValueType*>(cmd)->Init(_red, _green, _blue, _alpha); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 red; |
| uint32 green; |
| uint32 blue; |
| uint32 alpha; |
| }; |
| |
| COMPILE_ASSERT(sizeof(ColorMask) == 20, |
| Sizeof_ColorMask_is_not_20); |
| COMPILE_ASSERT(offsetof(ColorMask, header) == 0, |
| OffsetOf_ColorMask_header_not_0); |
| COMPILE_ASSERT(offsetof(ColorMask, red) == 4, |
| OffsetOf_ColorMask_red_not_4); |
| COMPILE_ASSERT(offsetof(ColorMask, green) == 8, |
| OffsetOf_ColorMask_green_not_8); |
| COMPILE_ASSERT(offsetof(ColorMask, blue) == 12, |
| OffsetOf_ColorMask_blue_not_12); |
| COMPILE_ASSERT(offsetof(ColorMask, alpha) == 16, |
| OffsetOf_ColorMask_alpha_not_16); |
| |
| struct CompileShader { |
| typedef CompileShader ValueType; |
| static const CommandId kCmdId = kCompileShader; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _shader) { |
| SetHeader(); |
| shader = _shader; |
| } |
| |
| void* Set(void* cmd, GLuint _shader) { |
| static_cast<ValueType*>(cmd)->Init(_shader); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 shader; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CompileShader) == 8, |
| Sizeof_CompileShader_is_not_8); |
| COMPILE_ASSERT(offsetof(CompileShader, header) == 0, |
| OffsetOf_CompileShader_header_not_0); |
| COMPILE_ASSERT(offsetof(CompileShader, shader) == 4, |
| OffsetOf_CompileShader_shader_not_4); |
| |
| struct CompressedTexImage2D { |
| typedef CompressedTexImage2D ValueType; |
| static const CommandId kCmdId = kCompressedTexImage2D; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLint _level, GLenum _internalformat, GLsizei _width, |
| GLsizei _height, GLint _border, GLsizei _imageSize, uint32 _data_shm_id, |
| uint32 _data_shm_offset) { |
| SetHeader(); |
| target = _target; |
| level = _level; |
| internalformat = _internalformat; |
| width = _width; |
| height = _height; |
| border = _border; |
| imageSize = _imageSize; |
| data_shm_id = _data_shm_id; |
| data_shm_offset = _data_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLint _level, GLenum _internalformat, |
| GLsizei _width, GLsizei _height, GLint _border, GLsizei _imageSize, |
| uint32 _data_shm_id, uint32 _data_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _target, _level, _internalformat, _width, _height, _border, |
| _imageSize, _data_shm_id, _data_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 level; |
| uint32 internalformat; |
| uint32 width; |
| uint32 height; |
| uint32 border; |
| uint32 imageSize; |
| uint32 data_shm_id; |
| uint32 data_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CompressedTexImage2D) == 40, |
| Sizeof_CompressedTexImage2D_is_not_40); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, header) == 0, |
| OffsetOf_CompressedTexImage2D_header_not_0); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, target) == 4, |
| OffsetOf_CompressedTexImage2D_target_not_4); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, level) == 8, |
| OffsetOf_CompressedTexImage2D_level_not_8); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, internalformat) == 12, |
| OffsetOf_CompressedTexImage2D_internalformat_not_12); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, width) == 16, |
| OffsetOf_CompressedTexImage2D_width_not_16); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, height) == 20, |
| OffsetOf_CompressedTexImage2D_height_not_20); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, border) == 24, |
| OffsetOf_CompressedTexImage2D_border_not_24); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, imageSize) == 28, |
| OffsetOf_CompressedTexImage2D_imageSize_not_28); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, data_shm_id) == 32, |
| OffsetOf_CompressedTexImage2D_data_shm_id_not_32); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2D, data_shm_offset) == 36, |
| OffsetOf_CompressedTexImage2D_data_shm_offset_not_36); |
| |
| struct CompressedTexImage2DImmediate { |
| typedef CompressedTexImage2DImmediate ValueType; |
| static const CommandId kCmdId = kCompressedTexImage2DImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeSize(uint32 size_in_bytes) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + // NOLINT |
| RoundSizeToMultipleOfEntries(size_in_bytes)); |
| } |
| |
| void SetHeader(uint32 size_in_bytes) { |
| header.SetCmdByTotalSize<ValueType>(size_in_bytes); |
| } |
| |
| void Init( |
| GLenum _target, GLint _level, GLenum _internalformat, GLsizei _width, |
| GLsizei _height, GLint _border, GLsizei _imageSize) { |
| uint32 total_size = 0; // TODO(gman): get correct size. |
| SetHeader(total_size); |
| target = _target; |
| level = _level; |
| internalformat = _internalformat; |
| width = _width; |
| height = _height; |
| border = _border; |
| imageSize = _imageSize; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLint _level, GLenum _internalformat, |
| GLsizei _width, GLsizei _height, GLint _border, GLsizei _imageSize) { |
| uint32 total_size = 0; // TODO(gman): get correct size. |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _target, _level, _internalformat, _width, _height, _border, |
| _imageSize); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 level; |
| uint32 internalformat; |
| uint32 width; |
| uint32 height; |
| uint32 border; |
| uint32 imageSize; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CompressedTexImage2DImmediate) == 32, |
| Sizeof_CompressedTexImage2DImmediate_is_not_32); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, header) == 0, |
| OffsetOf_CompressedTexImage2DImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, target) == 4, |
| OffsetOf_CompressedTexImage2DImmediate_target_not_4); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, level) == 8, |
| OffsetOf_CompressedTexImage2DImmediate_level_not_8); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, internalformat) == 12, |
| OffsetOf_CompressedTexImage2DImmediate_internalformat_not_12); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, width) == 16, |
| OffsetOf_CompressedTexImage2DImmediate_width_not_16); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, height) == 20, |
| OffsetOf_CompressedTexImage2DImmediate_height_not_20); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, border) == 24, |
| OffsetOf_CompressedTexImage2DImmediate_border_not_24); |
| COMPILE_ASSERT(offsetof(CompressedTexImage2DImmediate, imageSize) == 28, |
| OffsetOf_CompressedTexImage2DImmediate_imageSize_not_28); |
| |
| struct CompressedTexSubImage2D { |
| typedef CompressedTexSubImage2D ValueType; |
| static const CommandId kCmdId = kCompressedTexSubImage2D; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, |
| GLsizei _width, GLsizei _height, GLenum _format, GLsizei _imageSize, |
| uint32 _data_shm_id, uint32 _data_shm_offset) { |
| SetHeader(); |
| target = _target; |
| level = _level; |
| xoffset = _xoffset; |
| yoffset = _yoffset; |
| width = _width; |
| height = _height; |
| format = _format; |
| imageSize = _imageSize; |
| data_shm_id = _data_shm_id; |
| data_shm_offset = _data_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, |
| GLsizei _width, GLsizei _height, GLenum _format, GLsizei _imageSize, |
| uint32 _data_shm_id, uint32 _data_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _target, _level, _xoffset, _yoffset, _width, _height, _format, |
| _imageSize, _data_shm_id, _data_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 level; |
| uint32 xoffset; |
| uint32 yoffset; |
| uint32 width; |
| uint32 height; |
| uint32 format; |
| uint32 imageSize; |
| uint32 data_shm_id; |
| uint32 data_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CompressedTexSubImage2D) == 44, |
| Sizeof_CompressedTexSubImage2D_is_not_44); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, header) == 0, |
| OffsetOf_CompressedTexSubImage2D_header_not_0); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, target) == 4, |
| OffsetOf_CompressedTexSubImage2D_target_not_4); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, level) == 8, |
| OffsetOf_CompressedTexSubImage2D_level_not_8); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, xoffset) == 12, |
| OffsetOf_CompressedTexSubImage2D_xoffset_not_12); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, yoffset) == 16, |
| OffsetOf_CompressedTexSubImage2D_yoffset_not_16); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, width) == 20, |
| OffsetOf_CompressedTexSubImage2D_width_not_20); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, height) == 24, |
| OffsetOf_CompressedTexSubImage2D_height_not_24); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, format) == 28, |
| OffsetOf_CompressedTexSubImage2D_format_not_28); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, imageSize) == 32, |
| OffsetOf_CompressedTexSubImage2D_imageSize_not_32); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, data_shm_id) == 36, |
| OffsetOf_CompressedTexSubImage2D_data_shm_id_not_36); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2D, data_shm_offset) == 40, |
| OffsetOf_CompressedTexSubImage2D_data_shm_offset_not_40); |
| |
| struct CompressedTexSubImage2DImmediate { |
| typedef CompressedTexSubImage2DImmediate ValueType; |
| static const CommandId kCmdId = kCompressedTexSubImage2DImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeSize(uint32 size_in_bytes) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + // NOLINT |
| RoundSizeToMultipleOfEntries(size_in_bytes)); |
| } |
| |
| void SetHeader(uint32 size_in_bytes) { |
| header.SetCmdByTotalSize<ValueType>(size_in_bytes); |
| } |
| |
| void Init( |
| GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, |
| GLsizei _width, GLsizei _height, GLenum _format, GLsizei _imageSize) { |
| uint32 total_size = ComputeSize(_imageSize); |
| SetHeader(total_size); |
| target = _target; |
| level = _level; |
| xoffset = _xoffset; |
| yoffset = _yoffset; |
| width = _width; |
| height = _height; |
| format = _format; |
| imageSize = _imageSize; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, |
| GLsizei _width, GLsizei _height, GLenum _format, GLsizei _imageSize) { |
| uint32 total_size = ComputeSize(_imageSize); |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _target, _level, _xoffset, _yoffset, _width, _height, _format, |
| _imageSize); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 level; |
| uint32 xoffset; |
| uint32 yoffset; |
| uint32 width; |
| uint32 height; |
| uint32 format; |
| uint32 imageSize; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CompressedTexSubImage2DImmediate) == 36, |
| Sizeof_CompressedTexSubImage2DImmediate_is_not_36); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, header) == 0, |
| OffsetOf_CompressedTexSubImage2DImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, target) == 4, |
| OffsetOf_CompressedTexSubImage2DImmediate_target_not_4); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, level) == 8, |
| OffsetOf_CompressedTexSubImage2DImmediate_level_not_8); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, xoffset) == 12, |
| OffsetOf_CompressedTexSubImage2DImmediate_xoffset_not_12); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, yoffset) == 16, |
| OffsetOf_CompressedTexSubImage2DImmediate_yoffset_not_16); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, width) == 20, |
| OffsetOf_CompressedTexSubImage2DImmediate_width_not_20); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, height) == 24, |
| OffsetOf_CompressedTexSubImage2DImmediate_height_not_24); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, format) == 28, |
| OffsetOf_CompressedTexSubImage2DImmediate_format_not_28); |
| COMPILE_ASSERT(offsetof(CompressedTexSubImage2DImmediate, imageSize) == 32, |
| OffsetOf_CompressedTexSubImage2DImmediate_imageSize_not_32); |
| |
| struct CopyTexImage2D { |
| typedef CopyTexImage2D ValueType; |
| static const CommandId kCmdId = kCopyTexImage2D; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLint _level, GLenum _internalformat, GLint _x, GLint _y, |
| GLsizei _width, GLsizei _height, GLint _border) { |
| SetHeader(); |
| target = _target; |
| level = _level; |
| internalformat = _internalformat; |
| x = _x; |
| y = _y; |
| width = _width; |
| height = _height; |
| border = _border; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLint _level, GLenum _internalformat, GLint _x, |
| GLint _y, GLsizei _width, GLsizei _height, GLint _border) { |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _target, _level, _internalformat, _x, _y, _width, _height, |
| _border); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 level; |
| uint32 internalformat; |
| uint32 x; |
| uint32 y; |
| uint32 width; |
| uint32 height; |
| uint32 border; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CopyTexImage2D) == 36, |
| Sizeof_CopyTexImage2D_is_not_36); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, header) == 0, |
| OffsetOf_CopyTexImage2D_header_not_0); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, target) == 4, |
| OffsetOf_CopyTexImage2D_target_not_4); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, level) == 8, |
| OffsetOf_CopyTexImage2D_level_not_8); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, internalformat) == 12, |
| OffsetOf_CopyTexImage2D_internalformat_not_12); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, x) == 16, |
| OffsetOf_CopyTexImage2D_x_not_16); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, y) == 20, |
| OffsetOf_CopyTexImage2D_y_not_20); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, width) == 24, |
| OffsetOf_CopyTexImage2D_width_not_24); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, height) == 28, |
| OffsetOf_CopyTexImage2D_height_not_28); |
| COMPILE_ASSERT(offsetof(CopyTexImage2D, border) == 32, |
| OffsetOf_CopyTexImage2D_border_not_32); |
| |
| struct CopyTexSubImage2D { |
| typedef CopyTexSubImage2D ValueType; |
| static const CommandId kCmdId = kCopyTexSubImage2D; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, GLint _x, |
| GLint _y, GLsizei _width, GLsizei _height) { |
| SetHeader(); |
| target = _target; |
| level = _level; |
| xoffset = _xoffset; |
| yoffset = _yoffset; |
| x = _x; |
| y = _y; |
| width = _width; |
| height = _height; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLint _level, GLint _xoffset, GLint _yoffset, |
| GLint _x, GLint _y, GLsizei _width, GLsizei _height) { |
| static_cast<ValueType*>( |
| cmd)->Init( |
| _target, _level, _xoffset, _yoffset, _x, _y, _width, _height); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 level; |
| uint32 xoffset; |
| uint32 yoffset; |
| uint32 x; |
| uint32 y; |
| uint32 width; |
| uint32 height; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CopyTexSubImage2D) == 36, |
| Sizeof_CopyTexSubImage2D_is_not_36); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, header) == 0, |
| OffsetOf_CopyTexSubImage2D_header_not_0); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, target) == 4, |
| OffsetOf_CopyTexSubImage2D_target_not_4); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, level) == 8, |
| OffsetOf_CopyTexSubImage2D_level_not_8); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, xoffset) == 12, |
| OffsetOf_CopyTexSubImage2D_xoffset_not_12); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, yoffset) == 16, |
| OffsetOf_CopyTexSubImage2D_yoffset_not_16); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, x) == 20, |
| OffsetOf_CopyTexSubImage2D_x_not_20); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, y) == 24, |
| OffsetOf_CopyTexSubImage2D_y_not_24); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, width) == 28, |
| OffsetOf_CopyTexSubImage2D_width_not_28); |
| COMPILE_ASSERT(offsetof(CopyTexSubImage2D, height) == 32, |
| OffsetOf_CopyTexSubImage2D_height_not_32); |
| |
| struct CreateProgram { |
| typedef CreateProgram ValueType; |
| static const CommandId kCmdId = kCreateProgram; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(uint32 _client_id) { |
| SetHeader(); |
| client_id = _client_id; |
| } |
| |
| void* Set(void* cmd, uint32 _client_id) { |
| static_cast<ValueType*>(cmd)->Init(_client_id); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 client_id; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CreateProgram) == 8, |
| Sizeof_CreateProgram_is_not_8); |
| COMPILE_ASSERT(offsetof(CreateProgram, header) == 0, |
| OffsetOf_CreateProgram_header_not_0); |
| COMPILE_ASSERT(offsetof(CreateProgram, client_id) == 4, |
| OffsetOf_CreateProgram_client_id_not_4); |
| |
| struct CreateShader { |
| typedef CreateShader ValueType; |
| static const CommandId kCmdId = kCreateShader; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _type, uint32 _client_id) { |
| SetHeader(); |
| type = _type; |
| client_id = _client_id; |
| } |
| |
| void* Set(void* cmd, GLenum _type, uint32 _client_id) { |
| static_cast<ValueType*>(cmd)->Init(_type, _client_id); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 type; |
| uint32 client_id; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CreateShader) == 12, |
| Sizeof_CreateShader_is_not_12); |
| COMPILE_ASSERT(offsetof(CreateShader, header) == 0, |
| OffsetOf_CreateShader_header_not_0); |
| COMPILE_ASSERT(offsetof(CreateShader, type) == 4, |
| OffsetOf_CreateShader_type_not_4); |
| COMPILE_ASSERT(offsetof(CreateShader, client_id) == 8, |
| OffsetOf_CreateShader_client_id_not_8); |
| |
| struct CullFace { |
| typedef CullFace ValueType; |
| static const CommandId kCmdId = kCullFace; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _mode) { |
| SetHeader(); |
| mode = _mode; |
| } |
| |
| void* Set(void* cmd, GLenum _mode) { |
| static_cast<ValueType*>(cmd)->Init(_mode); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 mode; |
| }; |
| |
| COMPILE_ASSERT(sizeof(CullFace) == 8, |
| Sizeof_CullFace_is_not_8); |
| COMPILE_ASSERT(offsetof(CullFace, header) == 0, |
| OffsetOf_CullFace_header_not_0); |
| COMPILE_ASSERT(offsetof(CullFace, mode) == 4, |
| OffsetOf_CullFace_mode_not_4); |
| |
| struct DeleteBuffers { |
| typedef DeleteBuffers ValueType; |
| static const CommandId kCmdId = kDeleteBuffers; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLsizei _n, uint32 _buffers_shm_id, uint32 _buffers_shm_offset) { |
| SetHeader(); |
| n = _n; |
| buffers_shm_id = _buffers_shm_id; |
| buffers_shm_offset = _buffers_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _buffers_shm_id, |
| uint32 _buffers_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _buffers_shm_id, _buffers_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 buffers_shm_id; |
| uint32 buffers_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteBuffers) == 16, |
| Sizeof_DeleteBuffers_is_not_16); |
| COMPILE_ASSERT(offsetof(DeleteBuffers, header) == 0, |
| OffsetOf_DeleteBuffers_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteBuffers, n) == 4, |
| OffsetOf_DeleteBuffers_n_not_4); |
| COMPILE_ASSERT(offsetof(DeleteBuffers, buffers_shm_id) == 8, |
| OffsetOf_DeleteBuffers_buffers_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(DeleteBuffers, buffers_shm_offset) == 12, |
| OffsetOf_DeleteBuffers_buffers_shm_offset_not_12); |
| |
| struct DeleteBuffersImmediate { |
| typedef DeleteBuffersImmediate ValueType; |
| static const CommandId kCmdId = kDeleteBuffersImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, const GLuint* _buffers) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _buffers, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, const GLuint* _buffers) { |
| static_cast<ValueType*>(cmd)->Init(_n, _buffers); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteBuffersImmediate) == 8, |
| Sizeof_DeleteBuffersImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(DeleteBuffersImmediate, header) == 0, |
| OffsetOf_DeleteBuffersImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteBuffersImmediate, n) == 4, |
| OffsetOf_DeleteBuffersImmediate_n_not_4); |
| |
| struct DeleteFramebuffers { |
| typedef DeleteFramebuffers ValueType; |
| static const CommandId kCmdId = kDeleteFramebuffers; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLsizei _n, uint32 _framebuffers_shm_id, |
| uint32 _framebuffers_shm_offset) { |
| SetHeader(); |
| n = _n; |
| framebuffers_shm_id = _framebuffers_shm_id; |
| framebuffers_shm_offset = _framebuffers_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _framebuffers_shm_id, |
| uint32 _framebuffers_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _framebuffers_shm_id, _framebuffers_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 framebuffers_shm_id; |
| uint32 framebuffers_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteFramebuffers) == 16, |
| Sizeof_DeleteFramebuffers_is_not_16); |
| COMPILE_ASSERT(offsetof(DeleteFramebuffers, header) == 0, |
| OffsetOf_DeleteFramebuffers_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteFramebuffers, n) == 4, |
| OffsetOf_DeleteFramebuffers_n_not_4); |
| COMPILE_ASSERT(offsetof(DeleteFramebuffers, framebuffers_shm_id) == 8, |
| OffsetOf_DeleteFramebuffers_framebuffers_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(DeleteFramebuffers, framebuffers_shm_offset) == 12, |
| OffsetOf_DeleteFramebuffers_framebuffers_shm_offset_not_12); |
| |
| struct DeleteFramebuffersImmediate { |
| typedef DeleteFramebuffersImmediate ValueType; |
| static const CommandId kCmdId = kDeleteFramebuffersImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, const GLuint* _framebuffers) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _framebuffers, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, const GLuint* _framebuffers) { |
| static_cast<ValueType*>(cmd)->Init(_n, _framebuffers); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteFramebuffersImmediate) == 8, |
| Sizeof_DeleteFramebuffersImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(DeleteFramebuffersImmediate, header) == 0, |
| OffsetOf_DeleteFramebuffersImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteFramebuffersImmediate, n) == 4, |
| OffsetOf_DeleteFramebuffersImmediate_n_not_4); |
| |
| struct DeleteProgram { |
| typedef DeleteProgram ValueType; |
| static const CommandId kCmdId = kDeleteProgram; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _program) { |
| SetHeader(); |
| program = _program; |
| } |
| |
| void* Set(void* cmd, GLuint _program) { |
| static_cast<ValueType*>(cmd)->Init(_program); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 program; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteProgram) == 8, |
| Sizeof_DeleteProgram_is_not_8); |
| COMPILE_ASSERT(offsetof(DeleteProgram, header) == 0, |
| OffsetOf_DeleteProgram_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteProgram, program) == 4, |
| OffsetOf_DeleteProgram_program_not_4); |
| |
| struct DeleteRenderbuffers { |
| typedef DeleteRenderbuffers ValueType; |
| static const CommandId kCmdId = kDeleteRenderbuffers; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLsizei _n, uint32 _renderbuffers_shm_id, |
| uint32 _renderbuffers_shm_offset) { |
| SetHeader(); |
| n = _n; |
| renderbuffers_shm_id = _renderbuffers_shm_id; |
| renderbuffers_shm_offset = _renderbuffers_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _renderbuffers_shm_id, |
| uint32 _renderbuffers_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _renderbuffers_shm_id, _renderbuffers_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 renderbuffers_shm_id; |
| uint32 renderbuffers_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteRenderbuffers) == 16, |
| Sizeof_DeleteRenderbuffers_is_not_16); |
| COMPILE_ASSERT(offsetof(DeleteRenderbuffers, header) == 0, |
| OffsetOf_DeleteRenderbuffers_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteRenderbuffers, n) == 4, |
| OffsetOf_DeleteRenderbuffers_n_not_4); |
| COMPILE_ASSERT(offsetof(DeleteRenderbuffers, renderbuffers_shm_id) == 8, |
| OffsetOf_DeleteRenderbuffers_renderbuffers_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(DeleteRenderbuffers, renderbuffers_shm_offset) == 12, |
| OffsetOf_DeleteRenderbuffers_renderbuffers_shm_offset_not_12); |
| |
| struct DeleteRenderbuffersImmediate { |
| typedef DeleteRenderbuffersImmediate ValueType; |
| static const CommandId kCmdId = kDeleteRenderbuffersImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, const GLuint* _renderbuffers) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _renderbuffers, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, const GLuint* _renderbuffers) { |
| static_cast<ValueType*>(cmd)->Init(_n, _renderbuffers); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteRenderbuffersImmediate) == 8, |
| Sizeof_DeleteRenderbuffersImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(DeleteRenderbuffersImmediate, header) == 0, |
| OffsetOf_DeleteRenderbuffersImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteRenderbuffersImmediate, n) == 4, |
| OffsetOf_DeleteRenderbuffersImmediate_n_not_4); |
| |
| struct DeleteShader { |
| typedef DeleteShader ValueType; |
| static const CommandId kCmdId = kDeleteShader; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _shader) { |
| SetHeader(); |
| shader = _shader; |
| } |
| |
| void* Set(void* cmd, GLuint _shader) { |
| static_cast<ValueType*>(cmd)->Init(_shader); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 shader; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteShader) == 8, |
| Sizeof_DeleteShader_is_not_8); |
| COMPILE_ASSERT(offsetof(DeleteShader, header) == 0, |
| OffsetOf_DeleteShader_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteShader, shader) == 4, |
| OffsetOf_DeleteShader_shader_not_4); |
| |
| struct DeleteTextures { |
| typedef DeleteTextures ValueType; |
| static const CommandId kCmdId = kDeleteTextures; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLsizei _n, uint32 _textures_shm_id, uint32 _textures_shm_offset) { |
| SetHeader(); |
| n = _n; |
| textures_shm_id = _textures_shm_id; |
| textures_shm_offset = _textures_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _textures_shm_id, |
| uint32 _textures_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _textures_shm_id, _textures_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 textures_shm_id; |
| uint32 textures_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteTextures) == 16, |
| Sizeof_DeleteTextures_is_not_16); |
| COMPILE_ASSERT(offsetof(DeleteTextures, header) == 0, |
| OffsetOf_DeleteTextures_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteTextures, n) == 4, |
| OffsetOf_DeleteTextures_n_not_4); |
| COMPILE_ASSERT(offsetof(DeleteTextures, textures_shm_id) == 8, |
| OffsetOf_DeleteTextures_textures_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(DeleteTextures, textures_shm_offset) == 12, |
| OffsetOf_DeleteTextures_textures_shm_offset_not_12); |
| |
| struct DeleteTexturesImmediate { |
| typedef DeleteTexturesImmediate ValueType; |
| static const CommandId kCmdId = kDeleteTexturesImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, const GLuint* _textures) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _textures, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, const GLuint* _textures) { |
| static_cast<ValueType*>(cmd)->Init(_n, _textures); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DeleteTexturesImmediate) == 8, |
| Sizeof_DeleteTexturesImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(DeleteTexturesImmediate, header) == 0, |
| OffsetOf_DeleteTexturesImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(DeleteTexturesImmediate, n) == 4, |
| OffsetOf_DeleteTexturesImmediate_n_not_4); |
| |
| struct DepthFunc { |
| typedef DepthFunc ValueType; |
| static const CommandId kCmdId = kDepthFunc; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _func) { |
| SetHeader(); |
| func = _func; |
| } |
| |
| void* Set(void* cmd, GLenum _func) { |
| static_cast<ValueType*>(cmd)->Init(_func); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 func; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DepthFunc) == 8, |
| Sizeof_DepthFunc_is_not_8); |
| COMPILE_ASSERT(offsetof(DepthFunc, header) == 0, |
| OffsetOf_DepthFunc_header_not_0); |
| COMPILE_ASSERT(offsetof(DepthFunc, func) == 4, |
| OffsetOf_DepthFunc_func_not_4); |
| |
| struct DepthMask { |
| typedef DepthMask ValueType; |
| static const CommandId kCmdId = kDepthMask; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLboolean _flag) { |
| SetHeader(); |
| flag = _flag; |
| } |
| |
| void* Set(void* cmd, GLboolean _flag) { |
| static_cast<ValueType*>(cmd)->Init(_flag); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 flag; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DepthMask) == 8, |
| Sizeof_DepthMask_is_not_8); |
| COMPILE_ASSERT(offsetof(DepthMask, header) == 0, |
| OffsetOf_DepthMask_header_not_0); |
| COMPILE_ASSERT(offsetof(DepthMask, flag) == 4, |
| OffsetOf_DepthMask_flag_not_4); |
| |
| struct DepthRangef { |
| typedef DepthRangef ValueType; |
| static const CommandId kCmdId = kDepthRangef; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLclampf _zNear, GLclampf _zFar) { |
| SetHeader(); |
| zNear = _zNear; |
| zFar = _zFar; |
| } |
| |
| void* Set(void* cmd, GLclampf _zNear, GLclampf _zFar) { |
| static_cast<ValueType*>(cmd)->Init(_zNear, _zFar); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| float zNear; |
| float zFar; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DepthRangef) == 12, |
| Sizeof_DepthRangef_is_not_12); |
| COMPILE_ASSERT(offsetof(DepthRangef, header) == 0, |
| OffsetOf_DepthRangef_header_not_0); |
| COMPILE_ASSERT(offsetof(DepthRangef, zNear) == 4, |
| OffsetOf_DepthRangef_zNear_not_4); |
| COMPILE_ASSERT(offsetof(DepthRangef, zFar) == 8, |
| OffsetOf_DepthRangef_zFar_not_8); |
| |
| struct DetachShader { |
| typedef DetachShader ValueType; |
| static const CommandId kCmdId = kDetachShader; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _program, GLuint _shader) { |
| SetHeader(); |
| program = _program; |
| shader = _shader; |
| } |
| |
| void* Set(void* cmd, GLuint _program, GLuint _shader) { |
| static_cast<ValueType*>(cmd)->Init(_program, _shader); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 program; |
| uint32 shader; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DetachShader) == 12, |
| Sizeof_DetachShader_is_not_12); |
| COMPILE_ASSERT(offsetof(DetachShader, header) == 0, |
| OffsetOf_DetachShader_header_not_0); |
| COMPILE_ASSERT(offsetof(DetachShader, program) == 4, |
| OffsetOf_DetachShader_program_not_4); |
| COMPILE_ASSERT(offsetof(DetachShader, shader) == 8, |
| OffsetOf_DetachShader_shader_not_8); |
| |
| struct Disable { |
| typedef Disable ValueType; |
| static const CommandId kCmdId = kDisable; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _cap) { |
| SetHeader(); |
| cap = _cap; |
| } |
| |
| void* Set(void* cmd, GLenum _cap) { |
| static_cast<ValueType*>(cmd)->Init(_cap); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 cap; |
| }; |
| |
| COMPILE_ASSERT(sizeof(Disable) == 8, |
| Sizeof_Disable_is_not_8); |
| COMPILE_ASSERT(offsetof(Disable, header) == 0, |
| OffsetOf_Disable_header_not_0); |
| COMPILE_ASSERT(offsetof(Disable, cap) == 4, |
| OffsetOf_Disable_cap_not_4); |
| |
| struct DisableVertexAttribArray { |
| typedef DisableVertexAttribArray ValueType; |
| static const CommandId kCmdId = kDisableVertexAttribArray; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _index) { |
| SetHeader(); |
| index = _index; |
| } |
| |
| void* Set(void* cmd, GLuint _index) { |
| static_cast<ValueType*>(cmd)->Init(_index); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 index; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DisableVertexAttribArray) == 8, |
| Sizeof_DisableVertexAttribArray_is_not_8); |
| COMPILE_ASSERT(offsetof(DisableVertexAttribArray, header) == 0, |
| OffsetOf_DisableVertexAttribArray_header_not_0); |
| COMPILE_ASSERT(offsetof(DisableVertexAttribArray, index) == 4, |
| OffsetOf_DisableVertexAttribArray_index_not_4); |
| |
| struct DrawArrays { |
| typedef DrawArrays ValueType; |
| static const CommandId kCmdId = kDrawArrays; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _mode, GLint _first, GLsizei _count) { |
| SetHeader(); |
| mode = _mode; |
| first = _first; |
| count = _count; |
| } |
| |
| void* Set(void* cmd, GLenum _mode, GLint _first, GLsizei _count) { |
| static_cast<ValueType*>(cmd)->Init(_mode, _first, _count); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 mode; |
| uint32 first; |
| uint32 count; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DrawArrays) == 16, |
| Sizeof_DrawArrays_is_not_16); |
| COMPILE_ASSERT(offsetof(DrawArrays, header) == 0, |
| OffsetOf_DrawArrays_header_not_0); |
| COMPILE_ASSERT(offsetof(DrawArrays, mode) == 4, |
| OffsetOf_DrawArrays_mode_not_4); |
| COMPILE_ASSERT(offsetof(DrawArrays, first) == 8, |
| OffsetOf_DrawArrays_first_not_8); |
| COMPILE_ASSERT(offsetof(DrawArrays, count) == 12, |
| OffsetOf_DrawArrays_count_not_12); |
| |
| struct DrawElements { |
| typedef DrawElements ValueType; |
| static const CommandId kCmdId = kDrawElements; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _mode, GLsizei _count, GLenum _type, GLuint _index_offset) { |
| SetHeader(); |
| mode = _mode; |
| count = _count; |
| type = _type; |
| index_offset = _index_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _mode, GLsizei _count, GLenum _type, |
| GLuint _index_offset) { |
| static_cast<ValueType*>(cmd)->Init(_mode, _count, _type, _index_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 mode; |
| uint32 count; |
| uint32 type; |
| uint32 index_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(DrawElements) == 20, |
| Sizeof_DrawElements_is_not_20); |
| COMPILE_ASSERT(offsetof(DrawElements, header) == 0, |
| OffsetOf_DrawElements_header_not_0); |
| COMPILE_ASSERT(offsetof(DrawElements, mode) == 4, |
| OffsetOf_DrawElements_mode_not_4); |
| COMPILE_ASSERT(offsetof(DrawElements, count) == 8, |
| OffsetOf_DrawElements_count_not_8); |
| COMPILE_ASSERT(offsetof(DrawElements, type) == 12, |
| OffsetOf_DrawElements_type_not_12); |
| COMPILE_ASSERT(offsetof(DrawElements, index_offset) == 16, |
| OffsetOf_DrawElements_index_offset_not_16); |
| |
| struct Enable { |
| typedef Enable ValueType; |
| static const CommandId kCmdId = kEnable; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _cap) { |
| SetHeader(); |
| cap = _cap; |
| } |
| |
| void* Set(void* cmd, GLenum _cap) { |
| static_cast<ValueType*>(cmd)->Init(_cap); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 cap; |
| }; |
| |
| COMPILE_ASSERT(sizeof(Enable) == 8, |
| Sizeof_Enable_is_not_8); |
| COMPILE_ASSERT(offsetof(Enable, header) == 0, |
| OffsetOf_Enable_header_not_0); |
| COMPILE_ASSERT(offsetof(Enable, cap) == 4, |
| OffsetOf_Enable_cap_not_4); |
| |
| struct EnableVertexAttribArray { |
| typedef EnableVertexAttribArray ValueType; |
| static const CommandId kCmdId = kEnableVertexAttribArray; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLuint _index) { |
| SetHeader(); |
| index = _index; |
| } |
| |
| void* Set(void* cmd, GLuint _index) { |
| static_cast<ValueType*>(cmd)->Init(_index); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 index; |
| }; |
| |
| COMPILE_ASSERT(sizeof(EnableVertexAttribArray) == 8, |
| Sizeof_EnableVertexAttribArray_is_not_8); |
| COMPILE_ASSERT(offsetof(EnableVertexAttribArray, header) == 0, |
| OffsetOf_EnableVertexAttribArray_header_not_0); |
| COMPILE_ASSERT(offsetof(EnableVertexAttribArray, index) == 4, |
| OffsetOf_EnableVertexAttribArray_index_not_4); |
| |
| struct Finish { |
| typedef Finish ValueType; |
| static const CommandId kCmdId = kFinish; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init() { |
| SetHeader(); |
| } |
| |
| void* Set(void* cmd) { |
| static_cast<ValueType*>(cmd)->Init(); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| }; |
| |
| COMPILE_ASSERT(sizeof(Finish) == 4, |
| Sizeof_Finish_is_not_4); |
| COMPILE_ASSERT(offsetof(Finish, header) == 0, |
| OffsetOf_Finish_header_not_0); |
| |
| struct Flush { |
| typedef Flush ValueType; |
| static const CommandId kCmdId = kFlush; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init() { |
| SetHeader(); |
| } |
| |
| void* Set(void* cmd) { |
| static_cast<ValueType*>(cmd)->Init(); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| }; |
| |
| COMPILE_ASSERT(sizeof(Flush) == 4, |
| Sizeof_Flush_is_not_4); |
| COMPILE_ASSERT(offsetof(Flush, header) == 0, |
| OffsetOf_Flush_header_not_0); |
| |
| struct FramebufferRenderbuffer { |
| typedef FramebufferRenderbuffer ValueType; |
| static const CommandId kCmdId = kFramebufferRenderbuffer; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLenum _attachment, GLenum _renderbuffertarget, |
| GLuint _renderbuffer) { |
| SetHeader(); |
| target = _target; |
| attachment = _attachment; |
| renderbuffertarget = _renderbuffertarget; |
| renderbuffer = _renderbuffer; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLenum _attachment, GLenum _renderbuffertarget, |
| GLuint _renderbuffer) { |
| static_cast<ValueType*>( |
| cmd)->Init(_target, _attachment, _renderbuffertarget, _renderbuffer); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 attachment; |
| uint32 renderbuffertarget; |
| uint32 renderbuffer; |
| }; |
| |
| COMPILE_ASSERT(sizeof(FramebufferRenderbuffer) == 20, |
| Sizeof_FramebufferRenderbuffer_is_not_20); |
| COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, header) == 0, |
| OffsetOf_FramebufferRenderbuffer_header_not_0); |
| COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, target) == 4, |
| OffsetOf_FramebufferRenderbuffer_target_not_4); |
| COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, attachment) == 8, |
| OffsetOf_FramebufferRenderbuffer_attachment_not_8); |
| COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, renderbuffertarget) == 12, |
| OffsetOf_FramebufferRenderbuffer_renderbuffertarget_not_12); |
| COMPILE_ASSERT(offsetof(FramebufferRenderbuffer, renderbuffer) == 16, |
| OffsetOf_FramebufferRenderbuffer_renderbuffer_not_16); |
| |
| struct FramebufferTexture2D { |
| typedef FramebufferTexture2D ValueType; |
| static const CommandId kCmdId = kFramebufferTexture2D; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLenum _target, GLenum _attachment, GLenum _textarget, GLuint _texture, |
| GLint _level) { |
| SetHeader(); |
| target = _target; |
| attachment = _attachment; |
| textarget = _textarget; |
| texture = _texture; |
| level = _level; |
| } |
| |
| void* Set( |
| void* cmd, GLenum _target, GLenum _attachment, GLenum _textarget, |
| GLuint _texture, GLint _level) { |
| static_cast<ValueType*>( |
| cmd)->Init(_target, _attachment, _textarget, _texture, _level); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| uint32 attachment; |
| uint32 textarget; |
| uint32 texture; |
| uint32 level; |
| }; |
| |
| COMPILE_ASSERT(sizeof(FramebufferTexture2D) == 24, |
| Sizeof_FramebufferTexture2D_is_not_24); |
| COMPILE_ASSERT(offsetof(FramebufferTexture2D, header) == 0, |
| OffsetOf_FramebufferTexture2D_header_not_0); |
| COMPILE_ASSERT(offsetof(FramebufferTexture2D, target) == 4, |
| OffsetOf_FramebufferTexture2D_target_not_4); |
| COMPILE_ASSERT(offsetof(FramebufferTexture2D, attachment) == 8, |
| OffsetOf_FramebufferTexture2D_attachment_not_8); |
| COMPILE_ASSERT(offsetof(FramebufferTexture2D, textarget) == 12, |
| OffsetOf_FramebufferTexture2D_textarget_not_12); |
| COMPILE_ASSERT(offsetof(FramebufferTexture2D, texture) == 16, |
| OffsetOf_FramebufferTexture2D_texture_not_16); |
| COMPILE_ASSERT(offsetof(FramebufferTexture2D, level) == 20, |
| OffsetOf_FramebufferTexture2D_level_not_20); |
| |
| struct FrontFace { |
| typedef FrontFace ValueType; |
| static const CommandId kCmdId = kFrontFace; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _mode) { |
| SetHeader(); |
| mode = _mode; |
| } |
| |
| void* Set(void* cmd, GLenum _mode) { |
| static_cast<ValueType*>(cmd)->Init(_mode); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 mode; |
| }; |
| |
| COMPILE_ASSERT(sizeof(FrontFace) == 8, |
| Sizeof_FrontFace_is_not_8); |
| COMPILE_ASSERT(offsetof(FrontFace, header) == 0, |
| OffsetOf_FrontFace_header_not_0); |
| COMPILE_ASSERT(offsetof(FrontFace, mode) == 4, |
| OffsetOf_FrontFace_mode_not_4); |
| |
| struct GenBuffers { |
| typedef GenBuffers ValueType; |
| static const CommandId kCmdId = kGenBuffers; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLsizei _n, uint32 _buffers_shm_id, uint32 _buffers_shm_offset) { |
| SetHeader(); |
| n = _n; |
| buffers_shm_id = _buffers_shm_id; |
| buffers_shm_offset = _buffers_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _buffers_shm_id, |
| uint32 _buffers_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _buffers_shm_id, _buffers_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 buffers_shm_id; |
| uint32 buffers_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenBuffers) == 16, |
| Sizeof_GenBuffers_is_not_16); |
| COMPILE_ASSERT(offsetof(GenBuffers, header) == 0, |
| OffsetOf_GenBuffers_header_not_0); |
| COMPILE_ASSERT(offsetof(GenBuffers, n) == 4, |
| OffsetOf_GenBuffers_n_not_4); |
| COMPILE_ASSERT(offsetof(GenBuffers, buffers_shm_id) == 8, |
| OffsetOf_GenBuffers_buffers_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(GenBuffers, buffers_shm_offset) == 12, |
| OffsetOf_GenBuffers_buffers_shm_offset_not_12); |
| |
| struct GenBuffersImmediate { |
| typedef GenBuffersImmediate ValueType; |
| static const CommandId kCmdId = kGenBuffersImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, GLuint* _buffers) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _buffers, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, GLuint* _buffers) { |
| static_cast<ValueType*>(cmd)->Init(_n, _buffers); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenBuffersImmediate) == 8, |
| Sizeof_GenBuffersImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(GenBuffersImmediate, header) == 0, |
| OffsetOf_GenBuffersImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(GenBuffersImmediate, n) == 4, |
| OffsetOf_GenBuffersImmediate_n_not_4); |
| |
| struct GenerateMipmap { |
| typedef GenerateMipmap ValueType; |
| static const CommandId kCmdId = kGenerateMipmap; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLenum _target) { |
| SetHeader(); |
| target = _target; |
| } |
| |
| void* Set(void* cmd, GLenum _target) { |
| static_cast<ValueType*>(cmd)->Init(_target); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 target; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenerateMipmap) == 8, |
| Sizeof_GenerateMipmap_is_not_8); |
| COMPILE_ASSERT(offsetof(GenerateMipmap, header) == 0, |
| OffsetOf_GenerateMipmap_header_not_0); |
| COMPILE_ASSERT(offsetof(GenerateMipmap, target) == 4, |
| OffsetOf_GenerateMipmap_target_not_4); |
| |
| struct GenFramebuffers { |
| typedef GenFramebuffers ValueType; |
| static const CommandId kCmdId = kGenFramebuffers; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLsizei _n, uint32 _framebuffers_shm_id, |
| uint32 _framebuffers_shm_offset) { |
| SetHeader(); |
| n = _n; |
| framebuffers_shm_id = _framebuffers_shm_id; |
| framebuffers_shm_offset = _framebuffers_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _framebuffers_shm_id, |
| uint32 _framebuffers_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _framebuffers_shm_id, _framebuffers_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 framebuffers_shm_id; |
| uint32 framebuffers_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenFramebuffers) == 16, |
| Sizeof_GenFramebuffers_is_not_16); |
| COMPILE_ASSERT(offsetof(GenFramebuffers, header) == 0, |
| OffsetOf_GenFramebuffers_header_not_0); |
| COMPILE_ASSERT(offsetof(GenFramebuffers, n) == 4, |
| OffsetOf_GenFramebuffers_n_not_4); |
| COMPILE_ASSERT(offsetof(GenFramebuffers, framebuffers_shm_id) == 8, |
| OffsetOf_GenFramebuffers_framebuffers_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(GenFramebuffers, framebuffers_shm_offset) == 12, |
| OffsetOf_GenFramebuffers_framebuffers_shm_offset_not_12); |
| |
| struct GenFramebuffersImmediate { |
| typedef GenFramebuffersImmediate ValueType; |
| static const CommandId kCmdId = kGenFramebuffersImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, GLuint* _framebuffers) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _framebuffers, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, GLuint* _framebuffers) { |
| static_cast<ValueType*>(cmd)->Init(_n, _framebuffers); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenFramebuffersImmediate) == 8, |
| Sizeof_GenFramebuffersImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(GenFramebuffersImmediate, header) == 0, |
| OffsetOf_GenFramebuffersImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(GenFramebuffersImmediate, n) == 4, |
| OffsetOf_GenFramebuffersImmediate_n_not_4); |
| |
| struct GenRenderbuffers { |
| typedef GenRenderbuffers ValueType; |
| static const CommandId kCmdId = kGenRenderbuffers; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init( |
| GLsizei _n, uint32 _renderbuffers_shm_id, |
| uint32 _renderbuffers_shm_offset) { |
| SetHeader(); |
| n = _n; |
| renderbuffers_shm_id = _renderbuffers_shm_id; |
| renderbuffers_shm_offset = _renderbuffers_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _renderbuffers_shm_id, |
| uint32 _renderbuffers_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _renderbuffers_shm_id, _renderbuffers_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 renderbuffers_shm_id; |
| uint32 renderbuffers_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenRenderbuffers) == 16, |
| Sizeof_GenRenderbuffers_is_not_16); |
| COMPILE_ASSERT(offsetof(GenRenderbuffers, header) == 0, |
| OffsetOf_GenRenderbuffers_header_not_0); |
| COMPILE_ASSERT(offsetof(GenRenderbuffers, n) == 4, |
| OffsetOf_GenRenderbuffers_n_not_4); |
| COMPILE_ASSERT(offsetof(GenRenderbuffers, renderbuffers_shm_id) == 8, |
| OffsetOf_GenRenderbuffers_renderbuffers_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(GenRenderbuffers, renderbuffers_shm_offset) == 12, |
| OffsetOf_GenRenderbuffers_renderbuffers_shm_offset_not_12); |
| |
| struct GenRenderbuffersImmediate { |
| typedef GenRenderbuffersImmediate ValueType; |
| static const CommandId kCmdId = kGenRenderbuffersImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, GLuint* _renderbuffers) { |
| SetHeader(_n); |
| n = _n; |
| memcpy(ImmediateDataAddress(this), |
| _renderbuffers, ComputeDataSize(_n)); |
| } |
| |
| void* Set(void* cmd, GLsizei _n, GLuint* _renderbuffers) { |
| static_cast<ValueType*>(cmd)->Init(_n, _renderbuffers); |
| const uint32 size = ComputeSize(_n); |
| return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenRenderbuffersImmediate) == 8, |
| Sizeof_GenRenderbuffersImmediate_is_not_8); |
| COMPILE_ASSERT(offsetof(GenRenderbuffersImmediate, header) == 0, |
| OffsetOf_GenRenderbuffersImmediate_header_not_0); |
| COMPILE_ASSERT(offsetof(GenRenderbuffersImmediate, n) == 4, |
| OffsetOf_GenRenderbuffersImmediate_n_not_4); |
| |
| struct GenTextures { |
| typedef GenTextures ValueType; |
| static const CommandId kCmdId = kGenTextures; |
| static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
| |
| static uint32 ComputeSize() { |
| return static_cast<uint32>(sizeof(ValueType)); // NOLINT |
| } |
| |
| void SetHeader() { |
| header.SetCmd<ValueType>(); |
| } |
| |
| void Init(GLsizei _n, uint32 _textures_shm_id, uint32 _textures_shm_offset) { |
| SetHeader(); |
| n = _n; |
| textures_shm_id = _textures_shm_id; |
| textures_shm_offset = _textures_shm_offset; |
| } |
| |
| void* Set( |
| void* cmd, GLsizei _n, uint32 _textures_shm_id, |
| uint32 _textures_shm_offset) { |
| static_cast<ValueType*>( |
| cmd)->Init(_n, _textures_shm_id, _textures_shm_offset); |
| return NextCmdAddress<ValueType>(cmd); |
| } |
| |
| command_buffer::CommandHeader header; |
| uint32 n; |
| uint32 textures_shm_id; |
| uint32 textures_shm_offset; |
| }; |
| |
| COMPILE_ASSERT(sizeof(GenTextures) == 16, |
| Sizeof_GenTextures_is_not_16); |
| COMPILE_ASSERT(offsetof(GenTextures, header) == 0, |
| OffsetOf_GenTextures_header_not_0); |
| COMPILE_ASSERT(offsetof(GenTextures, n) == 4, |
| OffsetOf_GenTextures_n_not_4); |
| COMPILE_ASSERT(offsetof(GenTextures, textures_shm_id) == 8, |
| OffsetOf_GenTextures_textures_shm_id_not_8); |
| COMPILE_ASSERT(offsetof(GenTextures, textures_shm_offset) == 12, |
| OffsetOf_GenTextures_textures_shm_offset_not_12); |
| |
| struct GenTexturesImmediate { |
| typedef GenTexturesImmediate ValueType; |
| static const CommandId kCmdId = kGenTexturesImmediate; |
| static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| |
| static uint32 ComputeDataSize(GLsizei n) { |
| return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT |
| } |
| |
| static uint32 ComputeSize(GLsizei n) { |
| return static_cast<uint32>( |
| sizeof(ValueType) + ComputeDataSize(n)); // NOLINT |
| } |
| |
| void SetHeader(GLsizei n) { |
| header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); |
| } |
| |
| void Init(GLsizei _n, GLuint* _textures) { |
| SetHeader(_n); |
| n = _n; |
|