Commit 8c7133ca by Geoff Lang Committed by Commit Bot

Make GL_OES_fbo_render_mipmap enableable.

BUG=angleproject:1523 Change-Id: If50a4bf5e33bf0b9ad76a9c6bb999cf4d620c709 Reviewed-on: https://chromium-review.googlesource.com/685647 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 3fab7634
...@@ -667,7 +667,7 @@ const ExtensionInfoMap &GetExtensionInfoMap() ...@@ -667,7 +667,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_ANGLE_multiview"] = enableableExtension(&Extensions::multiview); map["GL_ANGLE_multiview"] = enableableExtension(&Extensions::multiview);
map["GL_ANGLE_texture_usage"] = esOnlyExtension(&Extensions::textureUsage); map["GL_ANGLE_texture_usage"] = esOnlyExtension(&Extensions::textureUsage);
map["GL_ANGLE_translated_shader_source"] = esOnlyExtension(&Extensions::translatedShaderSource); map["GL_ANGLE_translated_shader_source"] = esOnlyExtension(&Extensions::translatedShaderSource);
map["GL_OES_fbo_render_mipmap"] = esOnlyExtension(&Extensions::fboRenderMipmap); map["GL_OES_fbo_render_mipmap"] = enableableExtension(&Extensions::fboRenderMipmap);
map["GL_EXT_discard_framebuffer"] = esOnlyExtension(&Extensions::discardFramebuffer); map["GL_EXT_discard_framebuffer"] = esOnlyExtension(&Extensions::discardFramebuffer);
map["GL_EXT_debug_marker"] = esOnlyExtension(&Extensions::debugMarker); map["GL_EXT_debug_marker"] = esOnlyExtension(&Extensions::debugMarker);
map["GL_OES_EGL_image"] = esOnlyExtension(&Extensions::eglImage); map["GL_OES_EGL_image"] = esOnlyExtension(&Extensions::eglImage);
......
...@@ -521,6 +521,37 @@ TEST_P(WebGLCompatibilityTest, EnableMapBufferExtensions) ...@@ -521,6 +521,37 @@ TEST_P(WebGLCompatibilityTest, EnableMapBufferExtensions)
} }
} }
// Test enabling the GL_OES_fbo_render_mipmap extension
TEST_P(WebGLCompatibilityTest, EnableRenderMipmapExtension)
{
EXPECT_FALSE(extensionEnabled("GL_OES_fbo_render_mipmap"));
// This extensions become core in in ES3/WebGL2.
ANGLE_SKIP_TEST_IF(getClientMajorVersion() >= 3);
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
EXPECT_GL_NO_ERROR();
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 1);
EXPECT_GL_ERROR(GL_INVALID_VALUE);
if (extensionRequestable("GL_OES_fbo_render_mipmap"))
{
glRequestExtensionANGLE("GL_OES_fbo_render_mipmap");
EXPECT_GL_NO_ERROR();
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 1);
EXPECT_GL_NO_ERROR();
}
}
// Verify that the context generates the correct error when the framebuffer attachments are // Verify that the context generates the correct error when the framebuffer attachments are
// different sizes // different sizes
TEST_P(WebGLCompatibilityTest, FramebufferAttachmentSizeMissmatch) TEST_P(WebGLCompatibilityTest, FramebufferAttachmentSizeMissmatch)
......
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