Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_format_autogen.h

Issue 780433006: Add framebuffer object related commands to command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 3944 matching lines...) Expand 10 before | Expand all | Expand 10 after
3955 gpu::CommandHeader header; 3955 gpu::CommandHeader header;
3956 uint32_t target; 3956 uint32_t target;
3957 uint32_t mode; 3957 uint32_t mode;
3958 }; 3958 };
3959 3959
3960 COMPILE_ASSERT(sizeof(Hint) == 12, Sizeof_Hint_is_not_12); 3960 COMPILE_ASSERT(sizeof(Hint) == 12, Sizeof_Hint_is_not_12);
3961 COMPILE_ASSERT(offsetof(Hint, header) == 0, OffsetOf_Hint_header_not_0); 3961 COMPILE_ASSERT(offsetof(Hint, header) == 0, OffsetOf_Hint_header_not_0);
3962 COMPILE_ASSERT(offsetof(Hint, target) == 4, OffsetOf_Hint_target_not_4); 3962 COMPILE_ASSERT(offsetof(Hint, target) == 4, OffsetOf_Hint_target_not_4);
3963 COMPILE_ASSERT(offsetof(Hint, mode) == 8, OffsetOf_Hint_mode_not_8); 3963 COMPILE_ASSERT(offsetof(Hint, mode) == 8, OffsetOf_Hint_mode_not_8);
3964 3964
3965 struct InvalidateFramebufferImmediate {
3966 typedef InvalidateFramebufferImmediate ValueType;
3967 static const CommandId kCmdId = kInvalidateFramebufferImmediate;
3968 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
3969 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3970
3971 static uint32_t ComputeDataSize(GLsizei count) {
3972 return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT
3973 }
3974
3975 static uint32_t ComputeSize(GLsizei count) {
3976 return static_cast<uint32_t>(sizeof(ValueType) +
3977 ComputeDataSize(count)); // NOLINT
3978 }
3979
3980 void SetHeader(GLsizei count) {
3981 header.SetCmdByTotalSize<ValueType>(ComputeSize(count));
3982 }
3983
3984 void Init(GLenum _target, GLsizei _count, const GLenum* _attachments) {
3985 SetHeader(_count);
3986 target = _target;
3987 count = _count;
3988 memcpy(ImmediateDataAddress(this), _attachments, ComputeDataSize(_count));
3989 }
3990
3991 void* Set(void* cmd,
3992 GLenum _target,
3993 GLsizei _count,
3994 const GLenum* _attachments) {
3995 static_cast<ValueType*>(cmd)->Init(_target, _count, _attachments);
3996 const uint32_t size = ComputeSize(_count);
3997 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
3998 }
3999
4000 gpu::CommandHeader header;
4001 uint32_t target;
4002 int32_t count;
4003 };
4004
4005 COMPILE_ASSERT(sizeof(InvalidateFramebufferImmediate) == 12,
4006 Sizeof_InvalidateFramebufferImmediate_is_not_12);
4007 COMPILE_ASSERT(offsetof(InvalidateFramebufferImmediate, header) == 0,
4008 OffsetOf_InvalidateFramebufferImmediate_header_not_0);
4009 COMPILE_ASSERT(offsetof(InvalidateFramebufferImmediate, target) == 4,
4010 OffsetOf_InvalidateFramebufferImmediate_target_not_4);
4011 COMPILE_ASSERT(offsetof(InvalidateFramebufferImmediate, count) == 8,
4012 OffsetOf_InvalidateFramebufferImmediate_count_not_8);
4013
4014 struct InvalidateSubFramebufferImmediate {
4015 typedef InvalidateSubFramebufferImmediate ValueType;
4016 static const CommandId kCmdId = kInvalidateSubFramebufferImmediate;
4017 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
4018 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4019
4020 static uint32_t ComputeDataSize(GLsizei count) {
4021 return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT
4022 }
4023
4024 static uint32_t ComputeSize(GLsizei count) {
4025 return static_cast<uint32_t>(sizeof(ValueType) +
4026 ComputeDataSize(count)); // NOLINT
4027 }
4028
4029 void SetHeader(GLsizei count) {
4030 header.SetCmdByTotalSize<ValueType>(ComputeSize(count));
4031 }
4032
4033 void Init(GLenum _target,
4034 GLsizei _count,
4035 const GLenum* _attachments,
4036 GLint _x,
4037 GLint _y,
4038 GLsizei _width,
4039 GLsizei _height) {
4040 SetHeader(_count);
4041 target = _target;
4042 count = _count;
4043 x = _x;
4044 y = _y;
4045 width = _width;
4046 height = _height;
4047 memcpy(ImmediateDataAddress(this), _attachments, ComputeDataSize(_count));
4048 }
4049
4050 void* Set(void* cmd,
4051 GLenum _target,
4052 GLsizei _count,
4053 const GLenum* _attachments,
4054 GLint _x,
4055 GLint _y,
4056 GLsizei _width,
4057 GLsizei _height) {
4058 static_cast<ValueType*>(cmd)
4059 ->Init(_target, _count, _attachments, _x, _y, _width, _height);
4060 const uint32_t size = ComputeSize(_count);
4061 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
4062 }
4063
4064 gpu::CommandHeader header;
4065 uint32_t target;
4066 int32_t count;
4067 int32_t x;
4068 int32_t y;
4069 int32_t width;
4070 int32_t height;
4071 };
4072
4073 COMPILE_ASSERT(sizeof(InvalidateSubFramebufferImmediate) == 28,
4074 Sizeof_InvalidateSubFramebufferImmediate_is_not_28);
4075 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, header) == 0,
4076 OffsetOf_InvalidateSubFramebufferImmediate_header_not_0);
4077 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, target) == 4,
4078 OffsetOf_InvalidateSubFramebufferImmediate_target_not_4);
4079 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, count) == 8,
4080 OffsetOf_InvalidateSubFramebufferImmediate_count_not_8);
4081 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, x) == 12,
4082 OffsetOf_InvalidateSubFramebufferImmediate_x_not_12);
4083 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, y) == 16,
4084 OffsetOf_InvalidateSubFramebufferImmediate_y_not_16);
4085 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, width) == 20,
4086 OffsetOf_InvalidateSubFramebufferImmediate_width_not_20);
4087 COMPILE_ASSERT(offsetof(InvalidateSubFramebufferImmediate, height) == 24,
4088 OffsetOf_InvalidateSubFramebufferImmediate_height_not_24);
4089
3965 struct IsBuffer { 4090 struct IsBuffer {
3966 typedef IsBuffer ValueType; 4091 typedef IsBuffer ValueType;
3967 static const CommandId kCmdId = kIsBuffer; 4092 static const CommandId kCmdId = kIsBuffer;
3968 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4093 static const cmd::ArgFlags kArgFlags = cmd::kFixed;
3969 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4094 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
3970 4095
3971 typedef uint32_t Result; 4096 typedef uint32_t Result;
3972 4097
3973 static uint32_t ComputeSize() { 4098 static uint32_t ComputeSize() {
3974 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT 4099 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 }; 4544 };
4420 4545
4421 COMPILE_ASSERT(sizeof(PolygonOffset) == 12, Sizeof_PolygonOffset_is_not_12); 4546 COMPILE_ASSERT(sizeof(PolygonOffset) == 12, Sizeof_PolygonOffset_is_not_12);
4422 COMPILE_ASSERT(offsetof(PolygonOffset, header) == 0, 4547 COMPILE_ASSERT(offsetof(PolygonOffset, header) == 0,
4423 OffsetOf_PolygonOffset_header_not_0); 4548 OffsetOf_PolygonOffset_header_not_0);
4424 COMPILE_ASSERT(offsetof(PolygonOffset, factor) == 4, 4549 COMPILE_ASSERT(offsetof(PolygonOffset, factor) == 4,
4425 OffsetOf_PolygonOffset_factor_not_4); 4550 OffsetOf_PolygonOffset_factor_not_4);
4426 COMPILE_ASSERT(offsetof(PolygonOffset, units) == 8, 4551 COMPILE_ASSERT(offsetof(PolygonOffset, units) == 8,
4427 OffsetOf_PolygonOffset_units_not_8); 4552 OffsetOf_PolygonOffset_units_not_8);
4428 4553
4554 struct ReadBuffer {
4555 typedef ReadBuffer ValueType;
4556 static const CommandId kCmdId = kReadBuffer;
4557 static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4558 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4559
4560 static uint32_t ComputeSize() {
4561 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
4562 }
4563
4564 void SetHeader() { header.SetCmd<ValueType>(); }
4565
4566 void Init(GLenum _src) {
4567 SetHeader();
4568 src = _src;
4569 }
4570
4571 void* Set(void* cmd, GLenum _src) {
4572 static_cast<ValueType*>(cmd)->Init(_src);
4573 return NextCmdAddress<ValueType>(cmd);
4574 }
4575
4576 gpu::CommandHeader header;
4577 uint32_t src;
4578 };
4579
4580 COMPILE_ASSERT(sizeof(ReadBuffer) == 8, Sizeof_ReadBuffer_is_not_8);
4581 COMPILE_ASSERT(offsetof(ReadBuffer, header) == 0,
4582 OffsetOf_ReadBuffer_header_not_0);
4583 COMPILE_ASSERT(offsetof(ReadBuffer, src) == 4, OffsetOf_ReadBuffer_src_not_4);
4584
4429 // ReadPixels has the result separated from the pixel buffer so that 4585 // ReadPixels has the result separated from the pixel buffer so that
4430 // it is easier to specify the result going to some specific place 4586 // it is easier to specify the result going to some specific place
4431 // that exactly fits the rectangle of pixels. 4587 // that exactly fits the rectangle of pixels.
4432 struct ReadPixels { 4588 struct ReadPixels {
4433 typedef ReadPixels ValueType; 4589 typedef ReadPixels ValueType;
4434 static const CommandId kCmdId = kReadPixels; 4590 static const CommandId kCmdId = kReadPixels;
4435 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 4591 static const cmd::ArgFlags kArgFlags = cmd::kFixed;
4436 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); 4592 static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
4437 4593
4438 typedef uint32_t Result; 4594 typedef uint32_t Result;
(...skipping 5849 matching lines...) Expand 10 before | Expand all | Expand 10 after
10288 } 10444 }
10289 10445
10290 gpu::CommandHeader header; 10446 gpu::CommandHeader header;
10291 }; 10447 };
10292 10448
10293 COMPILE_ASSERT(sizeof(BlendBarrierKHR) == 4, Sizeof_BlendBarrierKHR_is_not_4); 10449 COMPILE_ASSERT(sizeof(BlendBarrierKHR) == 4, Sizeof_BlendBarrierKHR_is_not_4);
10294 COMPILE_ASSERT(offsetof(BlendBarrierKHR, header) == 0, 10450 COMPILE_ASSERT(offsetof(BlendBarrierKHR, header) == 0,
10295 OffsetOf_BlendBarrierKHR_header_not_0); 10451 OffsetOf_BlendBarrierKHR_header_not_0);
10296 10452
10297 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ 10453 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698