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

Unified Diff: gpu/command_buffer/service/cmd_parser.h

Issue 558513003: command_buffer: Batch command processing to reduce handler overheads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bad return in DoCommand(). Created 6 years, 3 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/service/cmd_parser.h
diff --git a/gpu/command_buffer/service/cmd_parser.h b/gpu/command_buffer/service/cmd_parser.h
index de2fe2977ff23a9d85fc432e7130c6159655c6bb..2030e8216810878fee996700740287d07ed8fe63 100644
--- a/gpu/command_buffer/service/cmd_parser.h
+++ b/gpu/command_buffer/service/cmd_parser.h
@@ -19,6 +19,8 @@ class AsyncAPIInterface;
// buffer, to implement some asynchronous RPC mechanism.
class GPU_EXPORT CommandParser {
public:
+ static const int kParseCommandsSlice = 20;
+
explicit CommandParser(AsyncAPIInterface* handler);
// Sets the buffer to read commands from.
@@ -55,7 +57,7 @@ class GPU_EXPORT CommandParser {
// Processes one command, updating the get pointer. This will return an error
// if there are no commands in the buffer.
- error::Error ProcessCommand();
+ error::Error ProcessCommands(int num_commands);
// Processes all commands until get == put.
error::Error ProcessAllCommands();
@@ -78,7 +80,7 @@ class AsyncAPIInterface {
AsyncAPIInterface() {}
virtual ~AsyncAPIInterface() {}
- // Executes a command.
+ // Executes a single command.
// Parameters:
// command: the command index.
// arg_count: the number of CommandBufferEntry arguments.
@@ -91,6 +93,14 @@ class AsyncAPIInterface {
unsigned int arg_count,
const void* cmd_data) = 0;
+ // Executes multiple commands.
+ // Parameters:
+ // todo...
+ virtual error::Error DoCommands(unsigned int num_commands,
+ const void* buffer,
+ int num_entries,
+ int* entries_processed);
+
// Returns a name for a command. Useful for logging / debuging.
virtual const char* GetCommandName(unsigned int command_id) const = 0;
};

Powered by Google App Engine
This is Rietveld 408576698