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

Unified Diff: gpu/command_buffer/common/cmd_buffer_common.h

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Introduced internal SetAsyncToken command buffer command Created 6 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/cmd_buffer_common.h
diff --git a/gpu/command_buffer/common/cmd_buffer_common.h b/gpu/command_buffer/common/cmd_buffer_common.h
index cf09378e00c4d17630860471560d67b14a1960fb..48c92104c561af9ed09533194335b7a0bc90d54c 100644
--- a/gpu/command_buffer/common/cmd_buffer_common.h
+++ b/gpu/command_buffer/common/cmd_buffer_common.h
@@ -155,6 +155,7 @@ namespace cmd {
OP(SetBucketDataImmediate) /* 4 */ \
OP(GetBucketStart) /* 5 */ \
OP(GetBucketData) /* 6 */ \
+ OP(SetAsyncToken) /* 7 */ \
// Common commands.
enum CommandId {
@@ -223,6 +224,29 @@ struct SetToken {
uint32 token;
};
+struct SetAsyncToken {
+ typedef SetAsyncToken ValueType;
+ static const CommandId kCmdId = kSetAsyncToken;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+
+ void SetHeader() {
+ header.SetCmd<ValueType>();
+ }
+
+ void Init(uint32 _async_token) {
+ SetHeader();
+ async_token = _async_token;
+ }
+
+ static void* Set(void* cmd, uint32 async_token) {
+ static_cast<ValueType*>(cmd)->Init(async_token);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ CommandHeader header;
+ uint32 async_token;
+};
+
COMPILE_ASSERT(sizeof(SetToken) == 8, Sizeof_SetToken_is_not_8);
COMPILE_ASSERT(offsetof(SetToken, header) == 0,
Offsetof_SetToken_header_not_0);

Powered by Google App Engine
This is Rietveld 408576698