Commit f89cd0b8 by Alexis Hetu Committed by Alexis Hétu

glGenerateMipmap validation

Can't generate mipmaps if the format is not color renderable or not filterable. Change-Id: I919a4c29c17a69c25e018dd4682940eecd4df30e Reviewed-on: https://swiftshader-review.googlesource.com/14068Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent bbb8fc17
...@@ -2306,6 +2306,12 @@ void GenerateMipmap(GLenum target) ...@@ -2306,6 +2306,12 @@ void GenerateMipmap(GLenum target)
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
if(!IsColorRenderable(texture->getFormat(target, 0), clientVersion, true) ||
sw::Surface::isNonNormalizedInteger(texture->getInternalFormat(target, 0)))
{
return error(GL_INVALID_OPERATION);
}
texture->generateMipmaps(); texture->generateMipmaps();
} }
} }
......
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