Commit e1fa9ea7 by Nicolas Capens Committed by Nicolas Capens

Reject copying from GL_RGB10_A2 to unsized formats.

glCopyTexImage2D() with an framebuffer format of GL_RGB10_A2 and internalformat of GL_LUMINANCE_ALPHA was hitting the UNIMPLEMENTED() assert. The spec states that: If an effective internal format exists that has * the same component sizes as, * component sizes greater than or equal to, or * component sizes smaller than or equal to those of the source buffer's effective internal format (for all matching components in <internalformat>), that format is chosen for the new image array and this is the effective internal format of the new texel array. There is no unorm luminance+alpha format that has all components either greater or smaller, so this operation is invalid. Also see https://www.khronos.org/members/login/bugzilla/show_bug.cgi?id=9807#c56 Bug chromium:853424 Change-Id: Ia79a50bf7411a3f2aa87cf7f9bdbcbf971bdd7ce Reviewed-on: https://swiftshader-review.googlesource.com/19768Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent c4972610
...@@ -930,6 +930,13 @@ void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, ...@@ -930,6 +930,13 @@ void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x,
// Determine the sized internal format. // Determine the sized internal format.
if(gl::IsUnsizedInternalFormat(internalformat)) if(gl::IsUnsizedInternalFormat(internalformat))
{ {
if(colorbufferFormat == GL_RGB10_A2)
{
// Not supported with unsized internalformat.
// https://www.khronos.org/members/login/bugzilla/show_bug.cgi?id=9807#c56
return error(GL_INVALID_OPERATION);
}
if(gl::GetBaseInternalFormat(colorbufferFormat) == internalformat) if(gl::GetBaseInternalFormat(colorbufferFormat) == internalformat)
{ {
internalformat = colorbufferFormat; internalformat = colorbufferFormat;
...@@ -959,6 +966,7 @@ void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, ...@@ -959,6 +966,7 @@ void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x,
} }
else else
{ {
printf("internalformat = %x, colorbufferFormat = %X\n", internalformat, colorbufferFormat);
UNIMPLEMENTED(); UNIMPLEMENTED();
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
......
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