Commit d54d3045 by Geoff Lang Committed by Commit Bot

Make EXT_texture_storage enableable.

BUG=angleproject:1523 Change-Id: I55ef1233fb42e2dc3eda26c3aa4e14c700f98bf0 Reviewed-on: https://chromium-review.googlesource.com/756868Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent e24032a2
......@@ -642,7 +642,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_EXT_sRGB"] = enableableExtension(&Extensions::sRGB);
map["GL_ANGLE_depth_texture"] = esOnlyExtension(&Extensions::depthTextures);
map["GL_OES_depth32"] = esOnlyExtension(&Extensions::depth32);
map["GL_EXT_texture_storage"] = esOnlyExtension(&Extensions::textureStorage);
map["GL_EXT_texture_storage"] = enableableExtension(&Extensions::textureStorage);
map["GL_OES_texture_npot"] = enableableExtension(&Extensions::textureNPOT);
map["GL_EXT_draw_buffers"] = enableableExtension(&Extensions::drawBuffers);
map["GL_EXT_texture_filter_anisotropic"] = enableableExtension(&Extensions::textureFilterAnisotropic);
......
......@@ -78,6 +78,7 @@ ContextNULL::ContextNULL(const gl::ContextState &state, AllocationTrackerNULL *a
mExtensions.debugMarker = true;
mExtensions.translatedShaderSource = true;
mExtensions.textureStorage = true;
mExtensions.rgb8rgba8 = true;
mExtensions.textureCompressionDXT1 = true;
mExtensions.textureCompressionDXT3 = true;
......
......@@ -482,6 +482,47 @@ TEST_P(WebGLCompatibilityTest, EnablePixelBufferObjectExtensions)
}
}
// Test enabling the GL_EXT_texture_storage extension
TEST_P(WebGLCompatibilityTest, EnableTextureStorage)
{
EXPECT_FALSE(extensionEnabled("GL_EXT_texture_storage"));
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture);
GLint result;
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_IMMUTABLE_FORMAT, &result);
if (getClientMajorVersion() >= 3)
{
EXPECT_GL_NO_ERROR();
}
else
{
EXPECT_GL_ERROR(GL_INVALID_ENUM);
}
if (extensionRequestable("GL_EXT_texture_storage"))
{
glRequestExtensionANGLE("GL_EXT_texture_storage");
EXPECT_GL_NO_ERROR();
EXPECT_TRUE(extensionEnabled("GL_EXT_texture_storage"));
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_IMMUTABLE_FORMAT, &result);
EXPECT_GL_NO_ERROR();
const GLenum alwaysAcceptableFormats[] = {
GL_ALPHA8_EXT, GL_LUMINANCE8_EXT, GL_LUMINANCE8_ALPHA8_EXT,
};
for (const auto &acceptableFormat : alwaysAcceptableFormats)
{
GLTexture localTexture;
glBindTexture(GL_TEXTURE_2D, localTexture);
glTexStorage2DEXT(GL_TEXTURE_2D, 1, acceptableFormat, 1, 1);
EXPECT_GL_NO_ERROR();
}
}
}
// Test enabling the GL_OES_mapbuffer and GL_EXT_map_buffer_range extensions
TEST_P(WebGLCompatibilityTest, EnableMapBufferExtensions)
{
......
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