From bc2470d5d3e9788af8d6aee0a001b7de9cd4972b Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 26 Nov 2015 17:53:42 +0100 Subject: [PATCH] =?utf8?q?util:=20Tiny=20optimisation=20for=20the=20linear?= =?utf8?q?=E2=86=92srgb=20conversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When converting 0.0 it would be nice if it didn't do any arithmetic. Reviewed-by: Jason Ekstrand --- 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 4a8d73f125f..34b50afe3d1 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; -- 2.30.2