diff options
Diffstat (limited to 'gpu/command_buffer/common')
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_format_autogen.h | 59 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_format_test_autogen.h | 16 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_ids_autogen.h | 157 |
3 files changed, 154 insertions, 78 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 1c0a9c0..6a0c173 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -11055,6 +11055,65 @@ static_assert(offsetof(DeleteQueriesEXTImmediate, header) == 0, static_assert(offsetof(DeleteQueriesEXTImmediate, n) == 4, "offset of DeleteQueriesEXTImmediate n should be 4"); +struct QueryCounterEXT { + typedef QueryCounterEXT ValueType; + static const CommandId kCmdId = kQueryCounterEXT; + static const cmd::ArgFlags kArgFlags = cmd::kFixed; + static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); + + static uint32_t ComputeSize() { + return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT + } + + void SetHeader() { header.SetCmd<ValueType>(); } + + void Init(GLuint _id, + GLenum _target, + uint32_t _sync_data_shm_id, + uint32_t _sync_data_shm_offset, + GLuint _submit_count) { + SetHeader(); + id = _id; + target = _target; + sync_data_shm_id = _sync_data_shm_id; + sync_data_shm_offset = _sync_data_shm_offset; + submit_count = _submit_count; + } + + void* Set(void* cmd, + GLuint _id, + GLenum _target, + uint32_t _sync_data_shm_id, + uint32_t _sync_data_shm_offset, + GLuint _submit_count) { + static_cast<ValueType*>(cmd)->Init(_id, _target, _sync_data_shm_id, + _sync_data_shm_offset, _submit_count); + return NextCmdAddress<ValueType>(cmd); + } + + gpu::CommandHeader header; + uint32_t id; + uint32_t target; + uint32_t sync_data_shm_id; + uint32_t sync_data_shm_offset; + uint32_t submit_count; +}; + +static_assert(sizeof(QueryCounterEXT) == 24, + "size of QueryCounterEXT should be 24"); +static_assert(offsetof(QueryCounterEXT, header) == 0, + "offset of QueryCounterEXT header should be 0"); +static_assert(offsetof(QueryCounterEXT, id) == 4, + "offset of QueryCounterEXT id should be 4"); +static_assert(offsetof(QueryCounterEXT, target) == 8, + "offset of QueryCounterEXT target should be 8"); +static_assert(offsetof(QueryCounterEXT, sync_data_shm_id) == 12, + "offset of QueryCounterEXT sync_data_shm_id should be 12"); +static_assert(offsetof(QueryCounterEXT, sync_data_shm_offset) == 16, + "offset of QueryCounterEXT sync_data_shm_offset should be 16"); +static_assert(offsetof(QueryCounterEXT, submit_count) == 20, + "offset of QueryCounterEXT submit_count should be 20"); + struct BeginQueryEXT { typedef BeginQueryEXT ValueType; static const CommandId kCmdId = kBeginQueryEXT; 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 2557c25..aa9bf84 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -3783,6 +3783,22 @@ TEST_F(GLES2FormatTest, DeleteQueriesEXTImmediate) { // TODO(gman): Check that ids were inserted; } +TEST_F(GLES2FormatTest, QueryCounterEXT) { + cmds::QueryCounterEXT& cmd = *GetBufferAs<cmds::QueryCounterEXT>(); + void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11), + static_cast<GLenum>(12), static_cast<uint32_t>(13), + static_cast<uint32_t>(14), static_cast<GLuint>(15)); + EXPECT_EQ(static_cast<uint32_t>(cmds::QueryCounterEXT::kCmdId), + cmd.header.command); + EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); + EXPECT_EQ(static_cast<GLuint>(11), cmd.id); + EXPECT_EQ(static_cast<GLenum>(12), cmd.target); + EXPECT_EQ(static_cast<uint32_t>(13), cmd.sync_data_shm_id); + EXPECT_EQ(static_cast<uint32_t>(14), cmd.sync_data_shm_offset); + EXPECT_EQ(static_cast<GLuint>(15), cmd.submit_count); + CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); +} + TEST_F(GLES2FormatTest, BeginQueryEXT) { cmds::BeginQueryEXT& cmd = *GetBufferAs<cmds::BeginQueryEXT>(); void* next_cmd = diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h index 2b0941b..356968c 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h @@ -239,84 +239,85 @@ OP(TexStorage2DEXT) /* 480 */ \ OP(GenQueriesEXTImmediate) /* 481 */ \ OP(DeleteQueriesEXTImmediate) /* 482 */ \ - OP(BeginQueryEXT) /* 483 */ \ - OP(BeginTransformFeedback) /* 484 */ \ - OP(EndQueryEXT) /* 485 */ \ - OP(EndTransformFeedback) /* 486 */ \ - OP(InsertEventMarkerEXT) /* 487 */ \ - OP(PushGroupMarkerEXT) /* 488 */ \ - OP(PopGroupMarkerEXT) /* 489 */ \ - OP(GenVertexArraysOESImmediate) /* 490 */ \ - OP(DeleteVertexArraysOESImmediate) /* 491 */ \ - OP(IsVertexArrayOES) /* 492 */ \ - OP(BindVertexArrayOES) /* 493 */ \ - OP(SwapBuffers) /* 494 */ \ - OP(GetMaxValueInBufferCHROMIUM) /* 495 */ \ - OP(EnableFeatureCHROMIUM) /* 496 */ \ - OP(MapBufferRange) /* 497 */ \ - OP(UnmapBuffer) /* 498 */ \ - OP(ResizeCHROMIUM) /* 499 */ \ - OP(GetRequestableExtensionsCHROMIUM) /* 500 */ \ - OP(RequestExtensionCHROMIUM) /* 501 */ \ - OP(GetProgramInfoCHROMIUM) /* 502 */ \ - OP(GetUniformBlocksCHROMIUM) /* 503 */ \ - OP(GetTransformFeedbackVaryingsCHROMIUM) /* 504 */ \ - OP(GetUniformsES3CHROMIUM) /* 505 */ \ - OP(GetTranslatedShaderSourceANGLE) /* 506 */ \ - OP(PostSubBufferCHROMIUM) /* 507 */ \ - OP(TexImageIOSurface2DCHROMIUM) /* 508 */ \ - OP(CopyTextureCHROMIUM) /* 509 */ \ - OP(CopySubTextureCHROMIUM) /* 510 */ \ - OP(CompressedCopyTextureCHROMIUM) /* 511 */ \ - OP(DrawArraysInstancedANGLE) /* 512 */ \ - OP(DrawElementsInstancedANGLE) /* 513 */ \ - OP(VertexAttribDivisorANGLE) /* 514 */ \ - OP(GenMailboxCHROMIUM) /* 515 */ \ - OP(ProduceTextureCHROMIUMImmediate) /* 516 */ \ - OP(ProduceTextureDirectCHROMIUMImmediate) /* 517 */ \ - OP(ConsumeTextureCHROMIUMImmediate) /* 518 */ \ - OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 519 */ \ - OP(BindUniformLocationCHROMIUMBucket) /* 520 */ \ - OP(GenValuebuffersCHROMIUMImmediate) /* 521 */ \ - OP(DeleteValuebuffersCHROMIUMImmediate) /* 522 */ \ - OP(IsValuebufferCHROMIUM) /* 523 */ \ - OP(BindValuebufferCHROMIUM) /* 524 */ \ - OP(SubscribeValueCHROMIUM) /* 525 */ \ - OP(PopulateSubscribedValuesCHROMIUM) /* 526 */ \ - OP(UniformValuebufferCHROMIUM) /* 527 */ \ - OP(BindTexImage2DCHROMIUM) /* 528 */ \ - OP(ReleaseTexImage2DCHROMIUM) /* 529 */ \ - OP(TraceBeginCHROMIUM) /* 530 */ \ - OP(TraceEndCHROMIUM) /* 531 */ \ - OP(AsyncTexSubImage2DCHROMIUM) /* 532 */ \ - OP(AsyncTexImage2DCHROMIUM) /* 533 */ \ - OP(WaitAsyncTexImage2DCHROMIUM) /* 534 */ \ - OP(WaitAllAsyncTexImage2DCHROMIUM) /* 535 */ \ - OP(DiscardFramebufferEXTImmediate) /* 536 */ \ - OP(LoseContextCHROMIUM) /* 537 */ \ - OP(InsertSyncPointCHROMIUM) /* 538 */ \ - OP(WaitSyncPointCHROMIUM) /* 539 */ \ - OP(DrawBuffersEXTImmediate) /* 540 */ \ - OP(DiscardBackbufferCHROMIUM) /* 541 */ \ - OP(ScheduleOverlayPlaneCHROMIUM) /* 542 */ \ - OP(SwapInterval) /* 543 */ \ - OP(FlushDriverCachesCHROMIUM) /* 544 */ \ - OP(MatrixLoadfCHROMIUMImmediate) /* 545 */ \ - OP(MatrixLoadIdentityCHROMIUM) /* 546 */ \ - OP(GenPathsCHROMIUM) /* 547 */ \ - OP(DeletePathsCHROMIUM) /* 548 */ \ - OP(IsPathCHROMIUM) /* 549 */ \ - OP(PathCommandsCHROMIUM) /* 550 */ \ - OP(PathParameterfCHROMIUM) /* 551 */ \ - OP(PathParameteriCHROMIUM) /* 552 */ \ - OP(PathStencilFuncCHROMIUM) /* 553 */ \ - OP(StencilFillPathCHROMIUM) /* 554 */ \ - OP(StencilStrokePathCHROMIUM) /* 555 */ \ - OP(CoverFillPathCHROMIUM) /* 556 */ \ - OP(CoverStrokePathCHROMIUM) /* 557 */ \ - OP(StencilThenCoverFillPathCHROMIUM) /* 558 */ \ - OP(StencilThenCoverStrokePathCHROMIUM) /* 559 */ \ - OP(BlendBarrierKHR) /* 560 */ + OP(QueryCounterEXT) /* 483 */ \ + OP(BeginQueryEXT) /* 484 */ \ + OP(BeginTransformFeedback) /* 485 */ \ + OP(EndQueryEXT) /* 486 */ \ + OP(EndTransformFeedback) /* 487 */ \ + OP(InsertEventMarkerEXT) /* 488 */ \ + OP(PushGroupMarkerEXT) /* 489 */ \ + OP(PopGroupMarkerEXT) /* 490 */ \ + OP(GenVertexArraysOESImmediate) /* 491 */ \ + OP(DeleteVertexArraysOESImmediate) /* 492 */ \ + OP(IsVertexArrayOES) /* 493 */ \ + OP(BindVertexArrayOES) /* 494 */ \ + OP(SwapBuffers) /* 495 */ \ + OP(GetMaxValueInBufferCHROMIUM) /* 496 */ \ + OP(EnableFeatureCHROMIUM) /* 497 */ \ + OP(MapBufferRange) /* 498 */ \ + OP(UnmapBuffer) /* 499 */ \ + OP(ResizeCHROMIUM) /* 500 */ \ + OP(GetRequestableExtensionsCHROMIUM) /* 501 */ \ + OP(RequestExtensionCHROMIUM) /* 502 */ \ + OP(GetProgramInfoCHROMIUM) /* 503 */ \ + OP(GetUniformBlocksCHROMIUM) /* 504 */ \ + OP(GetTransformFeedbackVaryingsCHROMIUM) /* 505 */ \ + OP(GetUniformsES3CHROMIUM) /* 506 */ \ + OP(GetTranslatedShaderSourceANGLE) /* 507 */ \ + OP(PostSubBufferCHROMIUM) /* 508 */ \ + OP(TexImageIOSurface2DCHROMIUM) /* 509 */ \ + OP(CopyTextureCHROMIUM) /* 510 */ \ + OP(CopySubTextureCHROMIUM) /* 511 */ \ + OP(CompressedCopyTextureCHROMIUM) /* 512 */ \ + OP(DrawArraysInstancedANGLE) /* 513 */ \ + OP(DrawElementsInstancedANGLE) /* 514 */ \ + OP(VertexAttribDivisorANGLE) /* 515 */ \ + OP(GenMailboxCHROMIUM) /* 516 */ \ + OP(ProduceTextureCHROMIUMImmediate) /* 517 */ \ + OP(ProduceTextureDirectCHROMIUMImmediate) /* 518 */ \ + OP(ConsumeTextureCHROMIUMImmediate) /* 519 */ \ + OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 520 */ \ + OP(BindUniformLocationCHROMIUMBucket) /* 521 */ \ + OP(GenValuebuffersCHROMIUMImmediate) /* 522 */ \ + OP(DeleteValuebuffersCHROMIUMImmediate) /* 523 */ \ + OP(IsValuebufferCHROMIUM) /* 524 */ \ + OP(BindValuebufferCHROMIUM) /* 525 */ \ + OP(SubscribeValueCHROMIUM) /* 526 */ \ + OP(PopulateSubscribedValuesCHROMIUM) /* 527 */ \ + OP(UniformValuebufferCHROMIUM) /* 528 */ \ + OP(BindTexImage2DCHROMIUM) /* 529 */ \ + OP(ReleaseTexImage2DCHROMIUM) /* 530 */ \ + OP(TraceBeginCHROMIUM) /* 531 */ \ + OP(TraceEndCHROMIUM) /* 532 */ \ + OP(AsyncTexSubImage2DCHROMIUM) /* 533 */ \ + OP(AsyncTexImage2DCHROMIUM) /* 534 */ \ + OP(WaitAsyncTexImage2DCHROMIUM) /* 535 */ \ + OP(WaitAllAsyncTexImage2DCHROMIUM) /* 536 */ \ + OP(DiscardFramebufferEXTImmediate) /* 537 */ \ + OP(LoseContextCHROMIUM) /* 538 */ \ + OP(InsertSyncPointCHROMIUM) /* 539 */ \ + OP(WaitSyncPointCHROMIUM) /* 540 */ \ + OP(DrawBuffersEXTImmediate) /* 541 */ \ + OP(DiscardBackbufferCHROMIUM) /* 542 */ \ + OP(ScheduleOverlayPlaneCHROMIUM) /* 543 */ \ + OP(SwapInterval) /* 544 */ \ + OP(FlushDriverCachesCHROMIUM) /* 545 */ \ + OP(MatrixLoadfCHROMIUMImmediate) /* 546 */ \ + OP(MatrixLoadIdentityCHROMIUM) /* 547 */ \ + OP(GenPathsCHROMIUM) /* 548 */ \ + OP(DeletePathsCHROMIUM) /* 549 */ \ + OP(IsPathCHROMIUM) /* 550 */ \ + OP(PathCommandsCHROMIUM) /* 551 */ \ + OP(PathParameterfCHROMIUM) /* 552 */ \ + OP(PathParameteriCHROMIUM) /* 553 */ \ + OP(PathStencilFuncCHROMIUM) /* 554 */ \ + OP(StencilFillPathCHROMIUM) /* 555 */ \ + OP(StencilStrokePathCHROMIUM) /* 556 */ \ + OP(CoverFillPathCHROMIUM) /* 557 */ \ + OP(CoverStrokePathCHROMIUM) /* 558 */ \ + OP(StencilThenCoverFillPathCHROMIUM) /* 559 */ \ + OP(StencilThenCoverStrokePathCHROMIUM) /* 560 */ \ + OP(BlendBarrierKHR) /* 561 */ enum CommandId { kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this. |