gallium/u_blitter: remove useless parameters from some functions
authorMarek Olšák <marek.olsak@amd.com>
Fri, 6 Dec 2013 21:39:48 +0000 (22:39 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 14 Dec 2013 16:42:08 +0000 (17:42 +0100)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_blitter.h
src/gallium/drivers/i915/i915_resource_texture.c
src/gallium/drivers/i915/i915_surface.c
src/gallium/drivers/ilo/ilo_blitter_pipe.c
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r600/r600_blit.c
src/gallium/drivers/radeonsi/r600_blit.c

index 23f1f3afa6ce4681fbd086e57a812c7e33429cdf..88025034cc0fcb525400a771a962114e514ef95e 100644 (file)
@@ -1202,11 +1202,10 @@ static boolean is_blit_generic_supported(struct blitter_context *blitter,
 
 boolean util_blitter_is_copy_supported(struct blitter_context *blitter,
                                        const struct pipe_resource *dst,
-                                       const struct pipe_resource *src,
-                                       unsigned mask)
+                                       const struct pipe_resource *src)
 {
    return is_blit_generic_supported(blitter, dst, dst->format,
-                                    src, src->format, mask);
+                                    src, src->format, PIPE_MASK_RGBAZS);
 }
 
 boolean util_blitter_is_blit_supported(struct blitter_context *blitter,
@@ -1224,8 +1223,7 @@ void util_blitter_copy_texture(struct blitter_context *blitter,
                                unsigned dstx, unsigned dsty, unsigned dstz,
                                struct pipe_resource *src,
                                unsigned src_level,
-                               const struct pipe_box *srcbox, unsigned mask,
-                               boolean copy_all_samples)
+                               const struct pipe_box *srcbox)
 {
    struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
    struct pipe_context *pipe = ctx->base.pipe;
@@ -1250,8 +1248,7 @@ void util_blitter_copy_texture(struct blitter_context *blitter,
    /* Copy. */
    util_blitter_blit_generic(blitter, dst_view, &dstbox,
                              src_view, srcbox, src->width0, src->height0,
-                             mask, PIPE_TEX_FILTER_NEAREST, NULL,
-                             copy_all_samples);
+                             PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL);
 
    pipe_surface_reference(&dst_view, NULL);
    pipe_sampler_view_reference(&src_view, NULL);
@@ -1264,14 +1261,14 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
                                const struct pipe_box *srcbox,
                                unsigned src_width0, unsigned src_height0,
                                unsigned mask, unsigned filter,
-                               const struct pipe_scissor_state *scissor,
-                               boolean copy_all_samples)
+                               const struct pipe_scissor_state *scissor)
 {
    struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
    struct pipe_context *pipe = ctx->base.pipe;
    struct pipe_framebuffer_state fb_state;
    enum pipe_texture_target src_target = src->texture->target;
    unsigned src_samples = src->texture->nr_samples;
+   unsigned dst_samples = dst->texture->nr_samples;
    boolean has_depth, has_stencil, has_color;
    boolean blit_stencil, blit_depth, blit_color;
    void *sampler_state;
@@ -1453,10 +1450,9 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
          pipe->set_framebuffer_state(pipe, &fb_state);
 
          /* See if we need to blit a multisample or singlesample buffer. */
-         if (copy_all_samples &&
-             src_samples == dst->texture->nr_samples &&
-             dst->texture->nr_samples > 1) {
-            unsigned i, max_sample = MAX2(dst->texture->nr_samples, 1) - 1;
+         if (src_samples == dst_samples && dst_samples > 1) {
+            /* MSAA copy. */
+            unsigned i, max_sample = dst_samples - 1;
 
             for (i = 0; i <= max_sample; i++) {
                pipe->set_sample_mask(pipe, 1 << i);
@@ -1530,7 +1526,7 @@ util_blitter_blit(struct blitter_context *blitter,
    util_blitter_blit_generic(blitter, dst_view, &info->dst.box,
                              src_view, &info->src.box, src->width0, src->height0,
                              info->mask, info->filter,
-                             info->scissor_enable ? &info->scissor : NULL, TRUE);
+                             info->scissor_enable ? &info->scissor : NULL);
 
    pipe_surface_reference(&dst_view, NULL);
    pipe_sampler_view_reference(&src_view, NULL);
index 24c11115573a071b0bfd8e0ca023c43ba3db77a8..a30cdc36a8107a359463dbf2bb43e4ba18d517d1 100644 (file)
@@ -191,13 +191,10 @@ void util_blitter_clear(struct blitter_context *blitter,
 /**
  * Check if the blitter (with the help of the driver) can blit between
  * the two resources.
- * The mask is a combination of the PIPE_MASK_* flags.
- * Set to PIPE_MASK_RGBAZS if unsure.
  */
 boolean util_blitter_is_copy_supported(struct blitter_context *blitter,
                                        const struct pipe_resource *dst,
-                                       const struct pipe_resource *src,
-                                       unsigned mask);
+                                       const struct pipe_resource *src);
 
 boolean util_blitter_is_blit_supported(struct blitter_context *blitter,
                                       const struct pipe_blit_info *info);
@@ -221,8 +218,7 @@ void util_blitter_copy_texture(struct blitter_context *blitter,
                                unsigned dstx, unsigned dsty, unsigned dstz,
                                struct pipe_resource *src,
                                unsigned src_level,
-                               const struct pipe_box *srcbox, unsigned mask,
-                               boolean copy_all_samples);
+                               const struct pipe_box *srcbox);
 
 /**
  * This is a generic implementation of pipe->blit, which accepts
@@ -250,8 +246,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
                                const struct pipe_box *srcbox,
                                unsigned src_width0, unsigned src_height0,
                                unsigned mask, unsigned filter,
-                               const struct pipe_scissor_state *scissor,
-                               boolean copy_all_samples);
+                               const struct pipe_scissor_state *scissor);
 
 void util_blitter_blit(struct blitter_context *blitter,
                       const struct pipe_blit_info *info);
index 3d6179495d28aac1adc9b8ad4e73cdeb7ecb2c12..109b3f59bc2fa7bd50a0584da17e473ff89cddee 100644 (file)
@@ -742,8 +742,7 @@ i915_texture_transfer_map(struct pipe_context *pipe,
    /* if we use staging transfers, only support textures we can render to,
     * because we need that for u_blitter */
    if (i915->blitter &&
-       util_blitter_is_copy_supported(i915->blitter, resource, resource,
-                                     PIPE_MASK_RGBAZS) &&
+       util_blitter_is_copy_supported(i915->blitter, resource, resource) &&
        (usage & PIPE_TRANSFER_WRITE) &&
        !(usage & (PIPE_TRANSFER_READ | PIPE_TRANSFER_DONTBLOCK | PIPE_TRANSFER_UNSYNCHRONIZED)))
       use_staging_texture = TRUE;
index bd20a5330aaa86a7309e0ef5dcda85bb554ed991..a4c1f39dd389f74c54db5be6a279d6bb631057d4 100644 (file)
@@ -84,8 +84,7 @@ i915_surface_copy_render(struct pipe_context *pipe,
       return;
    }
 
-   if (!util_blitter_is_copy_supported(i915->blitter, dst, src,
-                                       PIPE_MASK_RGBAZS)) {
+   if (!util_blitter_is_copy_supported(i915->blitter, dst, src)) {
       util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
                                 src, src_level, src_box);
       return;
@@ -94,7 +93,7 @@ i915_surface_copy_render(struct pipe_context *pipe,
    i915_util_blitter_save_states(i915);
 
    util_blitter_copy_texture(i915->blitter, dst, dst_level, dstx, dsty, dstz,
-                            src, src_level, src_box, PIPE_MASK_RGBAZS, TRUE);
+                            src, src_level, src_box);
 }
 
 static void
index fa4f1582b7f710491390fa92bb6adec300624aee..1637a30a219728cbb8cb68bad3b015ecd67237ee 100644 (file)
@@ -153,22 +153,18 @@ ilo_blitter_pipe_copy_resource(struct ilo_blitter *blitter,
                                struct pipe_resource *src, unsigned src_level,
                                const struct pipe_box *src_box)
 {
-   const unsigned mask = PIPE_MASK_RGBAZS;
-   const bool copy_all_samples = true;
-
    /* not until we allow rendertargets to be buffers */
    if (dst->target == PIPE_BUFFER || src->target == PIPE_BUFFER)
       return false;
 
-   if (!util_blitter_is_copy_supported(blitter->pipe_blitter, dst, src, mask))
+   if (!util_blitter_is_copy_supported(blitter->pipe_blitter, dst, src))
       return false;
 
    ilo_blitter_pipe_begin(blitter, ILO_BLITTER_PIPE_COPY, false);
 
    util_blitter_copy_texture(blitter->pipe_blitter,
          dst, dst_level, dst_x, dst_y, dst_z,
-         src, src_level, src_box,
-         mask, copy_all_samples);
+         src, src_level, src_box);
 
    ilo_blitter_pipe_end(blitter);
 
index a0b4573d0bd3a50727ba6badae803c97e12044ab..696a61dc5f57fc6f5b9d57ce8943b86118e69561 100644 (file)
@@ -667,8 +667,7 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
     r300_blitter_begin(r300, R300_COPY);
     util_blitter_blit_generic(r300->blitter, dst_view, &dstbox,
                               src_view, src_box, src_width0, src_height0,
-                              PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL,
-                              FALSE);
+                              PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL);
     r300_blitter_end(r300);
 
     pipe_surface_reference(&dst_view, NULL);
index b80360cd86b66137c25102219692eb4057dc4a94..3fb4d3b99515969c43008a64f2ccae1e938bcb6b 100644 (file)
@@ -755,8 +755,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
                sbox.height = util_format_get_nblocksy(src->format, src_box->height);
                sbox.depth = src_box->depth;
                src_box = &sbox;
-       } else if (!util_blitter_is_copy_supported(rctx->blitter, dst, src,
-                                                  PIPE_MASK_RGBAZS)) {
+       } else if (!util_blitter_is_copy_supported(rctx->blitter, dst, src)) {
                if (util_format_is_subsampled_2x1_32bpp(src->format)) {
 
                        src_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
@@ -821,8 +820,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
        r600_blitter_begin(ctx, R600_COPY_TEXTURE);
        util_blitter_blit_generic(rctx->blitter, dst_view, &dstbox,
                                  src_view, src_box, src_width0, src_height0,
-                                 PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL,
-                                 TRUE);
+                                 PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL);
        r600_blitter_end(ctx);
 
        pipe_surface_reference(&dst_view, NULL);
index 3adbb81c03a955b020e5aa651121ca7e5a545bc2..7491c27534f7ca63820176b266a7c9365ac94b9c 100644 (file)
@@ -528,8 +528,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
                /* translate the dst box as well */
                dstx = util_format_get_nblocksx(orig_info[1].format, dstx);
                dsty = util_format_get_nblocksy(orig_info[1].format, dsty);
-       } else if (!util_blitter_is_copy_supported(rctx->blitter, dst, src,
-                                                  PIPE_MASK_RGBAZS)) {
+       } else if (!util_blitter_is_copy_supported(rctx->blitter, dst, src)) {
                unsigned blocksize = util_format_get_blocksize(src->format);
 
                switch (blocksize) {
@@ -574,7 +573,7 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
 
        r600_blitter_begin(ctx, R600_COPY);
        util_blitter_copy_texture(rctx->blitter, dst, dst_level, dstx, dsty, dstz,
-                                 src, src_level, psbox, PIPE_MASK_RGBAZS, TRUE);
+                                 src, src_level, psbox);
        r600_blitter_end(ctx);
 
        if (restore_orig[0])