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

Side by Side Diff: gpu/command_buffer/service/indexed_buffer_binding_host.h

Issue 2435803004: Initialize buffers before allowing access to them. (Closed)
Patch Set: win failure Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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
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
58 protected: 62 protected:
59 friend class base::RefCounted<IndexedBufferBindingHost>; 63 friend class base::RefCounted<IndexedBufferBindingHost>;
60 64
61 virtual ~IndexedBufferBindingHost(); 65 virtual ~IndexedBufferBindingHost();
62 66
63 private: 67 private:
64 enum IndexedBufferBindingType { 68 enum IndexedBufferBindingType {
65 kBindBufferBase, 69 kBindBufferBase,
66 kBindBufferRange, 70 kBindBufferRange,
67 kBindBufferNone 71 kBindBufferNone
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 bool needs_emulation_; 106 bool needs_emulation_;
103 107
104 // This is used for optimization purpose in context switching. 108 // This is used for optimization purpose in context switching.
105 size_t max_non_null_binding_index_plus_one_; 109 size_t max_non_null_binding_index_plus_one_;
106 }; 110 };
107 111
108 } // namespace gles2 112 } // namespace gles2
109 } // namespace gpu 113 } // namespace gpu
110 114
111 #endif // GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_ 115 #endif // GPU_COMMAND_BUFFER_SERVICE_INDEXED_BUFFER_BINDING_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698