Commit 8780d036 authored by Dongseong Hwang's avatar Dongseong Hwang Committed by Commit Bot

webgl, cros: hardware overlay requires BGR native GBM

RGB texture backed by native GMB cannot be bound to FBO on Intel, but BGR
texture backed by native GMB can be bound.

When GL_EXT_texture_format_BGRA8888 is supported, as-is chromium doesn't allow
BGRA and glTexStorage2D together, because the extensions doesn't define BGRA8
storage format.

Now native GBM needs BGR for WebGL hardware overlay, so this CL allows
both of them for WebGL context.

It's safe because WebGL API doesn't expose BGRA, and DrawingBuffer never use
glTexStorage2D(BGRA8).

BUG=746069
TEST=run WebGL Aquarium on eve
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I0e74f738beff16826dcc7af5684791712923851c
Reviewed-on: https://chromium-review.googlesource.com/576967
Commit-Queue: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarDongseong Hwang <dongseong.hwang@intel.com>
Cr-Commit-Position: refs/heads/master@{#488461}
parent ef8f5cf8
......@@ -759,7 +759,9 @@ void FeatureInfo::InitializeFeatures() {
// If neither is present, we expose texture storage.
// When creating ES3 contexts, we do need to expose texture storage, so we
// disable BGRA if we have to.
// When WebGL contexts, BRGA is not needed, because WebGL doesn't expose it.
// In WebGL contexts, BRGA is used for hardware overlay and WebGL 2.0 exposes
// glTexStorage2D. WebGL never uses both BGRA and glTexStorage2D together
// because WebGL API doesn't expose BGRA format. So allow both.
bool has_apple_bgra = extensions.Contains("GL_APPLE_texture_format_BGRA8888");
bool has_ext_bgra = extensions.Contains("GL_EXT_texture_format_BGRA8888");
bool enable_texture_format_bgra8888 =
......@@ -783,9 +785,10 @@ void FeatureInfo::InitializeFeatures() {
enable_texture_storage = false;
break;
case CONTEXT_TYPE_OPENGLES3:
enable_texture_format_bgra8888 = false;
break;
case CONTEXT_TYPE_WEBGL1:
case CONTEXT_TYPE_WEBGL2:
enable_texture_format_bgra8888 = false;
break;
}
}
......
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