1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +00:00

LibGfx: gamma_to_linear4 is not a valid constexpr on clang 10 and below

This is a hack which can be removed once GitHub Actions changes the
default version to clang 11.

This is apparently sometime in mid-December.

Note, clang-11 is not currently available on Ubuntu 20.04. However,
GitHub Actions uses 20.04, which probably means clang-11 will
become available around that time for all 20.04 users.
This commit is contained in:
Luke 2020-11-27 21:53:29 +00:00 committed by Andreas Kling
parent 72abf3491b
commit d7455018eb

View file

@ -59,7 +59,13 @@ typedef float v4sf __attribute__((vector_size(16)));
// Transform v4sf from gamma2.2 space to linear space
// Assumes x is in range [0, 1]
// FIXME: Remove this hack once clang-11 is available as the default in Github Actions.
// This is apparently sometime mid-December. https://github.com/actions/virtual-environments/issues/2130
# if !defined(__clang__) || __clang_major__ >= 11
constexpr v4sf gamma_to_linear4(v4sf x)
# else
inline v4sf gamma_to_linear4(v4sf x)
# endif
{
return (0.8f + 0.2f * x) * x * x;
}