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

Unified Diff: gpu/command_buffer/client/share_group.cc

Issue 846943002: Improve BindBufferBase/BindBufferRange and a few other commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « gpu/command_buffer/client/share_group.h ('k') | gpu/command_buffer/service/context_group.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/share_group.cc
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc
index 726714f2e2e4bf9d52f5b156ba20cc78d829a70d..755614b3a5099560854b110086f6b9865a8fd71d 100644
--- a/gpu/command_buffer/client/share_group.cc
+++ b/gpu/command_buffer/client/share_group.cc
@@ -76,6 +76,28 @@ class IdHandler : public IdHandlerInterface {
(gl_impl->*bind_fn)(target, id);
return result;
}
+ bool MarkAsUsedForBind(GLES2Implementation* gl_impl,
+ GLenum target,
+ GLuint index,
+ GLuint id,
+ BindIndexedFn bind_fn) override {
+ base::AutoLock auto_lock(lock_);
+ bool result = id ? id_allocator_.MarkAsUsed(id) : true;
+ (gl_impl->*bind_fn)(target, index, id);
+ return result;
+ }
+ bool MarkAsUsedForBind(GLES2Implementation* gl_impl,
+ GLenum target,
+ GLuint index,
+ GLuint id,
+ GLintptr offset,
+ GLsizeiptr size,
+ BindIndexedRangeFn bind_fn) override {
+ base::AutoLock auto_lock(lock_);
+ bool result = id ? id_allocator_.MarkAsUsed(id) : true;
+ (gl_impl->*bind_fn)(target, index, id, offset, size);
+ return result;
+ }
void FreeContext(GLES2Implementation* gl_impl) override {}
@@ -166,6 +188,42 @@ class StrictIdHandler : public IdHandlerInterface {
(gl_impl->*bind_fn)(target, id);
return true;
}
+ bool MarkAsUsedForBind(GLES2Implementation* gl_impl,
+ GLenum target,
+ GLuint index,
+ GLuint id,
+ BindIndexedFn bind_fn) override {
+#ifndef NDEBUG
+ if (id != 0) {
+ base::AutoLock auto_lock(lock_);
+ DCHECK(id_states_[id - 1] == kIdInUse);
+ }
+#endif
+ // StrictIdHandler is used if |bind_generates_resource| is false. In that
+ // case, |bind_fn| will not use Flush() after helper->Bind*(), so it is OK
+ // to call |bind_fn| without holding the lock.
+ (gl_impl->*bind_fn)(target, index, id);
+ return true;
+ }
+ bool MarkAsUsedForBind(GLES2Implementation* gl_impl,
+ GLenum target,
+ GLuint index,
+ GLuint id,
+ GLintptr offset,
+ GLsizeiptr size,
+ BindIndexedRangeFn bind_fn) override {
+#ifndef NDEBUG
+ if (id != 0) {
+ base::AutoLock auto_lock(lock_);
+ DCHECK(id_states_[id - 1] == kIdInUse);
+ }
+#endif
+ // StrictIdHandler is used if |bind_generates_resource| is false. In that
+ // case, |bind_fn| will not use Flush() after helper->Bind*(), so it is OK
+ // to call |bind_fn| without holding the lock.
+ (gl_impl->*bind_fn)(target, index, id, offset, size);
+ return true;
+ }
// Overridden from IdHandlerInterface.
void FreeContext(GLES2Implementation* gl_impl) override {
@@ -235,6 +293,24 @@ class NonReusedIdHandler : public IdHandlerInterface {
// This is only used for Shaders and Programs which have no bind.
return false;
}
+ bool MarkAsUsedForBind(GLES2Implementation* /* gl_impl */,
+ GLenum /* target */,
+ GLuint /* index */,
+ GLuint /* id */,
+ BindIndexedFn /* bind_fn */) override {
+ // This is only used for Shaders and Programs which have no bind.
+ return false;
+ }
+ bool MarkAsUsedForBind(GLES2Implementation* /* gl_impl */,
+ GLenum /* target */,
+ GLuint /* index */,
+ GLuint /* id */,
+ GLintptr /* offset */,
+ GLsizeiptr /* size */,
+ BindIndexedRangeFn /* bind_fn */) override {
+ // This is only used for Shaders and Programs which have no bind.
+ return false;
+ }
void FreeContext(GLES2Implementation* gl_impl) override {}
« no previous file with comments | « gpu/command_buffer/client/share_group.h ('k') | gpu/command_buffer/service/context_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698