intel: Request DRI2 buffers for separate stencil and hiz
authorChad Versace <chad@chad-versace.us>
Fri, 3 Jun 2011 23:33:32 +0000 (16:33 -0700)
committerChad Versace <chad@chad-versace.us>
Wed, 8 Jun 2011 17:06:40 +0000 (10:06 -0700)
commitaea2236af60aee329e6ea73a41f2410d8eacc7b6
treedfc69b045e2b36479c0032c42e0a6a0c400d9bde
parentf4efb7ff4f9cb0f6386e9b53f4dcfd9ef23dc9d1
intel: Request DRI2 buffers for separate stencil and hiz

When it is sensible to do so,
    1) intelCreateBuffer() now attaches separate depth and stencil
       buffers
       to the framebuffer it creates.
    2) intel_update_renderbuffers() requests for the framebuffer
       a separate stencil buffer (DRI2BufferStencil).

The criteria for "sensible" is:
    - The GLX config has nonzero depth and stencil bits.
    - The hardware supports separate stencil.
    - The X driver supports separate stencil, or its support has not yet
      been determined.

If the hardware supports hiz too, then intel_update_renderbuffers()
also requests DRI2BufferHiz.

If after requesting DRI2BufferStencil we determine that X driver did not
actually support separate stencil, we clean up the mistake and never ask
for DRI2BufferStencil again.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_screen.h