return GL_TRUE;
}
- rb = _mesa_get_read_renderbuffer_for_format(ctx, internalFormat);
- if (rb == NULL) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(read buffer)", dimensions);
- return GL_TRUE;
- }
-
/* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the
* internalFormat.
*/
case GL_LUMINANCE_ALPHA:
break;
default:
- _mesa_error(ctx, GL_INVALID_VALUE,
+ _mesa_error(ctx, GL_INVALID_ENUM,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
_mesa_enum_to_string(internalFormat));
return GL_TRUE;
baseFormat = _mesa_base_tex_format(ctx, internalFormat);
if (baseFormat < 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
+ _mesa_error(ctx, GL_INVALID_ENUM,
"glCopyTexImage%dD(internalFormat=%s)", dimensions,
_mesa_enum_to_string(internalFormat));
return GL_TRUE;
}
+ rb = _mesa_get_read_renderbuffer_for_format(ctx, internalFormat);
+ if (rb == NULL) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(read buffer)", dimensions);
+ return GL_TRUE;
+ }
+
rb_internal_format = rb->InternalFormat;
rb_base_format = _mesa_base_tex_format(ctx, rb->InternalFormat);
if (_mesa_is_color_format(internalFormat)) {