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

Unified Diff: gpu/command_buffer/service/indexed_buffer_binding_host.h

Issue 1949303003: Improve indexed gl state related GL commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: fix a DCHECK failure Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/indexed_buffer_binding_host.h
diff --git a/gpu/command_buffer/service/indexed_buffer_binding_host.h b/gpu/command_buffer/service/indexed_buffer_binding_host.h
index ef96ddff96dffcc4343534972d8b17c671127f6d..54e88569e1b377946becc43ab9b5aaa838a7e646 100644
--- a/gpu/command_buffer/service/indexed_buffer_binding_host.h
+++ b/gpu/command_buffer/service/indexed_buffer_binding_host.h
@@ -46,6 +46,9 @@ class GPU_EXPORT IndexedBufferBindingHost :
GLsizeiptr GetBufferSize(GLuint index) const;
GLintptr GetBufferStart(GLuint index) const;
+ // This is used only for UNIFORM_BUFFER bindings in context switching.
+ void RestoreBindings(IndexedBufferBindingHost* prev);
+
protected:
friend class base::RefCounted<IndexedBufferBindingHost>;
@@ -72,6 +75,8 @@ class GPU_EXPORT IndexedBufferBindingHost :
IndexedBufferBinding(const IndexedBufferBinding& other);
~IndexedBufferBinding();
+ bool operator==(const IndexedBufferBinding& other) const;
+
void SetBindBufferBase(Buffer* _buffer);
void SetBindBufferRange(
Buffer* _buffer, GLintptr _offset, GLsizeiptr _size);
@@ -84,9 +89,14 @@ class GPU_EXPORT IndexedBufferBindingHost :
GLenum target, GLuint index, GLuint service_id, GLintptr offset,
GLsizeiptr size, GLsizeiptr full_buffer_size);
+ void UpdateMaxNonNullBindingIndex(size_t changed_index);
+
std::vector<IndexedBufferBinding> buffer_bindings_;
bool needs_emulation_;
+
+ // This is used for optimization purpose in context switching.
+ size_t max_non_null_binding_index_plus_one_;
};
} // namespace gles2

Powered by Google App Engine
This is Rietveld 408576698