From 51c219739ccb3672a0beaa0a51b37933f4ecaebd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 15 Jun 2017 01:23:22 +0200 Subject: [PATCH] radeonsi: unify CB_RESOLVE blitter invocation code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_blit.c | 35 +++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 74f46705b3c..d137a1fbec3 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -1151,6 +1151,21 @@ void si_resource_copy_region(struct pipe_context *ctx, pipe_sampler_view_reference(&src_view, NULL); } +static void si_do_CB_resolve(struct si_context *sctx, + const struct pipe_blit_info *info, + struct pipe_resource *dst, + unsigned dst_level, unsigned dst_z, + enum pipe_format format) +{ + si_blitter_begin(&sctx->b.b, SI_COLOR_RESOLVE | + (info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND)); + util_blitter_custom_resolve_color(sctx->blitter, dst, dst_level, dst_z, + info->src.resource, info->src.box.z, + ~0, sctx->custom_blend_resolve, + format); + si_blitter_end(&sctx->b.b); +} + static bool do_hardware_msaa_resolve(struct pipe_context *ctx, const struct pipe_blit_info *info) { @@ -1161,7 +1176,6 @@ static bool do_hardware_msaa_resolve(struct pipe_context *ctx, unsigned dst_width = u_minify(info->dst.resource->width0, info->dst.level); unsigned dst_height = u_minify(info->dst.resource->height0, info->dst.level); enum pipe_format format = info->src.format; - unsigned sample_mask = ~0; struct pipe_resource *tmp, templ; struct pipe_blit_info blit; @@ -1228,15 +1242,8 @@ static bool do_hardware_msaa_resolve(struct pipe_context *ctx, } /* Resolve directly from src to dst. */ - si_blitter_begin(ctx, SI_COLOR_RESOLVE | - (info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND)); - util_blitter_custom_resolve_color(sctx->blitter, - info->dst.resource, info->dst.level, - info->dst.box.z, - info->src.resource, info->src.box.z, - sample_mask, sctx->custom_blend_resolve, - format); - si_blitter_end(ctx); + si_do_CB_resolve(sctx, info, info->dst.resource, + info->dst.level, info->dst.box.z, format); return true; } @@ -1270,13 +1277,7 @@ resolve_to_temp: assert(src->surface.micro_tile_mode == rtmp->surface.micro_tile_mode); /* resolve */ - si_blitter_begin(ctx, SI_COLOR_RESOLVE | - (info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND)); - util_blitter_custom_resolve_color(sctx->blitter, tmp, 0, 0, - info->src.resource, info->src.box.z, - sample_mask, sctx->custom_blend_resolve, - format); - si_blitter_end(ctx); + si_do_CB_resolve(sctx, info, tmp, 0, 0, format); /* blit */ blit = *info; -- 2.30.2