[Mesa-dev] [PATCH] gallium/util: Fix util_blitter_clear_render_target() for num_layers>1

Marek Olšák maraeo at gmail.com
Wed Nov 25 03:04:07 PST 2015


On Tue, Nov 24, 2015 at 1:03 PM, Edward O'Callaghan
<eocallaghan at alterapraxis.com> wrote:
> Previously util_blitter_clear_render_target() could not clear more
> than the first layer. We need to generalise this so that
> ARB_clear_texture can pass the 3d piglit test.
>
> Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
> ---
>  src/gallium/auxiliary/util/u_blitter.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
> index fccc92c..37daefe 100644
> --- a/src/gallium/auxiliary/util/u_blitter.c
> +++ b/src/gallium/auxiliary/util/u_blitter.c
> @@ -1852,10 +1852,19 @@ void util_blitter_clear_render_target(struct blitter_context *blitter,
>     pipe->set_framebuffer_state(pipe, &fb_state);
>     pipe->set_sample_mask(pipe, ~0);
>
> -   blitter_set_common_draw_rect_state(ctx, FALSE, FALSE);
>     blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
> -   blitter->draw_rectangle(blitter, dstx, dsty, dstx+width, dsty+height, 0,
> -                           UTIL_BLITTER_ATTRIB_COLOR, color);
> +
> +   unsigned num_layers = util_framebuffer_get_num_layers(&fb_state);

num_layers can be obtained more easily:
dstsurf->u.tex.last_layer - dstsurf->u.tex.first_layer + 1

Also, I guess clear_depth_stencil needs the same treatment.

Marek


More information about the mesa-dev mailing list