i965: Implement color clears using a simple shader in blorp. 19/6319/1
authorEric Anholt <eric@anholt.net>
Tue, 19 Mar 2013 19:40:10 +0000 (12:40 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 30 Apr 2013 18:59:23 +0000 (11:59 -0700)
commite56095dc2e40d6d1e37e123c694a609d16932b4a
tree00223e227895e5643b5a5e480964e90cafae9b8e
parente34c857639380303a43146a50cdd724774f59a2f
i965: Implement color clears using a simple shader in blorp.

The upside is less CPU overhead in fiddling with GL error handling, the
ability to use the constant color write message in most cases, and no GLSL
clear shaders appearing in MESA_GLSL=dump output.  The downside is more
batch flushing and a total recompute of GL state at the end of blorp.
However, if we're ever going to use the fast color clear feature of CMS
surfaces, we'll need this anyway since it requires very special state
setup.

This increases the fail rate of some the GLES3conform ARB_sync tests,
because of the initial flush at the start of blorp.  The tests already
intermittently failed (because it's just a bad testing procedure), and we
can return it to its previous fail rate by fixing the initial flush.

Improves GLB2.7 performance 0.37% +/- 0.11% (n=71/70, outlier removed).

v2: Rename the key member, use the core helper for sRGB, and use
    BRW_MASK_* enums, fix comment and indentation (review by Paul).
v3: Rewrite a comment, drop a silly temporary variable (review by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_blorp.cpp
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp [new file with mode: 0644]
src/mesa/drivers/dri/i965/brw_clear.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen6_blorp.cpp
src/mesa/drivers/dri/i965/gen7_blorp.cpp