i965: Use force_compat_profile driconf option
[mesa.git] / src / mesa / drivers / dri / i965 / brw_meta_util.c
index ba92168934e344a846fdc405ff856d0870edc572..6a6d68425fad878d55f99068dfdd64c971b190aa 100644 (file)
@@ -220,6 +220,10 @@ brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx,
     * 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);
 
@@ -250,20 +254,24 @@ brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx,
    /* 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;
 }
 
 /**
@@ -293,17 +301,6 @@ brw_is_color_fast_clear_compatible(struct brw_context *brw,
        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) {