diff options
Diffstat (limited to 'gpu/command_buffer/common')
4 files changed, 229 insertions, 1 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index b26cea0..ec3a09b 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -15434,4 +15434,164 @@ static_assert( offsetof(ApplyScreenSpaceAntialiasingCHROMIUM, header) == 0, "offset of ApplyScreenSpaceAntialiasingCHROMIUM header should be 0"); +struct BindFragDataLocationIndexedEXTBucket { + typedef BindFragDataLocationIndexedEXTBucket ValueType; + static const CommandId kCmdId = kBindFragDataLocationIndexedEXTBucket; + static const cmd::ArgFlags kArgFlags = cmd::kFixed; + static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); + + static uint32_t ComputeSize() { + return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT + } + + void SetHeader() { header.SetCmd<ValueType>(); } + + void Init(GLuint _program, + GLuint _colorNumber, + GLuint _index, + uint32_t _name_bucket_id) { + SetHeader(); + program = _program; + colorNumber = _colorNumber; + index = _index; + name_bucket_id = _name_bucket_id; + } + + void* Set(void* cmd, + GLuint _program, + GLuint _colorNumber, + GLuint _index, + uint32_t _name_bucket_id) { + static_cast<ValueType*>(cmd) + ->Init(_program, _colorNumber, _index, _name_bucket_id); + return NextCmdAddress<ValueType>(cmd); + } + + gpu::CommandHeader header; + uint32_t program; + uint32_t colorNumber; + uint32_t index; + uint32_t name_bucket_id; +}; + +static_assert(sizeof(BindFragDataLocationIndexedEXTBucket) == 20, + "size of BindFragDataLocationIndexedEXTBucket should be 20"); +static_assert( + offsetof(BindFragDataLocationIndexedEXTBucket, header) == 0, + "offset of BindFragDataLocationIndexedEXTBucket header should be 0"); +static_assert( + offsetof(BindFragDataLocationIndexedEXTBucket, program) == 4, + "offset of BindFragDataLocationIndexedEXTBucket program should be 4"); +static_assert( + offsetof(BindFragDataLocationIndexedEXTBucket, colorNumber) == 8, + "offset of BindFragDataLocationIndexedEXTBucket colorNumber should be 8"); +static_assert( + offsetof(BindFragDataLocationIndexedEXTBucket, index) == 12, + "offset of BindFragDataLocationIndexedEXTBucket index should be 12"); +static_assert(offsetof(BindFragDataLocationIndexedEXTBucket, name_bucket_id) == + 16, + "offset of BindFragDataLocationIndexedEXTBucket name_bucket_id " + "should be 16"); + +struct BindFragDataLocationEXTBucket { + typedef BindFragDataLocationEXTBucket ValueType; + static const CommandId kCmdId = kBindFragDataLocationEXTBucket; + static const cmd::ArgFlags kArgFlags = cmd::kFixed; + static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); + + static uint32_t ComputeSize() { + return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT + } + + void SetHeader() { header.SetCmd<ValueType>(); } + + void Init(GLuint _program, GLuint _colorNumber, uint32_t _name_bucket_id) { + SetHeader(); + program = _program; + colorNumber = _colorNumber; + name_bucket_id = _name_bucket_id; + } + + void* Set(void* cmd, + GLuint _program, + GLuint _colorNumber, + uint32_t _name_bucket_id) { + static_cast<ValueType*>(cmd)->Init(_program, _colorNumber, _name_bucket_id); + return NextCmdAddress<ValueType>(cmd); + } + + gpu::CommandHeader header; + uint32_t program; + uint32_t colorNumber; + uint32_t name_bucket_id; +}; + +static_assert(sizeof(BindFragDataLocationEXTBucket) == 16, + "size of BindFragDataLocationEXTBucket should be 16"); +static_assert(offsetof(BindFragDataLocationEXTBucket, header) == 0, + "offset of BindFragDataLocationEXTBucket header should be 0"); +static_assert(offsetof(BindFragDataLocationEXTBucket, program) == 4, + "offset of BindFragDataLocationEXTBucket program should be 4"); +static_assert( + offsetof(BindFragDataLocationEXTBucket, colorNumber) == 8, + "offset of BindFragDataLocationEXTBucket colorNumber should be 8"); +static_assert( + offsetof(BindFragDataLocationEXTBucket, name_bucket_id) == 12, + "offset of BindFragDataLocationEXTBucket name_bucket_id should be 12"); + +struct GetFragDataIndexEXT { + typedef GetFragDataIndexEXT ValueType; + static const CommandId kCmdId = kGetFragDataIndexEXT; + static const cmd::ArgFlags kArgFlags = cmd::kFixed; + static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); + + typedef GLint Result; + + static uint32_t ComputeSize() { + return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT + } + + void SetHeader() { header.SetCmd<ValueType>(); } + + void Init(GLuint _program, + uint32_t _name_bucket_id, + uint32_t _index_shm_id, + uint32_t _index_shm_offset) { + SetHeader(); + program = _program; + name_bucket_id = _name_bucket_id; + index_shm_id = _index_shm_id; + index_shm_offset = _index_shm_offset; + } + + void* Set(void* cmd, + GLuint _program, + uint32_t _name_bucket_id, + uint32_t _index_shm_id, + uint32_t _index_shm_offset) { + static_cast<ValueType*>(cmd) + ->Init(_program, _name_bucket_id, _index_shm_id, _index_shm_offset); + return NextCmdAddress<ValueType>(cmd); + } + + gpu::CommandHeader header; + uint32_t program; + uint32_t name_bucket_id; + uint32_t index_shm_id; + uint32_t index_shm_offset; +}; + +static_assert(sizeof(GetFragDataIndexEXT) == 20, + "size of GetFragDataIndexEXT should be 20"); +static_assert(offsetof(GetFragDataIndexEXT, header) == 0, + "offset of GetFragDataIndexEXT header should be 0"); +static_assert(offsetof(GetFragDataIndexEXT, program) == 4, + "offset of GetFragDataIndexEXT program should be 4"); +static_assert(offsetof(GetFragDataIndexEXT, name_bucket_id) == 8, + "offset of GetFragDataIndexEXT name_bucket_id should be 8"); +static_assert(offsetof(GetFragDataIndexEXT, index_shm_id) == 12, + "offset of GetFragDataIndexEXT index_shm_id should be 12"); +static_assert(offsetof(GetFragDataIndexEXT, index_shm_offset) == 16, + "offset of GetFragDataIndexEXT index_shm_offset should be 16"); + #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index 95a8ab8..939ea4e 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -5298,4 +5298,50 @@ TEST_F(GLES2FormatTest, ApplyScreenSpaceAntialiasingCHROMIUM) { CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } +TEST_F(GLES2FormatTest, BindFragDataLocationIndexedEXTBucket) { + cmds::BindFragDataLocationIndexedEXTBucket& cmd = + *GetBufferAs<cmds::BindFragDataLocationIndexedEXTBucket>(); + void* next_cmd = + cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLuint>(12), + static_cast<GLuint>(13), static_cast<uint32_t>(14)); + EXPECT_EQ( + static_cast<uint32_t>(cmds::BindFragDataLocationIndexedEXTBucket::kCmdId), + cmd.header.command); + EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); + EXPECT_EQ(static_cast<GLuint>(11), cmd.program); + EXPECT_EQ(static_cast<GLuint>(12), cmd.colorNumber); + EXPECT_EQ(static_cast<GLuint>(13), cmd.index); + EXPECT_EQ(static_cast<uint32_t>(14), cmd.name_bucket_id); + CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); +} + +TEST_F(GLES2FormatTest, BindFragDataLocationEXTBucket) { + cmds::BindFragDataLocationEXTBucket& cmd = + *GetBufferAs<cmds::BindFragDataLocationEXTBucket>(); + void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11), + static_cast<GLuint>(12), static_cast<uint32_t>(13)); + EXPECT_EQ(static_cast<uint32_t>(cmds::BindFragDataLocationEXTBucket::kCmdId), + cmd.header.command); + EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); + EXPECT_EQ(static_cast<GLuint>(11), cmd.program); + EXPECT_EQ(static_cast<GLuint>(12), cmd.colorNumber); + EXPECT_EQ(static_cast<uint32_t>(13), cmd.name_bucket_id); + CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); +} + +TEST_F(GLES2FormatTest, GetFragDataIndexEXT) { + cmds::GetFragDataIndexEXT& cmd = *GetBufferAs<cmds::GetFragDataIndexEXT>(); + void* next_cmd = + cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12), + static_cast<uint32_t>(13), static_cast<uint32_t>(14)); + EXPECT_EQ(static_cast<uint32_t>(cmds::GetFragDataIndexEXT::kCmdId), + cmd.header.command); + EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); + EXPECT_EQ(static_cast<GLuint>(11), cmd.program); + EXPECT_EQ(static_cast<uint32_t>(12), cmd.name_bucket_id); + EXPECT_EQ(static_cast<uint32_t>(13), cmd.index_shm_id); + EXPECT_EQ(static_cast<uint32_t>(14), cmd.index_shm_offset); + CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); +} + #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h index 22e5b0a..38dad79 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h @@ -331,7 +331,10 @@ OP(BindFragmentInputLocationCHROMIUMBucket) /* 572 */ \ OP(ProgramPathFragmentInputGenCHROMIUM) /* 573 */ \ OP(BlendBarrierKHR) /* 574 */ \ - OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 575 */ + OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 575 */ \ + OP(BindFragDataLocationIndexedEXTBucket) /* 576 */ \ + OP(BindFragDataLocationEXTBucket) /* 577 */ \ + OP(GetFragDataIndexEXT) /* 578 */ enum CommandId { kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this. diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index b84fbb0..af31a51 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -643,6 +643,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x78FB, "GL_RGB_YCBCR_422_CHROMIUM", }, { + 0x78FC, "GL_RGB_YCBCR_420V_CHROMIUM", + }, + { 0x80000000, "GL_MULTISAMPLE_BUFFER_BIT7_QCOM", }, { @@ -1279,6 +1282,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x8576, "GL_CONSTANT_CHROMIUM", }, { + 0x8589, "GL_SRC1_ALPHA_EXT", + }, + { 0x85B5, "GL_VERTEX_ARRAY_BINDING_OES", }, { @@ -1555,6 +1561,18 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x88F0, "GL_DEPTH24_STENCIL8_OES", }, { + 0x88F9, "GL_SRC1_COLOR_EXT", + }, + { + 0x88FA, "GL_ONE_MINUS_SRC1_COLOR_EXT", + }, + { + 0x88FB, "GL_ONE_MINUS_SRC1_ALPHA_EXT", + }, + { + 0x88FC, "GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT", + }, + { 0x88FD, "GL_VERTEX_ATTRIB_ARRAY_INTEGER", }, { @@ -3956,6 +3974,7 @@ std::string GLES2Util::GetStringImageInternalFormat(uint32_t value) { {GL_RGB, "GL_RGB"}, {GL_RGB_YUV_420_CHROMIUM, "GL_RGB_YUV_420_CHROMIUM"}, {GL_RGB_YCBCR_422_CHROMIUM, "GL_RGB_YCBCR_422_CHROMIUM"}, + {GL_RGB_YCBCR_420V_CHROMIUM, "GL_RGB_YCBCR_420V_CHROMIUM"}, {GL_RGBA, "GL_RGBA"}, }; return GLES2Util::GetQualifiedEnumString(string_table, |