{ "GL_EXT_fog_coord", o(EXT_fog_coord), GLL, 1999 },
{ "GL_EXT_framebuffer_blit", o(EXT_framebuffer_blit), GL, 2005 },
{ "GL_EXT_framebuffer_multisample", o(EXT_framebuffer_multisample), GL, 2005 },
+ { "GL_EXT_framebuffer_multisample_blit_scaled", o(EXT_framebuffer_multisample_blit_scaled), GL, 2011 },
{ "GL_EXT_framebuffer_object", o(EXT_framebuffer_object), GL, 2000 },
{ "GL_EXT_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 },
{ "GL_EXT_gpu_program_parameters", o(EXT_gpu_program_parameters), GLL, 2006 },
return GL_FALSE;
}
+static GLboolean
+is_valid_blit_filter(const struct gl_context *ctx, GLenum filter)
+{
+ switch (filter) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ return true;
+ case GL_SCALED_RESOLVE_FASTEST_EXT:
+ case GL_SCALED_RESOLVE_NICEST_EXT:
+ return ctx->Extensions.EXT_framebuffer_multisample_blit_scaled;
+ default:
+ return false;
+ }
+}
/**
* Blit rectangular region, optionally from one framebuffer to another.
return;
}
- if (filter != GL_NEAREST && filter != GL_LINEAR) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)");
+ if (!is_valid_blit_filter(ctx, filter)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(%s)",
+ _mesa_lookup_enum_by_nr(filter));
+ return;
+ }
+
+ if ((filter == GL_SCALED_RESOLVE_FASTEST_EXT ||
+ filter == GL_SCALED_RESOLVE_NICEST_EXT) &&
+ (readFb->Visual.samples == 0 || drawFb->Visual.samples > 0)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(%s)",
+ _mesa_lookup_enum_by_nr(filter));
return;
}
}
}
}
- if (filter == GL_LINEAR) {
- /* 3.1 spec, page 199:
+ if (filter != GL_NEAREST) {
+ /* From EXT_framebuffer_multisample_blit_scaled specification:
* "Calling BlitFramebuffer will result in an INVALID_OPERATION error
- * if filter is LINEAR and read buffer contains integer data."
+ * if filter is not NEAREST and read buffer contains integer data."
*/
GLenum type = _mesa_get_format_datatype(colorReadRb->Format);
if (type == GL_INT || type == GL_UNSIGNED_INT) {
}
/* extra checks for multisample copies... */
- if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) {
+ if ((readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) &&
+ (filter == GL_NEAREST || filter == GL_LINEAR)) {
/* src and dest region sizes must be the same */
if (abs(srcX1 - srcX0) != abs(dstX1 - dstX0) ||
abs(srcY1 - srcY0) != abs(dstY1 - dstY0)) {