meta: fix meta clear of layered framebuffers
authorPaul Berry <stereotype441@gmail.com>
Tue, 19 Nov 2013 21:31:20 +0000 (13:31 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 22 Nov 2013 02:16:34 +0000 (18:16 -0800)
commit068a073c1d4853b5c8f33efdeb481026f42e23a5
treefc9e9592ff3401705c35cc98b1577f78b3c639b9
parent95140740ad1c6cd8a34002c307556f5c49a34589
meta: fix meta clear of layered framebuffers

From section 4.4.7 (Layered Framebuffers) of the GLSL 3.2 spec:

    When the Clear or ClearBuffer* commands are used to clear a
    layered framebuffer attachment, all layers of the attachment are
    cleared.

This patch fixes meta clears to properly clear all layers of a layered
framebuffer attachment.  We accomplish this by adding a geometry
shader to the meta clear program which sets gl_Layer to a uniform
value.  When clearing a layered framebuffer, we execute in a loop,
setting the uniform to point to each layer in turn.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/common/meta.c