i965: Add new interface for full color resolves
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 10 Jun 2016 05:23:40 +0000 (08:23 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 25 Nov 2016 14:57:06 +0000 (16:57 +0200)
Upcoming patches will introduce fast clear in level/layer
granularity like the driver does already for depth/hiz. This patch
introduces equivalent full resolve option.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_copy_image.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h
src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
src/mesa/drivers/dri/i965/intel_pixel_read.c
src/mesa/drivers/dri/i965/intel_tex_image.c
src/mesa/drivers/dri/i965/intel_tex_subimage.c

index 0c4783288d82adc2004cc03293a663442bade99c..3f88f7fa221f12abaca29723acb75df93e3c17e7 100644 (file)
@@ -263,7 +263,7 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
        */
       const int flags = intel_texture_view_requires_resolve(brw, tex_obj) ?
                            0 : INTEL_MIPTREE_IGNORE_CCS_E;
-      intel_miptree_resolve_color(brw, tex_obj->mt, flags);
+      intel_miptree_all_slices_resolve_color(brw, tex_obj->mt, flags);
       brw_render_cache_set_check_flush(brw, tex_obj->mt->bo);
 
       if (tex_obj->base.StencilSampling ||
@@ -291,7 +291,7 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
                 * compressed surfaces need to be resolved prior to accessing
                 * them. Hence skip setting INTEL_MIPTREE_IGNORE_CCS_E.
                 */
-               intel_miptree_resolve_color(brw, tex_obj->mt, 0);
+               intel_miptree_all_slices_resolve_color(brw, tex_obj->mt, 0);
 
                if (intel_miptree_is_lossless_compressed(brw, tex_obj->mt) &&
                    intel_disable_rb_aux_buffer(brw, tex_obj->mt->bo)) {
@@ -348,7 +348,7 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
           * should be impossible to get here with such surfaces.
           */
          assert(!intel_miptree_is_lossless_compressed(brw, mt));
-         intel_miptree_resolve_color(brw, mt, 0);
+         intel_miptree_all_slices_resolve_color(brw, mt, 0);
          brw_render_cache_set_check_flush(brw, mt->bo);
       }
    }
index 7698d8ed90bad4c398eb3212ab428e0cc51792da..3b5bf31f5d28ebf36ef5c5d9a658624dcf834270 100644 (file)
@@ -227,11 +227,11 @@ copy_miptrees(struct brw_context *brw,
     */
    intel_miptree_all_slices_resolve_hiz(brw, src_mt);
    intel_miptree_all_slices_resolve_depth(brw, src_mt);
-   intel_miptree_resolve_color(brw, src_mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, src_mt, 0);
 
    intel_miptree_all_slices_resolve_hiz(brw, dst_mt);
    intel_miptree_all_slices_resolve_depth(brw, dst_mt);
-   intel_miptree_resolve_color(brw, dst_mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, dst_mt, 0);
 
    _mesa_get_format_block_size(src_mt->format, &bw, &bh);
 
index 00ae7ba1100444f05e76182f4353b483f6619cf3..328c770f93d5f9e2bf585b2525114582845eeb25 100644 (file)
@@ -2237,6 +2237,13 @@ intel_miptree_resolve_color(struct brw_context *brw,
    }
 }
 
+void
+intel_miptree_all_slices_resolve_color(struct brw_context *brw,
+                                       struct intel_mipmap_tree *mt,
+                                       int flags)
+{
+   intel_miptree_resolve_color(brw, mt, flags);
+}
 
 /**
  * Make it possible to share the BO backing the given miptree with another
@@ -2259,7 +2266,7 @@ intel_miptree_make_shareable(struct brw_context *brw,
    assert(mt->msaa_layout == INTEL_MSAA_LAYOUT_NONE);
 
    if (mt->mcs_buf) {
-      intel_miptree_resolve_color(brw, mt, 0);
+      intel_miptree_all_slices_resolve_color(brw, mt, 0);
       mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_NO_MCS;
    }
 }
@@ -2416,7 +2423,7 @@ intel_miptree_map_raw(struct brw_context *brw, struct intel_mipmap_tree *mt)
    /* CPU accesses to color buffers don't understand fast color clears, so
     * resolve any pending fast color clears before we map.
     */
-   intel_miptree_resolve_color(brw, mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, mt, 0);
 
    drm_intel_bo *bo = mt->bo;
 
index 7ad074c1acc06e92eeefc5dc2dea88495589102d..80cc876b7cef31f12b74074e6f01dfb5bd04c833 100644 (file)
@@ -993,6 +993,11 @@ intel_miptree_resolve_color(struct brw_context *brw,
                             struct intel_mipmap_tree *mt,
                             int flags);
 
+void
+intel_miptree_all_slices_resolve_color(struct brw_context *brw,
+                                       struct intel_mipmap_tree *mt,
+                                       int flags);
+
 void
 intel_miptree_make_shareable(struct brw_context *brw,
                              struct intel_mipmap_tree *mt);
index 8381fe6367e02f442f87c49fabcffe174c8ae465..4522d28a4e1dc4a8abd1e4dfee6e054cbec2e207 100644 (file)
@@ -256,7 +256,7 @@ do_blit_bitmap( struct gl_context *ctx,
    /* The blitter has no idea about fast color clears, so we need to resolve
     * the miptree before we do anything.
     */
-   intel_miptree_resolve_color(brw, irb->mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, irb->mt, 0);
 
    /* Chop it all into chunks that can be digested by hardware: */
    for (py = 0; py < height; py += DY) {
index cacd7e277c8308a6b9fbbc7299bb51cd89e1e70c..c15f891de3fddccd2368350046dbce4066664e71 100644 (file)
@@ -138,7 +138,7 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
    /* Since we are going to read raw data to the miptree, we need to resolve
     * any pending fast color clears before we start.
     */
-   intel_miptree_resolve_color(brw, irb->mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, irb->mt, 0);
 
    bo = irb->mt->bo;
 
index cbff58a6a8431e1cd8ceea6fd304dc451b6655a7..141996f70761f36b132b9cff36ff3da65339540d 100644 (file)
@@ -523,7 +523,7 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx,
    /* Since we are going to write raw data to the miptree, we need to resolve
     * any pending fast color clears before we start.
     */
-   intel_miptree_resolve_color(brw, image->mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, image->mt, 0);
 
    bo = image->mt->bo;
 
index 74d4c57391d0c5a8c9f427a97eec305dc8b08472..b7e52bc4817a765e870a01260ae07fd77181ec92 100644 (file)
@@ -139,7 +139,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
    /* Since we are going to write raw data to the miptree, we need to resolve
     * any pending fast color clears before we start.
     */
-   intel_miptree_resolve_color(brw, image->mt, 0);
+   intel_miptree_all_slices_resolve_color(brw, image->mt, 0);
 
    bo = image->mt->bo;