Commit 3eead241 authored by Geoff Lang's avatar Geoff Lang Committed by Commit Bot

Request compressed texture extensions when initializing WebGL extension modules

These extensions were being exposed as requestable but failing to
initialize because they weren't requested.

Allow GL_OES_compressed_ETC1_RGB8_texture in all cases when the driver
supports it.  ANGLE has been updated to only expose this extension with
native support.

TBR=kbr@chromium.org

BUG=angleproject:3675
BUG=983142
BUG=983750

Change-Id: Idb4b20638990432d3526d5559396a695fc814b31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702765
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: default avatarKai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678394}
parent 89c8dbc9
......@@ -553,7 +553,6 @@ crbug.com/906724 [ android opengles ] conformance/textures/video/tex-2d-luminanc
# Misc failures
crbug.com/angleproject/2988 [ android opengles ] conformance/context/context-size-change.html [ Failure ]
crbug.com/angleproject/1552 [ android opengles ] WebglExtension_WEBGL_compressed_texture_etc1 [ Failure ]
############
# ChromeOS #
......
......@@ -1035,14 +1035,9 @@ void FeatureInfo::InitializeFeatures() {
validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_EXTERNAL_OES);
}
// When running on top of ANGLE, also require the
// GL_CHROMIUM_compressed_texture_etc exentsion to expose
// GL_OES_compressed_ETC1_RGB8_texture. There is no query for native support
// of this texture format so assume that if ANGLE natively supports ETC2, ETC1
// is also supported.
if (gfx::HasExtension(extensions, "GL_OES_compressed_ETC1_RGB8_texture") &&
(!gl_version_info_->is_angle ||
gfx::HasExtension(extensions, "GL_CHROMIUM_compressed_texture_etc"))) {
// ANGLE only exposes this extension when it has native support of the
// GL_ETC1_RGB8 format.
if (gfx::HasExtension(extensions, "GL_OES_compressed_ETC1_RGB8_texture")) {
AddExtensionString("GL_OES_compressed_ETC1_RGB8_texture");
feature_flags_.oes_compressed_etc1_rgb8_texture = true;
validators_.compressed_texture_format.AddValue(GL_ETC1_RGB8_OES);
......
......@@ -29,6 +29,9 @@ const WebGLCompressedTextureASTC::BlockSizeCompressASTC
WebGLCompressedTextureASTC::WebGLCompressedTextureASTC(
WebGLRenderingContextBase* context)
: WebGLExtension(context) {
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_KHR_texture_compression_astc_ldr");
const int kAlphaFormatGap =
GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR - GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
......
......@@ -11,6 +11,9 @@ namespace blink {
WebGLCompressedTextureETC1::WebGLCompressedTextureETC1(
WebGLRenderingContextBase* context)
: WebGLExtension(context) {
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_OES_compressed_ETC1_RGB8_texture");
context->AddCompressedTextureFormat(GL_ETC1_RGB8_OES);
}
......
......@@ -32,6 +32,9 @@ namespace blink {
WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC(
WebGLRenderingContextBase* context)
: WebGLExtension(context) {
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_IMG_texture_compression_pvrtc");
context->AddCompressedTextureFormat(GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG);
context->AddCompressedTextureFormat(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG);
context->AddCompressedTextureFormat(GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);
......
......@@ -32,6 +32,15 @@ namespace blink {
WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC(
WebGLRenderingContextBase* context)
: WebGLExtension(context) {
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_EXT_texture_compression_s3tc");
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_ANGLE_texture_compression_dxt1");
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_ANGLE_texture_compression_dxt3");
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_ANGLE_texture_compression_dxt5");
context->AddCompressedTextureFormat(GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
context->AddCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
context->AddCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT);
......
......@@ -11,6 +11,9 @@ namespace blink {
WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB(
WebGLRenderingContextBase* context)
: WebGLExtension(context) {
context->ExtensionsUtil()->EnsureExtensionEnabled(
"GL_EXT_texture_compression_s3tc_srgb");
// TODO(kainino): update these with _EXT versions once
// GL_EXT_compressed_texture_s3tc_srgb is ratified
context->AddCompressedTextureFormat(GL_COMPRESSED_SRGB_S3TC_DXT1_NV);
......
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