| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
| 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // The offset (in entries) from which the reader is reading. | 30 // The offset (in entries) from which the reader is reading. |
| 31 int32_t get_offset; | 31 int32_t get_offset; |
| 32 | 32 |
| 33 // The current token value. This is used by the writer to defer | 33 // The current token value. This is used by the writer to defer |
| 34 // changes to shared memory objects until the reader has reached a certain | 34 // changes to shared memory objects until the reader has reached a certain |
| 35 // point in the command buffer. The reader is responsible for updating the | 35 // point in the command buffer. The reader is responsible for updating the |
| 36 // token value, for example in response to an asynchronous set token command | 36 // token value, for example in response to an asynchronous set token command |
| 37 // embedded in the command buffer. The default token value is zero. | 37 // embedded in the command buffer. The default token value is zero. |
| 38 int32_t token; | 38 int32_t token; |
| 39 | 39 |
| 40 uint64_t release_count; |
| 41 |
| 40 // Error status. | 42 // Error status. |
| 41 error::Error error; | 43 error::Error error; |
| 42 | 44 |
| 43 // Lost context detail information. | 45 // Lost context detail information. |
| 44 error::ContextLostReason context_lost_reason; | 46 error::ContextLostReason context_lost_reason; |
| 45 | 47 |
| 46 // Generation index of this state. The generation index is incremented every | 48 // Generation index of this state. The generation index is incremented every |
| 47 // time a new state is retrieved from the command processor, so that | 49 // time a new state is retrieved from the command processor, so that |
| 48 // consistency can be kept even if IPC messages are processed out-of-order. | 50 // consistency can be kept even if IPC messages are processed out-of-order. |
| 49 uint32_t generation; | 51 uint32_t generation; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // subsequent Flushes on the same GpuChannel. | 89 // subsequent Flushes on the same GpuChannel. |
| 88 virtual void Flush(int32_t put_offset) = 0; | 90 virtual void Flush(int32_t put_offset) = 0; |
| 89 | 91 |
| 90 // As Flush, ensures that on the service side, commands up to put_offset | 92 // As Flush, ensures that on the service side, commands up to put_offset |
| 91 // are processed but before subsequent commands on the same GpuChannel but | 93 // are processed but before subsequent commands on the same GpuChannel but |
| 92 // flushing to the service may be deferred. | 94 // flushing to the service may be deferred. |
| 93 virtual void OrderingBarrier(int32_t put_offset) = 0; | 95 virtual void OrderingBarrier(int32_t put_offset) = 0; |
| 94 | 96 |
| 95 // The writer calls this to wait until the current token is within a | 97 // The writer calls this to wait until the current token is within a |
| 96 // specific range, inclusive. Can return early if an error is generated. | 98 // specific range, inclusive. Can return early if an error is generated. |
| 97 virtual void WaitForTokenInRange(int32_t start, int32_t end) = 0; | 99 virtual State WaitForTokenInRange(int32_t start, int32_t end) = 0; |
| 98 | 100 |
| 99 // The writer calls this to wait until the current get offset is within a | 101 // The writer calls this to wait until the current get offset is within a |
| 100 // specific range, inclusive. Can return early if an error is generated. | 102 // specific range, inclusive. Can return early if an error is generated. |
| 101 virtual void WaitForGetOffsetInRange(int32_t start, int32_t end) = 0; | 103 virtual State WaitForGetOffsetInRange(int32_t start, int32_t end) = 0; |
| 102 | 104 |
| 103 // Sets the buffer commands are read from. | 105 // Sets the buffer commands are read from. |
| 104 // Also resets the get and put offsets to 0. | 106 // Also resets the get and put offsets to 0. |
| 105 virtual void SetGetBuffer(int32_t transfer_buffer_id) = 0; | 107 virtual void SetGetBuffer(int32_t transfer_buffer_id) = 0; |
| 106 | 108 |
| 107 // Create a transfer buffer of the given size. Returns its ID or -1 on | 109 // Create a transfer buffer of the given size. Returns its ID or -1 on |
| 108 // error. | 110 // error. |
| 109 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, | 111 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, |
| 110 int32_t* id) = 0; | 112 int32_t* id) = 0; |
| 111 | 113 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 123 virtual error::Error GetLastError(); | 125 virtual error::Error GetLastError(); |
| 124 #endif | 126 #endif |
| 125 | 127 |
| 126 private: | 128 private: |
| 127 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); | 129 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace gpu | 132 } // namespace gpu |
| 131 | 133 |
| 132 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 134 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
| OLD | NEW |