Index: gpu/command_buffer/common/command_buffer.h |
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h |
index b69936320eca53013c0110d77743644c97c14834..5fcd30b78f41796f5d8c180e3f3e39438825aaad 100644 |
--- a/gpu/command_buffer/common/command_buffer.h |
+++ b/gpu/command_buffer/common/command_buffer.h |
@@ -5,6 +5,7 @@ |
#ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
#define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
+#include "base/logging.h" |
#include "gpu/command_buffer/common/buffer.h" |
#include "gpu/command_buffer/common/constants.h" |
#include "gpu/gpu_export.h" |
@@ -15,6 +16,15 @@ class SharedMemory; |
namespace gpu { |
+enum CommandBufferNamespace { |
+ kCommandBufferNamespace_Invalid = -1, |
+ |
+ kCommandBufferNamespace_GpuIO, |
+ kCommandBufferNamespace_InProcess, |
+ |
+ NUM_COMMAND_BUFFER_NAMESPACES |
+}; |
+ |
// Common interface for CommandBuffer implementations. |
class GPU_EXPORT CommandBuffer { |
piman
2015/09/15 22:51:05
This is a virtual interface, it should not have me
David Yen
2015/09/15 23:09:03
Doesn't it makes sense to put it as part of the co
piman
2015/09/15 23:17:17
I'd strongly prefer CommandBuffer to only worry ab
David Yen
2015/09/16 00:02:50
Ok, I've moved it to GpuControl as you suggested.
|
public: |
@@ -56,7 +66,10 @@ class GPU_EXPORT CommandBuffer { |
std::string message; |
}; |
- CommandBuffer() { |
+ explicit CommandBuffer(CommandBufferNamespace namespace_id, |
+ uint64_t command_buffer_id) |
+ : namespace_id_(namespace_id), |
+ command_buffer_id_(command_buffer_id) { |
} |
virtual ~CommandBuffer() { |
@@ -126,7 +139,26 @@ class GPU_EXPORT CommandBuffer { |
virtual error::Error GetLastError(); |
#endif |
+ // The namespace and command buffer ID forms a unique pair for all existing |
+ // command buffers in a single process. Intermediate command buffers |
+ // (such as CommandBufferService) should assign have an invalid namespace |
+ // to signify that they should not be queried. Command Buffers that forward |
+ // messages to other command buffers should identify as the command buffer |
+ // which actually does the executions. |
+ CommandBufferNamespace namespace_id() const { |
+ DCHECK_NE(namespace_id_, kCommandBufferNamespace_Invalid); |
+ return namespace_id_; |
+ } |
+ |
+ uint64_t command_buffer_id() const { |
+ DCHECK_NE(namespace_id_, kCommandBufferNamespace_Invalid); |
+ return command_buffer_id_; |
+ } |
+ |
private: |
+ const CommandBufferNamespace namespace_id_; |
+ const uint64_t command_buffer_id_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CommandBuffer); |
}; |