i965/blorp/clear: Initialize surface info after allocating an MCS
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 23 Jun 2016 22:32:57 +0000 (15:32 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 17 Aug 2016 21:46:22 +0000 (14:46 -0700)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp

index 1bc0dbbe7563b36d91efa7fb318b4c063eb47820..1e00719ff847be183e7cb7b808a2250582d8cb7c 100644 (file)
@@ -135,12 +135,6 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
    if (!encode_srgb && _mesa_get_format_color_encoding(format) == GL_SRGB)
       format = _mesa_get_srgb_format_linear(format);
 
-   brw_blorp_surface_info_init(brw, &params.dst, irb->mt, irb->mt_level,
-                               layer, format, true);
-
-   /* Override the surface format according to the context's sRGB rules. */
-   params.dst.brw_surfaceformat = brw->render_target_format[format];
-
    params.x0 = fb->_Xmin;
    params.x1 = fb->_Xmax;
    if (rb->Name != 0) {
@@ -218,6 +212,12 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
       }
    }
 
+   brw_blorp_surface_info_init(brw, &params.dst, irb->mt, irb->mt_level,
+                               layer, format, true);
+
+   /* Override the surface format according to the context's sRGB rules. */
+   params.dst.brw_surfaceformat = brw->render_target_format[format];
+
    const char *clear_type;
    if (is_fast_clear)
       clear_type = "fast";