[Mesa-dev] [PATCH] Channels alive in fast clear

Kenneth Graunke kenneth at whitecape.org
Tue Mar 25 16:04:03 PDT 2014


On 03/24/2014 11:37 PM, Kevin Rogovin wrote:
> When deciding if a clear color is suitable for fast clear,
> take into account if a color channel is active in the
> buffer format.
> 
> ---
>  src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
> index fd18b45..d16da97 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
> @@ -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;
> 

Thank you for the patch.

I didn't find anything immediately helped by this off-hand (in order to
quote performance gains), but it's definitely a good idea.  There were
no Piglit regressions on Iris Pro.

I changed the commit title to:
"i965: For fast color clears, only check the color of live channels."
to match the usual style, and added my Reviewed-by.

I then pushed it to master.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140325/b58525cc/attachment.sig>


More information about the mesa-dev mailing list