| 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_TRANSFORM_FEEDBACK_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 bool active_; | 70 bool active_; |
| 71 bool paused_; | 71 bool paused_; |
| 72 | 72 |
| 73 GLenum primitive_mode_; | 73 GLenum primitive_mode_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // This class keeps tracks of the transform feedbacks and their states. | 76 // This class keeps tracks of the transform feedbacks and their states. |
| 77 class GPU_EXPORT TransformFeedbackManager { | 77 class GPU_EXPORT TransformFeedbackManager { |
| 78 public: | 78 public: |
| 79 // |needs_emulation| is true on Desktop GL 4.1 or lower. | 79 // In theory |needs_emulation| needs to be true on Desktop GL 4.1 or lower. |
| 80 // However, we set it to true everywhere, not to trust drivers to handle |
| 81 // out-of-bounds buffer accesses. |
| 80 TransformFeedbackManager(GLuint max_transform_feedback_separate_attribs, | 82 TransformFeedbackManager(GLuint max_transform_feedback_separate_attribs, |
| 81 bool needs_emulation); | 83 bool needs_emulation); |
| 82 ~TransformFeedbackManager(); | 84 ~TransformFeedbackManager(); |
| 83 | 85 |
| 84 void MarkContextLost() { | 86 void MarkContextLost() { |
| 85 lost_context_ = true; | 87 lost_context_ = true; |
| 86 } | 88 } |
| 87 | 89 |
| 88 // Must call before destruction. | 90 // Must call before destruction. |
| 89 void Destroy(); | 91 void Destroy(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 120 bool needs_emulation_; | 122 bool needs_emulation_; |
| 121 bool lost_context_; | 123 bool lost_context_; |
| 122 | 124 |
| 123 DISALLOW_COPY_AND_ASSIGN(TransformFeedbackManager); | 125 DISALLOW_COPY_AND_ASSIGN(TransformFeedbackManager); |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 } // namespace gles2 | 128 } // namespace gles2 |
| 127 } // namespace gpu | 129 } // namespace gpu |
| 128 | 130 |
| 129 #endif // GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ | 131 #endif // GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ |
| OLD | NEW |