mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +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:
parent
72abf3491b
commit
d7455018eb
1 changed files with 6 additions and 0 deletions
|
@ -59,7 +59,13 @@ typedef float v4sf __attribute__((vector_size(16)));
|
||||||
|
|
||||||
// Transform v4sf from gamma2.2 space to linear space
|
// Transform v4sf from gamma2.2 space to linear space
|
||||||
// Assumes x is in range [0, 1]
|
// 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)
|
constexpr v4sf gamma_to_linear4(v4sf x)
|
||||||
|
# else
|
||||||
|
inline v4sf gamma_to_linear4(v4sf x)
|
||||||
|
# endif
|
||||||
{
|
{
|
||||||
return (0.8f + 0.2f * x) * x * x;
|
return (0.8f + 0.2f * x) * x * x;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue