Commit a24be8c3 by Geoff Lang Committed by Commit Bot

Don't allow glReadPixels of depth buffers with ES3.1.

The ES3.1 spec does not appear to include these formats as valid glReadPixels formats. Test=KHR-GLES3.packed_pixels.rectangle.depth24_stencil8 BUG=angleproject:3520 Change-Id: I6ccd5a7fc49c2e16885cfaace56efce1d96e937a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2216713Reviewed-by: 's avatarAlexis Hétu <sugoi@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent 3d5f0c82
......@@ -167,19 +167,12 @@ bool ValidReadPixelsUnsignedNormalizedDepthType(const Context *context,
{
bool supportsReadDepthNV = (context->getExtensions().readDepthNV && (info->depthBits > 0) &&
(info->componentCount == 1));
bool isGLES31 = (context->getClientVersion() >= ES_3_1);
switch (type)
{
case GL_UNSIGNED_SHORT:
return supportsReadDepthNV ||
(isGLES31 && (info->sizedInternalFormat == GL_DEPTH_COMPONENT16));
case GL_UNSIGNED_INT:
return supportsReadDepthNV ||
(isGLES31 && ((info->sizedInternalFormat == GL_DEPTH_COMPONENT16) ||
(info->internalFormat == GL_DEPTH_COMPONENT24)));
case GL_UNSIGNED_INT_24_8:
return supportsReadDepthNV ||
(isGLES31 && (info->sizedInternalFormat == GL_DEPTH24_STENCIL8));
return supportsReadDepthNV;
default:
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