const char *caller)
{
struct gl_renderbuffer_attachment *att;
+ bool is_color_attachment;
/* The window-system framebuffer object is immutable */
if (_mesa_is_winsys_fbo(fb)) {
}
/* Not a hash lookup, so we can afford to get the attachment here. */
- att = get_attachment(ctx, fb, attachment, NULL);
+ att = get_attachment(ctx, fb, attachment, &is_color_attachment);
if (att == NULL) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid attachment %s)", caller,
- _mesa_enum_to_string(attachment));
+ if (is_color_attachment) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(invalid color attachment %s)", caller,
+ _mesa_enum_to_string(attachment));
+ } else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(invalid attachment %s)", caller,
+ _mesa_enum_to_string(attachment));
+ }
return;
}