Commit 1170e474 by Zhenyao Mo

Revert "Support GL_ETC1_RGB8_OES in the OpenGL renderer."

This reverts commit 20bf7034. Broke GL2ExtensionTests_compressed_etc1_rgb8_texture_input_run on win bots Change-Id: I2b48aac1512d916671d41e03f0409c404d6d7c88 Reviewed-on: https://chromium-review.googlesource.com/299429Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarZhenyao Mo <zmo@chromium.org>
parent 20bf7034
...@@ -166,7 +166,6 @@ std::vector<std::string> Extensions::getStrings() const ...@@ -166,7 +166,6 @@ std::vector<std::string> Extensions::getStrings() const
InsertExtensionString("GL_EXT_texture_compression_dxt1", textureCompressionDXT1, &extensionStrings); InsertExtensionString("GL_EXT_texture_compression_dxt1", textureCompressionDXT1, &extensionStrings);
InsertExtensionString("GL_ANGLE_texture_compression_dxt3", textureCompressionDXT3, &extensionStrings); InsertExtensionString("GL_ANGLE_texture_compression_dxt3", textureCompressionDXT3, &extensionStrings);
InsertExtensionString("GL_ANGLE_texture_compression_dxt5", textureCompressionDXT5, &extensionStrings); InsertExtensionString("GL_ANGLE_texture_compression_dxt5", textureCompressionDXT5, &extensionStrings);
InsertExtensionString("GL_OES_compressed_ETC1_RGB8_texture", compressedETC1RGB8Texture, &extensionStrings);
InsertExtensionString("GL_EXT_sRGB", sRGB, &extensionStrings); InsertExtensionString("GL_EXT_sRGB", sRGB, &extensionStrings);
InsertExtensionString("GL_ANGLE_depth_texture", depthTextures, &extensionStrings); InsertExtensionString("GL_ANGLE_depth_texture", depthTextures, &extensionStrings);
InsertExtensionString("GL_EXT_texture_storage", textureStorage, &extensionStrings); InsertExtensionString("GL_EXT_texture_storage", textureStorage, &extensionStrings);
...@@ -185,7 +184,7 @@ std::vector<std::string> Extensions::getStrings() const ...@@ -185,7 +184,7 @@ std::vector<std::string> Extensions::getStrings() const
InsertExtensionString("GL_OES_standard_derivatives", standardDerivatives, &extensionStrings); InsertExtensionString("GL_OES_standard_derivatives", standardDerivatives, &extensionStrings);
InsertExtensionString("GL_EXT_shader_texture_lod", shaderTextureLOD, &extensionStrings); InsertExtensionString("GL_EXT_shader_texture_lod", shaderTextureLOD, &extensionStrings);
InsertExtensionString("GL_NV_shader_framebuffer_fetch", NVshaderFramebufferFetch, &extensionStrings); InsertExtensionString("GL_NV_shader_framebuffer_fetch", NVshaderFramebufferFetch, &extensionStrings);
InsertExtensionString("GL_ARM_shader_framebuffer_fetch", ARMshaderFramebufferFetch, &extensionStrings); InsertExtensionString("GL_ARM_shader_framebuffer_fetch", ARMshaderFramebufferFetch,&extensionStrings);
InsertExtensionString("GL_EXT_shader_framebuffer_fetch", shaderFramebufferFetch, &extensionStrings); InsertExtensionString("GL_EXT_shader_framebuffer_fetch", shaderFramebufferFetch, &extensionStrings);
InsertExtensionString("GL_EXT_frag_depth", fragDepth, &extensionStrings); InsertExtensionString("GL_EXT_frag_depth", fragDepth, &extensionStrings);
InsertExtensionString("GL_ANGLE_texture_usage", textureUsage, &extensionStrings); InsertExtensionString("GL_ANGLE_texture_usage", textureUsage, &extensionStrings);
...@@ -354,15 +353,6 @@ static bool DetermineDXT5TextureSupport(const TextureCapsMap &textureCaps) ...@@ -354,15 +353,6 @@ static bool DetermineDXT5TextureSupport(const TextureCapsMap &textureCaps)
return GetFormatSupport(textureCaps, requiredFormats, true, true, false); return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
} }
// Check for GL_ETC1_RGB8_OES
static bool DetermineETC1RGB8TextureSupport(const TextureCapsMap &textureCaps)
{
std::vector<GLenum> requiredFormats;
requiredFormats.push_back(GL_ETC1_RGB8_OES);
return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Check for GL_ANGLE_texture_compression_dxt5 // Check for GL_ANGLE_texture_compression_dxt5
static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps) static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps)
{ {
...@@ -416,7 +406,6 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) ...@@ -416,7 +406,6 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps); textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps);
textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps); textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps);
textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps); textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps);
compressedETC1RGB8Texture = DetermineETC1RGB8TextureSupport(textureCaps);
sRGB = DetermineSRGBTextureSupport(textureCaps); sRGB = DetermineSRGBTextureSupport(textureCaps);
depthTextures = DetermineDepthTextureSupport(textureCaps); depthTextures = DetermineDepthTextureSupport(textureCaps);
colorBufferFloat = DetermineColorBufferFloatSupport(textureCaps); colorBufferFloat = DetermineColorBufferFloatSupport(textureCaps);
......
...@@ -80,7 +80,6 @@ struct Extensions ...@@ -80,7 +80,6 @@ struct Extensions
// GL_OES_texture_float, GL_OES_texture_float_linear // GL_OES_texture_float, GL_OES_texture_float_linear
// GL_EXT_texture_rg // GL_EXT_texture_rg
// GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5 // GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5
// GL_OES_compressed_ETC1_RGB8_texture
// GL_EXT_sRGB // GL_EXT_sRGB
// GL_ANGLE_depth_texture // GL_ANGLE_depth_texture
// GL_EXT_color_buffer_float // GL_EXT_color_buffer_float
...@@ -139,10 +138,6 @@ struct Extensions ...@@ -139,10 +138,6 @@ struct Extensions
bool textureCompressionDXT3; bool textureCompressionDXT3;
bool textureCompressionDXT5; bool textureCompressionDXT5;
// GL_OES_compressed_ETC1_RGB8_texture
// Implies that TextureCaps for GL_ETC1_RGB8_OES exist
bool compressedETC1RGB8Texture;
// GL_EXT_sRGB // GL_EXT_sRGB
// Implies that TextureCaps for GL_SRGB8_ALPHA8 and GL_SRGB8 exist // Implies that TextureCaps for GL_SRGB8_ALPHA8 and GL_SRGB8 exist
// TODO: Don't advertise this extension in ES3 // TODO: Don't advertise this extension in ES3
......
...@@ -469,9 +469,6 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -469,9 +469,6 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
// From GL_ANGLE_texture_compression_dxt5 // From GL_ANGLE_texture_compression_dxt5
map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT5>, NeverSupported, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT5>, NeverSupported, AlwaysSupported)));
// From GL_OES_compressed_ETC1_RGB8_texture
map.insert(InternalFormatInfoPair(GL_ETC1_RGB8_OES, CompressedFormat(4, 4, 64, 3, GL_ETC1_RGB8_OES, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::compressedETC1RGB8Texture>, NeverSupported, AlwaysSupported)));
// For STENCIL_INDEX8 we chose a normalized component type for the following reasons: // For STENCIL_INDEX8 we chose a normalized component type for the following reasons:
// - Multisampled buffer are disallowed for non-normalized integer component types and we want to support it for STENCIL_INDEX8 // - Multisampled buffer are disallowed for non-normalized integer component types and we want to support it for STENCIL_INDEX8
// - All other stencil formats (all depth-stencil) are either float or normalized // - All other stencil formats (all depth-stencil) are either float or normalized
......
...@@ -246,10 +246,6 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -246,10 +246,6 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
// From GL_ANGLE_texture_compression_dxt5 // From GL_ANGLE_texture_compression_dxt5
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_ANGLE_texture_compression_dxt5"), Always(), Never()); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_ANGLE_texture_compression_dxt5"), Always(), Never());
// From GL_ETC1_RGB8_OES
InsertFormatMapping(&map, GL_ETC1_RGB8_OES, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), Always(), Never(), VersionOrExts(3, 0, "GL_ETC1_RGB8_OES"), Always(), Never());
// clang-format on // clang-format on
return map; return map;
...@@ -386,35 +382,6 @@ static GLenum GetNativeFormat(const FunctionsGL *functions, ...@@ -386,35 +382,6 @@ static GLenum GetNativeFormat(const FunctionsGL *functions,
return result; return result;
} }
static GLenum GetNativeCompressedFormat(const FunctionsGL *functions,
const WorkaroundsGL &workarounds,
GLenum format)
{
GLenum result = format;
if (functions->standard == STANDARD_GL_DESKTOP)
{
if (format == GL_ETC1_RGB8_OES)
{
// GL_ETC1_RGB8_OES is not available in any desktop GL extension but the compression
// format is forwards compatible so just use the ETC2 format.
result = GL_COMPRESSED_RGB8_ETC2;
}
}
if (functions->isAtLeastGLES(gl::Version(3, 0)))
{
if (format == GL_ETC1_RGB8_OES)
{
// Pass GL_COMPRESSED_RGB8_ETC2 as the target format in ES3 and higher because it
// becomes a core format.
result = GL_COMPRESSED_RGB8_ETC2;
}
}
return result;
}
static GLenum GetNativeType(const FunctionsGL *functions, static GLenum GetNativeType(const FunctionsGL *functions,
const WorkaroundsGL &workarounds, const WorkaroundsGL &workarounds,
GLenum type) GLenum type)
...@@ -472,7 +439,7 @@ CompressedTexImageFormat GetCompressedTexImageFormat(const FunctionsGL *function ...@@ -472,7 +439,7 @@ CompressedTexImageFormat GetCompressedTexImageFormat(const FunctionsGL *function
GLenum internalFormat) GLenum internalFormat)
{ {
CompressedTexImageFormat result; CompressedTexImageFormat result;
result.internalFormat = GetNativeCompressedFormat(functions, workarounds, internalFormat); result.internalFormat = internalFormat;
return result; return result;
} }
...@@ -481,7 +448,7 @@ CompressedTexSubImageFormat GetCompressedSubTexImageFormat(const FunctionsGL *fu ...@@ -481,7 +448,7 @@ CompressedTexSubImageFormat GetCompressedSubTexImageFormat(const FunctionsGL *fu
GLenum format) GLenum format)
{ {
CompressedTexSubImageFormat result; CompressedTexSubImageFormat result;
result.format = GetNativeCompressedFormat(functions, workarounds, format); result.format = format;
return result; return result;
} }
......
...@@ -165,13 +165,6 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -165,13 +165,6 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (!context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
default: default:
context->recordError(Error(GL_INVALID_ENUM)); context->recordError(Error(GL_INVALID_ENUM));
return false; return false;
...@@ -357,18 +350,6 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -357,18 +350,6 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_OPERATION));
return false;
}
else
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_STENCIL_OES: case GL_DEPTH_STENCIL_OES:
if (!context->getExtensions().depthTextures) if (!context->getExtensions().depthTextures)
...@@ -521,7 +502,6 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le ...@@ -521,7 +502,6 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
case GL_ETC1_RGB8_OES:
context->recordError(Error(GL_INVALID_OPERATION)); context->recordError(Error(GL_INVALID_OPERATION));
return false; return false;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
...@@ -662,18 +642,6 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le ...@@ -662,18 +642,6 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_OPERATION));
return false;
}
else
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
...@@ -791,13 +759,6 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le ...@@ -791,13 +759,6 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
case GL_RGBA32F_EXT: case GL_RGBA32F_EXT:
case GL_RGB32F_EXT: case GL_RGB32F_EXT:
case GL_ALPHA32F_EXT: case GL_ALPHA32F_EXT:
......
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