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

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

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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/indexed_buffer_binding_host.cc
diff --git a/gpu/command_buffer/service/indexed_buffer_binding_host.cc b/gpu/command_buffer/service/indexed_buffer_binding_host.cc
index 351e5f4a5edda715c88c7f34b1a58be9770e3900..8c7525f4efec4a387f6f5f3f963b79fbe39b9414 100644
--- a/gpu/command_buffer/service/indexed_buffer_binding_host.cc
+++ b/gpu/command_buffer/service/indexed_buffer_binding_host.cc
@@ -264,5 +264,16 @@ void IndexedBufferBindingHost::UpdateMaxNonNullBindingIndex(
}
}
+bool IndexedBufferBindingHost::UsesBuffer(
+ size_t used_binding_count, const Buffer* buffer) const {
+ DCHECK(buffer);
+ DCHECK_LE(used_binding_count, buffer_bindings_.size());
+ for (size_t ii = 0; ii < used_binding_count; ++ii) {
+ if (buffer == buffer_bindings_[ii].buffer)
+ return true;
+ }
+ return false;
+}
+
} // namespace gles2
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698