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

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: Rebase. 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
« no previous file with comments | « gpu/command_buffer/client/ring_buffer_test.cc ('k') | gpu/command_buffer/service/cmd_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ac52d86869cd7719af31888bce4d908dd8b95477 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,14 +57,11 @@ 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();
- // Reports an error.
- void ReportError(unsigned int command_id, error::Error result);
-
private:
CommandBufferOffset get_;
CommandBufferOffset put_;
@@ -73,12 +72,12 @@ class GPU_EXPORT CommandParser {
// This class defines the interface for an asynchronous API handler, that
// is responsible for de-multiplexing commands and their arguments.
-class AsyncAPIInterface {
+class GPU_EXPORT AsyncAPIInterface {
public:
AsyncAPIInterface() {}
virtual ~AsyncAPIInterface() {}
- // Executes a command.
+ // Executes a single command.
// Parameters:
// command: the command index.
// arg_count: the number of CommandBufferEntry arguments.
@@ -91,6 +90,17 @@ class AsyncAPIInterface {
unsigned int arg_count,
const void* cmd_data) = 0;
+ // Executes multiple commands.
+ // Parameters:
+ // num_commands: maximum number of commands to execute from buffer.
+ // buffer: pointer to first command entry to process.
+ // num_entries: number of sequential command buffer entries in buffer.
+ // entries_processed: if not 0, is set to the number of entries processed.
+ 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;
};
« no previous file with comments | « gpu/command_buffer/client/ring_buffer_test.cc ('k') | gpu/command_buffer/service/cmd_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698