gallium/util: implement layered framebuffer clear in u_blitter

Graphics / Mesa 3D Graphics Library / Mesa - Marek Olšák [amd.com] - 3 December 2013 12:39 UTC

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.

6b919b1 gallium/util: implement layered framebuffer clear in u_blitter
src/gallium/auxiliary/util/u_blitter.c | 72 ++++++++++++++++---------
src/gallium/auxiliary/util/u_blitter.h | 2 +-
src/gallium/auxiliary/util/u_framebuffer.c | 24 +++++++++
src/gallium/auxiliary/util/u_framebuffer.h | 5 ++
src/gallium/auxiliary/util/u_simple_shaders.c | 26 +++++++++
src/gallium/auxiliary/util/u_simple_shaders.h | 2 +
src/gallium/drivers/ilo/ilo_blitter_pipe.c | 2 +-
src/gallium/drivers/r300/r300_blit.c | 4 +-
src/gallium/drivers/r600/r600_blit.c | 2 +-
src/gallium/drivers/radeonsi/r600_blit.c | 1 +
10 files changed, 110 insertions(+), 30 deletions(-)

Upstream: cgit.freedesktop.org


  • Share