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

Unified Diff: gpu/command_buffer/client/gles2_implementation_impl_autogen.h

Issue 2826043002: Do not share FBOs/VAOs/Transform feedback objects across contexts (Closed)
Patch Set: @review comments Created 3 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/client/gles2_implementation_impl_autogen.h
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index a5a5091eed8901a1962b807c87dab330f03b722f..7adcfddcf795fe0e429e2849bf3c9e69b5959fae 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -446,7 +446,7 @@ GLuint GLES2Implementation::CreateProgram() {
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateProgram("
<< ")");
GLuint client_id;
- GetIdHandler(id_namespaces::kProgramsAndShaders)
+ GetIdHandler(ToInt(SharedIdNamespaces::kProgramsAndShaders))
->MakeIds(this, 0, 1, &client_id);
helper_->CreateProgram(client_id);
GPU_CLIENT_LOG("returned " << client_id);
@@ -459,7 +459,7 @@ GLuint GLES2Implementation::CreateShader(GLenum type) {
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateShader("
<< GLES2Util::GetStringShaderType(type) << ")");
GLuint client_id;
- GetIdHandler(id_namespaces::kProgramsAndShaders)
+ GetIdHandler(ToInt(SharedIdNamespaces::kProgramsAndShaders))
->MakeIds(this, 0, 1, &client_id);
helper_->CreateShader(type, client_id);
GPU_CLIENT_LOG("returned " << client_id);
@@ -681,7 +681,8 @@ GLsync GLES2Implementation::FenceSync(GLenum condition, GLbitfield flags) {
return 0;
}
GLuint client_id;
- GetIdHandler(id_namespaces::kSyncs)->MakeIds(this, 0, 1, &client_id);
+ GetIdHandler(ToInt(SharedIdNamespaces::kSyncs))
+ ->MakeIds(this, 0, 1, &client_id);
helper_->FenceSync(client_id);
GPU_CLIENT_LOG("returned " << client_id);
CheckGLError();
@@ -749,7 +750,8 @@ void GLES2Implementation::GenBuffers(GLsizei n, GLuint* buffers) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kBuffers)->MakeIds(this, 0, n, buffers);
+ GetIdHandler(ToInt(SharedIdNamespaces::kBuffers))
+ ->MakeIds(this, 0, n, buffers);
GenBuffersHelper(n, buffers);
helper_->GenBuffersImmediate(n, buffers);
if (share_group_->bind_generates_resource())
@@ -778,7 +780,10 @@ void GLES2Implementation::GenFramebuffers(GLsizei n, GLuint* framebuffers) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kFramebuffers)->MakeIds(this, 0, n, framebuffers);
+ IdAllocator* id_allocator =
+ GetIdAllocator(ToInt(IdNamespaces::kFramebuffers));
+ for (GLsizei ii = 0; ii < n; ++ii)
+ framebuffers[ii] = id_allocator->AllocateID();
GenFramebuffersHelper(n, framebuffers);
helper_->GenFramebuffersImmediate(n, framebuffers);
if (share_group_->bind_generates_resource())
@@ -799,7 +804,7 @@ void GLES2Implementation::GenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kRenderbuffers)
+ GetIdHandler(ToInt(SharedIdNamespaces::kRenderbuffers))
->MakeIds(this, 0, n, renderbuffers);
GenRenderbuffersHelper(n, renderbuffers);
helper_->GenRenderbuffersImmediate(n, renderbuffers);
@@ -821,7 +826,8 @@ void GLES2Implementation::GenSamplers(GLsizei n, GLuint* samplers) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kSamplers)->MakeIds(this, 0, n, samplers);
+ GetIdHandler(ToInt(SharedIdNamespaces::kSamplers))
+ ->MakeIds(this, 0, n, samplers);
GenSamplersHelper(n, samplers);
helper_->GenSamplersImmediate(n, samplers);
if (share_group_->bind_generates_resource())
@@ -842,7 +848,8 @@ void GLES2Implementation::GenTextures(GLsizei n, GLuint* textures) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kTextures)->MakeIds(this, 0, n, textures);
+ GetIdHandler(ToInt(SharedIdNamespaces::kTextures))
+ ->MakeIds(this, 0, n, textures);
GenTexturesHelper(n, textures);
helper_->GenTexturesImmediate(n, textures);
if (share_group_->bind_generates_resource())
@@ -863,7 +870,10 @@ void GLES2Implementation::GenTransformFeedbacks(GLsizei n, GLuint* ids) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kTransformFeedbacks)->MakeIds(this, 0, n, ids);
+ IdAllocator* id_allocator =
+ GetIdAllocator(ToInt(IdNamespaces::kTransformFeedbacks));
+ for (GLsizei ii = 0; ii < n; ++ii)
+ ids[ii] = id_allocator->AllocateID();
GenTransformFeedbacksHelper(n, ids);
helper_->GenTransformFeedbacksImmediate(n, ids);
if (share_group_->bind_generates_resource())
@@ -2926,7 +2936,7 @@ void GLES2Implementation::GenQueriesEXT(GLsizei n, GLuint* queries) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- IdAllocator* id_allocator = GetIdAllocator(id_namespaces::kQueries);
+ IdAllocator* id_allocator = GetIdAllocator(ToInt(IdNamespaces::kQueries));
for (GLsizei ii = 0; ii < n; ++ii)
queries[ii] = id_allocator->AllocateID();
GenQueriesEXTHelper(n, queries);
@@ -2989,7 +2999,10 @@ void GLES2Implementation::GenVertexArraysOES(GLsizei n, GLuint* arrays) {
return;
}
GPU_CLIENT_SINGLE_THREAD_CHECK();
- GetIdHandler(id_namespaces::kVertexArrays)->MakeIds(this, 0, n, arrays);
+ IdAllocator* id_allocator =
+ GetIdAllocator(ToInt(IdNamespaces::kVertexArrays));
+ for (GLsizei ii = 0; ii < n; ++ii)
+ arrays[ii] = id_allocator->AllocateID();
GenVertexArraysOESHelper(n, arrays);
helper_->GenVertexArraysOESImmediate(n, arrays);
if (share_group_->bind_generates_resource())

Powered by Google App Engine
This is Rietveld 408576698