mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
gallium/u_blitter: remove useless parameters from some functions
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
072c5d0573
commit
f0ed082bab
8 changed files with 23 additions and 42 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue