i965: For fast color clears, only check the color of live channels.
authorKevin Rogovin <kevin.rogovin@intel.com>
Tue, 25 Mar 2014 06:37:16 +0000 (08:37 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 25 Mar 2014 22:34:28 +0000 (15:34 -0700)
When deciding if a clear color is suitable for fast clear,
take into account if a color channel is active in the
buffer format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp

index fd18b45202ffe7bb1bb7ffc139fee6a896150634..d16da97c3c0d363b2e443816f00ddfb2a087f634 100644 (file)
@@ -153,7 +153,8 @@ is_color_fast_clear_compatible(struct brw_context *brw,
       return false;
 
    for (int i = 0; i < 4; i++) {
-      if (color->f[i] != 0.0 && color->f[i] != 1.0) {
+      if (color->f[i] != 0.0 && color->f[i] != 1.0 &&
+          _mesa_format_has_color_component(format, i)) {
          perf_debug("Clear color unsupported by fast color clear.  "
                     "Falling back to slow clear.\n");
          return false;