Commit d92cfada authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Fix a crash in ExternalVkImageBacking

The crash is because UseSeparateGLTexture() accessing the current
GL context, however there could not have a GL context current, then
the crash happens. Fix the problem by using GLContext in the
SharedContextState instead of the current GL context.

Bug: 1139514
Cq-Include-Trybots: luci.chromium.try:gpu-fyi-try-android-p-pixel-2-skv-32,gpu-fyi-try-linux-intel-skv,gpu-fyi-try-linux-nvidia-skv
Change-Id: I874a8a75b43f218f44b307860415d7d8e8f939ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485291
Auto-Submit: Peng Huang <penghuang@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818500}
parent c7a01671
...@@ -127,8 +127,9 @@ bool UseSeparateGLTexture(SharedContextState* context_state, ...@@ -127,8 +127,9 @@ bool UseSeparateGLTexture(SharedContextState* context_state,
if (format != viz::ResourceFormat::BGRA_8888) if (format != viz::ResourceFormat::BGRA_8888)
return false; return false;
const auto* version_info = context_state->real_context()->GetVersionInfo(); auto* gl_context = context_state->real_context();
const auto& ext = gl::g_current_gl_driver->ext; const auto* version_info = gl_context->GetVersionInfo();
const auto& ext = gl_context->GetCurrentGL()->Driver->ext;
if (!ext.b_GL_EXT_texture_format_BGRA8888) if (!ext.b_GL_EXT_texture_format_BGRA8888)
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment