From 6b919b1b2d296f7d7410c2291b7e0332d7bef1a0 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 21 Nov 2013 15:41:36 +0100 Subject: gallium/util: implement layered framebuffer clear in u_blitter All bound layers (from first_layer to last_layer) should be cleared. This uses a vertex shader which outputs gl_Layer = gl_InstanceID, so each instance goes to a different layer. By rendering a quad and setting the instance count to the number of layers, it will trivially clear all layers. This requires AMD_vertex_shader_layer (or PIPE_CAP_TGSI_VS_LAYER), which only radeonsi supports at the moment. r600 could do this too. Standard DX11 hardware will have to use a geometry shader though, which has higher overhead. --- src/gallium/drivers/r300/r300_blit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/gallium/drivers/r300/r300_blit.c') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 4ec68ae6e1c..42410fe7dae 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -365,9 +365,7 @@ static void r300_clear(struct pipe_context* pipe, if (buffers) { /* Clear using the blitter. */ r300_blitter_begin(r300, R300_CLEAR); - util_blitter_clear(r300->blitter, - width, - height, + util_blitter_clear(r300->blitter, width, height, 1, buffers, color, depth, stencil); r300_blitter_end(r300); } else if (r300->zmask_clear.dirty || -- cgit v1.2.3