i965/blorp/clear: Move isl_surf setup higher in the function
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 25 Jul 2016 21:09:14 +0000 (14:09 -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 6c527f516338fc91bf20adcebf1aee5f69a1bb0d..81868c6364efad4c800f933c22190973af2d340c 100644 (file)
@@ -201,16 +201,6 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
       is_fast_clear = true;
    }
 
-   if (is_fast_clear) {
-      memset(&params.wm_inputs, 0xff, 4*sizeof(float));
-      params.fast_clear_op = GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE;
-
-      brw_get_fast_clear_rect(brw, irb->mt, &params.x0, &params.y0,
-                              &params.x1, &params.y1);
-   }
-
-   brw_blorp_params_get_clear_kernel(brw, &params, use_simd16_replicated_data);
-
    intel_miptree_check_level_layer(irb->mt, irb->mt_level, layer);
    intel_miptree_used_for_rendering(irb->mt);
 
@@ -222,6 +212,16 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
                                brw_blorp_to_isl_format(brw, format, true),
                                true);
 
+   if (is_fast_clear) {
+      memset(&params.wm_inputs, 0xff, 4*sizeof(float));
+      params.fast_clear_op = GEN7_PS_RENDER_TARGET_FAST_CLEAR_ENABLE;
+
+      brw_get_fast_clear_rect(brw, irb->mt, &params.x0, &params.y0,
+                              &params.x1, &params.y1);
+   }
+
+   brw_blorp_params_get_clear_kernel(brw, &params, use_simd16_replicated_data);
+
    const char *clear_type;
    if (is_fast_clear)
       clear_type = "fast";