| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // For glBindBufferBase, return the actual buffer size when this function is | 48 // For glBindBufferBase, return the actual buffer size when this function is |
| 49 // called, not when glBindBufferBase is called. | 49 // called, not when glBindBufferBase is called. |
| 50 // For glBindBufferRange, return the |size| set by glBindBufferRange minus | 50 // For glBindBufferRange, return the |size| set by glBindBufferRange minus |
| 51 // the range that's beyond the buffer. | 51 // the range that's beyond the buffer. |
| 52 GLsizeiptr GetEffectiveBufferSize(GLuint index) const; | 52 GLsizeiptr GetEffectiveBufferSize(GLuint index) const; |
| 53 GLintptr GetBufferStart(GLuint index) const; | 53 GLintptr GetBufferStart(GLuint index) const; |
| 54 | 54 |
| 55 // This is used only for UNIFORM_BUFFER bindings in context switching. | 55 // This is used only for UNIFORM_BUFFER bindings in context switching. |
| 56 void RestoreBindings(IndexedBufferBindingHost* prev); | 56 void RestoreBindings(IndexedBufferBindingHost* prev); |
| 57 | 57 |
| 58 // Check if |buffer| is currently bound to one of the indexed binding point | |
| 59 // from 0 to |used_binding_count| - 1. | |
| 60 bool UsesBuffer(size_t used_binding_count, const Buffer* buffer) const; | |
| 61 | |
| 62 protected: | 58 protected: |
| 63 friend class base::RefCounted<IndexedBufferBindingHost>; | 59 friend class base::RefCounted<IndexedBufferBindingHost>; |
| 64 | 60 |
| 65 virtual ~IndexedBufferBindingHost(); | 61 virtual ~IndexedBufferBindingHost(); |
| 66 | 62 |
| 67 private: | 63 private: |
| 68 enum IndexedBufferBindingType { | 64 enum IndexedBufferBindingType { |
| 69 kBindBufferBase, | 65 kBindBufferBase, |
| 70 kBindBufferRange, | 66 kBindBufferRange, |
| 71 kBindBufferNone | 67 kBindBufferNone |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool needs_emulation_; | 102 bool needs_emulation_; |
| 107 | 103 |
| 108 // This is used for optimization purpose in context switching. | 104 // This is used for optimization purpose in context switching. |
| 109 size_t max_non_null_binding_index_plus_one_; | 105 size_t max_non_null_binding_index_plus_one_; |
| 110 }; | 106 }; |
| 111 | 107 |
| 112 } // namespace gles2 | 108 } // namespace gles2 |
| 113 } // namespace gpu | 109 } // namespace gpu |
| 114 | 110 |
| 115 #endif // GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ | 111 #endif // GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ |
| OLD | NEW |