* 4 * 2 = 8 > 5 in the src.
*/
+ if (*srcX0 == *srcX1 || *srcY0 == *srcY1
+ || *dstX0 == *dstX1 || *dstY0 == *dstY1)
+ return true;
+
float scaleX = (float) (*srcX1 - *srcX0) / (*dstX1 - *dstX0);
float scaleY = (float) (*srcY1 - *srcY0) / (*dstY1 - *dstY0);
/* Account for the fact that in the system framebuffer, the origin is at
* the lower left.
*/
- if (_mesa_is_winsys_fbo(read_fb)) {
+ if (read_fb->FlipY) {
GLint tmp = read_fb->Height - *srcY0;
*srcY0 = read_fb->Height - *srcY1;
*srcY1 = tmp;
*mirror_y = !*mirror_y;
}
- if (_mesa_is_winsys_fbo(draw_fb)) {
+ if (draw_fb->FlipY) {
GLint tmp = draw_fb->Height - *dstY0;
*dstY0 = draw_fb->Height - *dstY1;
*dstY1 = tmp;
*mirror_y = !*mirror_y;
}
- return false;
+ /* Check for invalid bounds
+ * Can't blit for 0-dimensions
+ */
+ return *srcX0 == *srcX1 || *srcY0 == *srcY1
+ || *dstX0 == *dstX1 || *dstY0 == *dstY1;
}
/**
brw->mesa_to_isl_render_format[mt->format])
return false;
- /* Gen9 doesn't support fast clear on single-sampled SRGB buffers. When
- * GL_FRAMEBUFFER_SRGB is enabled any color renderbuffers will be
- * resolved in intel_update_state. In that case it's pointless to do a
- * fast clear because it's very likely to be immediately resolved.
- */
- if (devinfo->gen >= 9 &&
- mt->surf.samples == 1 &&
- ctx->Color.sRGBEnabled &&
- _mesa_get_srgb_format_linear(mt->format) != mt->format)
- return false;
-
const mesa_format format = _mesa_get_render_format(ctx, mt->format);
if (_mesa_is_format_integer_color(format)) {
if (devinfo->gen >= 8) {