i965/blorp: Add an is_render_target parameter to surface_info::set.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_blorp.cpp
index c7e7cd23126c3decc6b72ca1e7ec0142bf15251b..e519cd91d8ff8456f8f8ac10ea9d7bb85c0b4ec9 100644 (file)
@@ -66,7 +66,8 @@ brw_blorp_mip_info::set(struct intel_mipmap_tree *mt,
 void
 brw_blorp_surface_info::set(struct brw_context *brw,
                             struct intel_mipmap_tree *mt,
-                            unsigned int level, unsigned int layer)
+                            unsigned int level, unsigned int layer,
+                            bool is_render_target)
 {
    brw_blorp_mip_info::set(mt, level, layer);
    this->num_samples = mt->num_samples;
@@ -159,7 +160,7 @@ brw_blorp_params::brw_blorp_params()
 
 extern "C" {
 void
-intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
+intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
               unsigned int level, unsigned int layer, gen6_hiz_op op)
 {
    const char *opname = NULL;
@@ -183,22 +184,20 @@ intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
        __FUNCTION__, opname, mt, level, layer);
 
    brw_hiz_op_params params(mt, level, layer, op);
-   brw_blorp_exec(intel, &params);
+   brw_blorp_exec(brw, &params);
 }
 
 } /* extern "C" */
 
 void
-brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params)
+brw_blorp_exec(struct brw_context *brw, const brw_blorp_params *params)
 {
-   struct brw_context *brw = brw_context(&intel->ctx);
-
-   switch (intel->gen) {
+   switch (brw->gen) {
    case 6:
-      gen6_blorp_exec(intel, params);
+      gen6_blorp_exec(brw, params);
       break;
    case 7:
-      gen7_blorp_exec(intel, params);
+      gen7_blorp_exec(brw, params);
       break;
    default:
       /* BLORP is not supported before Gen6. */
@@ -206,8 +205,8 @@ brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params)
       break;
    }
 
-   if (unlikely(intel->always_flush_batch))
-      intel_batchbuffer_flush(intel);
+   if (unlikely(brw->always_flush_batch))
+      intel_batchbuffer_flush(brw);
 
    /* We've smashed all state compared to what the normal 3D pipeline
     * rendering tracks for GL.
@@ -215,12 +214,14 @@ brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params)
    brw->state.dirty.brw = ~0;
    brw->state.dirty.cache = ~0;
    brw->state_batch_count = 0;
-   intel->batch.need_workaround_flush = true;
+   brw->batch.need_workaround_flush = true;
+   brw->ib.type = -1;
+   intel_batchbuffer_clear_cache(brw);
 
    /* Flush the sampler cache so any texturing from the destination is
     * coherent.
     */
-   intel_batchbuffer_emit_mi_flush(intel);
+   intel_batchbuffer_emit_mi_flush(brw);
 }
 
 brw_hiz_op_params::brw_hiz_op_params(struct intel_mipmap_tree *mt,