Skip to content

Commit

Permalink
Add EGL extensions for WebGL prior to InitializeDynamicBindings
Browse files Browse the repository at this point in the history
ANGLE by default disables requestable extensions for WebGL. To support
GL passthrough interop with VkImageBacking, GL_EXT_memory_object,
GL_EXT_memory_object_fd, GL_EXT_semaphore, GL_EXT_semaphore_fd are
needed.

Bug: 1025451
Change-Id: If3849d7a3ddd8bf33616b57c67703e9eb7d40340
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1927977
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Kramer Ge <fangzhoug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718672}
  • Loading branch information
fangzhoug authored and Commit Bot committed Nov 25, 2019
1 parent 0c8f086 commit 2638229
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
17 changes: 1 addition & 16 deletions gpu/command_buffer/service/external_vk_image_backing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,23 +674,8 @@ ExternalVkImageBacking::ProduceGLTexturePassthrough(
DLOG(ERROR) << "The backing is not created with GLES2 usage.";
return nullptr;
}
#if defined(OS_LINUX)
gl::GLApi* api = gl::g_current_gl_context;
// Request extensions from ANGLE
if (!gl::g_current_gl_driver->ext.b_GL_EXT_memory_object ||
!gl::g_current_gl_driver->ext.b_GL_EXT_memory_object_fd ||
!gl::g_current_gl_driver->ext.b_GL_EXT_semaphore ||
!gl::g_current_gl_driver->ext.b_GL_EXT_semaphore_fd) {
api->glRequestExtensionANGLEFn("GL_EXT_memory_object");
api->glRequestExtensionANGLEFn("GL_EXT_memory_object_fd");
api->glRequestExtensionANGLEFn("GL_EXT_semaphore");
api->glRequestExtensionANGLEFn("GL_EXT_semaphore_fd");
// TODO(crbug.com/1025451): ReinitializeDynamicBindings is expensive and
// should be removed once eglCreateContext can be conficured to specify
// which extensions to enable.
gl::GLContext::GetCurrent()->ReinitializeDynamicBindings();
}

#if defined(OS_LINUX)
if (!texture_passthrough_) {
GLuint texture_service_id = ProduceGLTextureInternal();
if (!texture_service_id)
Expand Down
4 changes: 4 additions & 0 deletions gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,10 @@ gpu::ContextResult GLES2DecoderPassthroughImpl::Initialize(
"GL_CHROMIUM_bind_uniform_location",
"GL_CHROMIUM_sync_query",
"GL_EXT_debug_marker",
"GL_EXT_memory_object",
"GL_EXT_memory_object_fd",
"GL_EXT_semaphore",
"GL_EXT_semaphore_fd",
"GL_KHR_debug",
"GL_NV_fence",
"GL_OES_EGL_image",
Expand Down

0 comments on commit 2638229

Please sign in to comment.