summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2015-11-26 16:55:00 +1100
committerMarek Olšák <[email protected]>2015-12-02 18:23:43 +0100
commit8f2c5e281da6f750e76958a000e769023aa0a5a7 (patch)
tree141bf802832e3a7c5955be322fa280163bce70be /src/gallium/auxiliary/util
parent09f74e6ef45859a3b595e2932e2be3e7d7ab6ca0 (diff)
gallium/util: Fix util_blitter_clear_render_target() for num_layers>1
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 <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index fccc92c06c4..7f213fad737 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 = dstsurf->u.tex.last_layer - dstsurf->u.tex.first_layer + 1;
+ if (num_layers > 1 && ctx->has_layered) {
+ blitter_set_common_draw_rect_state(ctx, FALSE, TRUE);
+ blitter_set_clear_color(ctx, color);
+ blitter_draw(ctx, dstx, dsty, dstx+width, dsty+height, 0, num_layers);
+ }
+ else {
+ blitter_set_common_draw_rect_state(ctx, FALSE, FALSE);
+ blitter->draw_rectangle(blitter, dstx, dsty, dstx+width, dsty+height, 0,
+ UTIL_BLITTER_ATTRIB_COLOR, color);
+ }
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);