Commit d7d526ad by Geoff Lang Committed by Commit Bot

Allow enabling GL_EXT_texture_filter_anisotropic.

BUG=angleproject:1721 Change-Id: I7cbc734915cde7d09165a3fcfe9a6bc0d7149aff Reviewed-on: https://chromium-review.googlesource.com/445959Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 8aeeed6e
...@@ -599,7 +599,7 @@ const ExtensionInfoMap &GetExtensionInfoMap() ...@@ -599,7 +599,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_EXT_texture_storage"] = esOnlyExtension(&Extensions::textureStorage); map["GL_EXT_texture_storage"] = esOnlyExtension(&Extensions::textureStorage);
map["GL_OES_texture_npot"] = enableableExtension(&Extensions::textureNPOT); map["GL_OES_texture_npot"] = enableableExtension(&Extensions::textureNPOT);
map["GL_EXT_draw_buffers"] = enableableExtension(&Extensions::drawBuffers); map["GL_EXT_draw_buffers"] = enableableExtension(&Extensions::drawBuffers);
map["GL_EXT_texture_filter_anisotropic"] = esOnlyExtension(&Extensions::textureFilterAnisotropic); map["GL_EXT_texture_filter_anisotropic"] = enableableExtension(&Extensions::textureFilterAnisotropic);
map["GL_EXT_occlusion_query_boolean"] = esOnlyExtension(&Extensions::occlusionQueryBoolean); map["GL_EXT_occlusion_query_boolean"] = esOnlyExtension(&Extensions::occlusionQueryBoolean);
map["GL_NV_fence"] = esOnlyExtension(&Extensions::fence); map["GL_NV_fence"] = esOnlyExtension(&Extensions::fence);
map["GL_ANGLE_timer_query"] = esOnlyExtension(&Extensions::timerQuery); map["GL_ANGLE_timer_query"] = esOnlyExtension(&Extensions::timerQuery);
......
...@@ -312,7 +312,7 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign ...@@ -312,7 +312,7 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
return true; return true;
} }
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
if (!getExtensions().maxTextureAnisotropy) if (!getExtensions().textureFilterAnisotropic)
{ {
return false; return false;
} }
......
...@@ -149,6 +149,45 @@ TEST_P(WebGLCompatibilityTest, EnableExtensionUintIndices) ...@@ -149,6 +149,45 @@ TEST_P(WebGLCompatibilityTest, EnableExtensionUintIndices)
} }
} }
// Test enabling the GL_EXT_texture_filter_anisotropic extension
TEST_P(WebGLCompatibilityTest, EnableExtensionTextureFilterAnisotropic)
{
EXPECT_FALSE(extensionEnabled("GL_EXT_texture_filter_anisotropic"));
GLfloat maxAnisotropy = 0.0f;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy);
EXPECT_GL_ERROR(GL_INVALID_ENUM);
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture.get());
ASSERT_GL_NO_ERROR();
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f);
EXPECT_GL_ERROR(GL_INVALID_ENUM);
GLfloat currentAnisotropy = 0.0f;
glGetTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, &currentAnisotropy);
EXPECT_GL_ERROR(GL_INVALID_ENUM);
if (extensionRequestable("GL_EXT_texture_filter_anisotropic"))
{
glRequestExtensionANGLE("GL_EXT_texture_filter_anisotropic");
EXPECT_GL_NO_ERROR();
EXPECT_TRUE(extensionEnabled("GL_EXT_texture_filter_anisotropic"));
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy);
ASSERT_GL_NO_ERROR();
EXPECT_GE(maxAnisotropy, 2.0f);
glGetTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, &currentAnisotropy);
ASSERT_GL_NO_ERROR();
EXPECT_EQ(1.0f, currentAnisotropy);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 2.0f);
ASSERT_GL_NO_ERROR();
}
}
// Verify that shaders are of a compatible spec when the extension is enabled. // Verify that shaders are of a compatible spec when the extension is enabled.
TEST_P(WebGLCompatibilityTest, ExtensionCompilerSpec) TEST_P(WebGLCompatibilityTest, ExtensionCompilerSpec)
{ {
......
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