mesa: Track number of layers in layered framebuffers.
authorPaul Berry <stereotype441@gmail.com>
Tue, 19 Nov 2013 23:55:51 +0000 (15:55 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 22 Nov 2013 02:16:25 +0000 (18:16 -0800)
commit95140740ad1c6cd8a34002c307556f5c49a34589
tree5a81dc207bad0e94c2b30ac06d20cc4e085ec599
parent085ad4821e450349ec1ba8c82d4bd0e7dcfef0af
mesa: Track number of layers in layered framebuffers.

In order to properly clear layered framebuffers, we need to know how
many layers they have.  The easiest way to do this is to record it in
the gl_framebuffer struct when we check framebuffer completeness.

This patch replaces the gl_framebuffer::Layered boolean with a
gl_framebuffer::NumLayers integer, which is 0 if the framebuffer is
not layered, and equal to the number of layers otherwise.

v2: Remove gl_framebuffer::Layered and make gl_framebuffer::NumLayers
always have a defined value.  Fix factor of 6 error in the number of
layers in a cube map array.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen7_misc_state.c
src/mesa/main/fbobject.c
src/mesa/main/mtypes.h