Commit 65ac5b9c by Geoff Lang Committed by Commit Bot

Allow glGenerateMipmaps on sRGB textures in WebGL.

The generated mipmaps are still not correct on all ANGLE backends. TEST=conformance/extensions/ext-sRGB BUG=angleproject:2009 Change-Id: I6299dcb93c71f48e61ec660347b4747366ecfb71 Reviewed-on: https://chromium-review.googlesource.com/491367 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a7ecec38
...@@ -5554,10 +5554,13 @@ bool ValidateGenerateMipmap(Context *context, GLenum target) ...@@ -5554,10 +5554,13 @@ bool ValidateGenerateMipmap(Context *context, GLenum target)
return false; return false;
} }
// GL_EXT_sRGB does not support mipmap generation on sRGB textures // ES3 and WebGL grant mipmap generation for sRGB textures but GL_EXT_sRGB does not.
if (context->getClientMajorVersion() == 2 && format.info->colorEncoding == GL_SRGB) bool supportsSRGBMipmapGeneration =
context->getClientVersion() >= ES_3_0 || context->getExtensions().webglCompatibility;
if (!supportsSRGBMipmapGeneration && format.info->colorEncoding == GL_SRGB)
{ {
context->handleError(Error(GL_INVALID_OPERATION)); context->handleError(
Error(GL_INVALID_OPERATION, "Mipmap generation of sRGB textures is not allowed."));
return false; return false;
} }
......
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