[Mesa-dev] [PATCH] util: Tiny optimisation for the linear→srgb conversion

Jason Ekstrand jason at jlekstrand.net
Thu Nov 26 12:33:49 PST 2015


Sure. R-B
On Nov 26, 2015 8:58 AM, "Neil Roberts" <neil at linux.intel.com> wrote:

> When converting 0.0 it would be nice if it didn't do any arithmetic.
> ---
>  src/util/format_srgb.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/util/format_srgb.h b/src/util/format_srgb.h
> index 4a8d73f..34b50af 100644
> --- a/src/util/format_srgb.h
> +++ b/src/util/format_srgb.h
> @@ -57,7 +57,7 @@ util_format_linear_to_srgb_helper_table[104];
>  static inline float
>  util_format_linear_to_srgb_float(float cl)
>  {
> -   if (cl < 0.0f)
> +   if (cl <= 0.0f)
>        return 0.0f;
>     else if (cl < 0.0031308f)
>        return 12.92f * cl;
> --
> 1.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151126/aab98652/attachment-0001.html>


More information about the mesa-dev mailing list