From 39d516f6ded77317a1920cd7ba11804bf1bf4cd4 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Sat, 27 Jun 2020 09:52:52 -0700 Subject: [PATCH] simplified FTOC for aarch64 this isn't actually a good solution, really RageVColor shouldn't be doing this conversion at all and should be refactored/removed. this gets gameplay running a bit smoother, much closer to holding 60fps --- src/RageTypes.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/RageTypes.h b/src/RageTypes.h index c66f635d86..6a2ea018cc 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -264,6 +264,13 @@ public: * * should output the same value (+-1) 256 times. If this function is * incorrect, the first and/or last values may be biased. */ +#ifdef CPU_AARCH64 +inline unsigned char FTOC(float a) +{ + const float v = a < 0.0f ? 0.0f : (a > 1.0f ? 1.0f : a); + return static_cast(v * 255.0f); +} +#else inline unsigned char FTOC(float a) { //This value is 2^52 * 1.5. @@ -292,6 +299,7 @@ inline unsigned char FTOC(float a) return static_cast(ret); } +#endif /* Color type used only in vertex lists. OpenGL expects colors in * r, g, b, a order, independent of endianness, so storing them this