gallium/u_blitter: document custom meta helpers
authorMarek Olšák <maraeo@gmail.com>
Mon, 13 Aug 2012 21:37:30 +0000 (23:37 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 15 Aug 2012 17:20:58 +0000 (19:20 +0200)
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_blitter.h
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r600/r600_blit.c

index a5510d553e9a00a3b33926c278afd69e306ca39a..a95e1b5356ea26c8ce431f9452167ccc62777e7a 100644 (file)
@@ -962,7 +962,7 @@ void util_blitter_clear(struct blitter_context *blitter,
                              NULL, NULL);
 }
 
-void util_blitter_clear_depth_custom(struct blitter_context *blitter,
+void util_blitter_custom_clear_depth(struct blitter_context *blitter,
                                      unsigned width, unsigned height,
                                      double depth, void *custom_dsa)
 {
@@ -1493,7 +1493,7 @@ void util_blitter_copy_buffer(struct blitter_context *blitter,
 }
 
 /* probably radeon specific */
-void util_blitter_resolve_color_custom(struct blitter_context *blitter,
+void util_blitter_custom_resolve_color(struct blitter_context *blitter,
                                       struct pipe_resource *dst,
                                       unsigned dst_level,
                                       unsigned dst_layer,
index 1207a9ae306d8d29e73711ecc9922b055bcef333..f227902c163148e200072993d11be8066095724c 100644 (file)
@@ -156,10 +156,6 @@ void util_blitter_clear(struct blitter_context *blitter,
                         const union pipe_color_union *color,
                         double depth, unsigned stencil);
 
-void util_blitter_clear_depth_custom(struct blitter_context *blitter,
-                                     unsigned width, unsigned height,
-                                     double depth, void *custom_dsa);
-
 /**
  * Check if the blitter (with the help of the driver) can blit between
  * the two resources.
@@ -294,13 +290,26 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
                                       unsigned dstx, unsigned dsty,
                                       unsigned width, unsigned height);
 
+/* The following functions are customized variants of the clear functions.
+ * Some drivers use them internally to do things like MSAA resolve
+ * and resource decompression. It usually consists of rendering a full-screen
+ * quad with a special blend or DSA state.
+ */
+
+/* Used by r300g for depth decompression. */
+void util_blitter_custom_clear_depth(struct blitter_context *blitter,
+                                     unsigned width, unsigned height,
+                                     double depth, void *custom_dsa);
+
+/* Used by r600g for depth decompression. */
 void util_blitter_custom_depth_stencil(struct blitter_context *blitter,
                                       struct pipe_surface *zsurf,
                                       struct pipe_surface *cbsurf,
                                       unsigned sample_mask,
                                       void *dsa_stage, float depth);
 
-void util_blitter_resolve_color_custom(struct blitter_context *blitter,
+/* Used by r600g for MSAA color resolve. */
+void util_blitter_custom_resolve_color(struct blitter_context *blitter,
                                        struct pipe_resource *dst,
                                        unsigned dst_level,
                                        unsigned dst_layer,
index 1053706ad57f6e371b8b5bf3db99100aab887b18..f2c67c0a11374042cad620457d532a00311cbfd6 100644 (file)
@@ -398,7 +398,7 @@ void r300_decompress_zmask(struct r300_context *r300)
     r300_mark_atom_dirty(r300, &r300->hyperz_state);
 
     r300_blitter_begin(r300, R300_DECOMPRESS);
-    util_blitter_clear_depth_custom(r300->blitter, fb->width, fb->height, 0,
+    util_blitter_custom_clear_depth(r300->blitter, fb->width, fb->height, 0,
                                     r300->dsa_decompress_zmask);
     r300_blitter_end(r300);
 
index f3a3b8f89bfdf641e73c1d654a17ae293906442c..0ddc7126d49a51d03f6bb0d700878d790d974642 100644 (file)
@@ -320,7 +320,7 @@ static void r600_color_resolve(struct pipe_context *ctx,
 
        if (is_simple_resolve(info)) {
                r600_blitter_begin(ctx, R600_COLOR_RESOLVE);
-               util_blitter_resolve_color_custom(rctx->blitter,
+               util_blitter_custom_resolve_color(rctx->blitter,
                                                  info->dst.res, info->dst.level, info->dst.layer,
                                                  info->src.res, info->src.layer,
                                                  rctx->custom_blend_resolve);
@@ -345,7 +345,7 @@ static void r600_color_resolve(struct pipe_context *ctx,
 
        /* XXX use scissor, so that only the needed part of the resource is resolved */
        r600_blitter_begin(ctx, R600_COLOR_RESOLVE);
-       util_blitter_resolve_color_custom(rctx->blitter,
+       util_blitter_custom_resolve_color(rctx->blitter,
                                          tmp, 0, 0,
                                          info->src.res, info->src.layer,
                                          rctx->custom_blend_resolve);