[Mesa-dev] [PATCH 3/9] gallium/u_blitter: remove useless parameters from some functions
Marek Olšák
maraeo at gmail.com
Thu Dec 12 10:00:09 PST 2013
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/auxiliary/util/u_blitter.c | 24 ++++++++++--------------
src/gallium/auxiliary/util/u_blitter.h | 11 +++--------
src/gallium/drivers/i915/i915_resource_texture.c | 3 +--
src/gallium/drivers/i915/i915_surface.c | 5 ++---
src/gallium/drivers/ilo/ilo_blitter_pipe.c | 8 ++------
src/gallium/drivers/r300/r300_blit.c | 3 +--
src/gallium/drivers/r600/r600_blit.c | 6 ++----
src/gallium/drivers/radeonsi/r600_blit.c | 5 ++---
8 files changed, 23 insertions(+), 42 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 710a728..64f9828 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -1200,11 +1200,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,
@@ -1222,8 +1221,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;
@@ -1248,8 +1246,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);
@@ -1262,14 +1259,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;
@@ -1451,10 +1448,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);
@@ -1528,7 +1524,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);
diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h
index 24c1111..a30cdc3 100644
--- a/src/gallium/auxiliary/util/u_blitter.h
+++ b/src/gallium/auxiliary/util/u_blitter.h
@@ -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);
diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c
index 3d61794..109b3f5 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -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;
diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c
index bd20a53..a4c1f39 100644
--- a/src/gallium/drivers/i915/i915_surface.c
+++ b/src/gallium/drivers/i915/i915_surface.c
@@ -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
diff --git a/src/gallium/drivers/ilo/ilo_blitter_pipe.c b/src/gallium/drivers/ilo/ilo_blitter_pipe.c
index fa4f158..1637a30 100644
--- a/src/gallium/drivers/ilo/ilo_blitter_pipe.c
+++ b/src/gallium/drivers/ilo/ilo_blitter_pipe.c
@@ -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);
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index a0b4573..696a61d 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -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);
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index b80360c..3fb4d3b 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/r600_blit.c b/src/gallium/drivers/radeonsi/r600_blit.c
index 3adbb81..7491c27 100644
--- a/src/gallium/drivers/radeonsi/r600_blit.c
+++ b/src/gallium/drivers/radeonsi/r600_blit.c
@@ -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])
--
1.8.3.2
More information about the mesa-dev
mailing list