util: Tiny optimisation for the linear→srgb conversion

When converting 0.0 it would be nice if it didn't do any arithmetic.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Neil Roberts
2015-11-26 17:53:42 +01:00
parent 27a88a947c
commit bc2470d5d3

View File

@@ -57,7 +57,7 @@ util_format_linear_to_srgb_helper_table[104];
static inline float static inline float
util_format_linear_to_srgb_float(float cl) util_format_linear_to_srgb_float(float cl)
{ {
if (cl < 0.0f) if (cl <= 0.0f)
return 0.0f; return 0.0f;
else if (cl < 0.0031308f) else if (cl < 0.0031308f)
return 12.92f * cl; return 12.92f * cl;