r600g: implement fast color clears for MSAA on evergreen+
authorGrigori Goronzy <greg@chown.ath.cx>
Tue, 11 Jun 2013 22:04:01 +0000 (00:04 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 1 Jul 2013 01:02:43 +0000 (03:02 +0200)
commit30004b20c2ae5ee78619f441b01afef0d4d992f0
treea0c2f26db57707a29fe287c470f61433cb59b09a
parentb1693194eee7e99ef8abb6c8319834bd93879400
r600g: implement fast color clears for MSAA on evergreen+

Allows MSAA colorbuffers, which have a CMASK automatically and don't
need any further special handling, to be fast cleared. Instead
of clearing the buffer, set the clear color and the CMASK to the
cleared state.

Fast clear is used only when all bound colorbuffers fulfill certain
conditions: a CMASK is required, we have to be able to create a clear
color value for the format and the texture mustn't contain multiple
images. Technically, it should be possible to support array textures
and cubemaps if all images are attached to the framebuffer,
but this does not appear to be common.

v2: fix fast clear check
v3: Marek: - disable fast clear with 128-bit formats, which are unsupported
           - set tex->dirty_level_mask in r600_clear, so that the driver knows
             the resource must be decompressed/expanded
           - return early from r600_clear if there's nothing else to do

Signed-off-by: Marek Olšák <maraeo@gmail.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_blit.c
src/gallium/drivers/r600/r600_resource.h