raylib/src
K. Adam Christensen 5d9aed5d40
[rlgl] Optimize rlReadScreenPixels (#4667)
This optimization works in the following ways:

1. Reduces calls to malloc to 1. Instead of needing an extra array, we
can just swap the top half with the bottom half of the one array.

2. Unroll the inner for loop and remove a condition. Unrolling loops
buys some performance wins, but the real goal was to remove the if check
and just set the alpha channel to 255.

On my hidpi arm64 laptop, I saw ~60% improvement in performance in my
debug build (29 FPS vs 47 FPS). When optimized, the gains were roughly
10% (75 FPS vs 83%).

Signed-off-by: K. Adam Christensen <pope@shifteleven.com>
2025-01-08 18:53:27 +01:00
..
external Update RGFW (#4637) 2024-12-25 21:19:51 +01:00
platforms Fix Touch pointCount reduction (#4661) 2025-01-06 11:29:24 +01:00
CMakeLists.txt install rcamera.h (#4603) 2024-12-15 11:16:08 +01:00
config.h Update year to 2025 2025-01-01 00:02:52 +01:00
Makefile Update year to 2025 2025-01-01 00:02:52 +01:00
minshell.html [web] Fix undesired scrollbars on shell files (#4104) 2024-06-25 22:15:29 +02:00
raudio.c Update year to 2025 2025-01-01 00:02:52 +01:00
raylib.dll.rc Update year to 2025 2025-01-01 00:02:52 +01:00
raylib.dll.rc.data Update year to 2025 2025-01-01 00:02:52 +01:00
raylib.h Update year to 2025 2025-01-01 00:02:52 +01:00
raylib.ico Update raylib.ico 2024-11-14 16:40:04 +01:00
raylib.rc Update year to 2025 2025-01-01 00:02:52 +01:00
raylib.rc.data Update year to 2025 2025-01-01 00:02:52 +01:00
raymath.h Update year to 2025 2025-01-01 00:02:52 +01:00
rcamera.h Update year to 2025 2025-01-01 00:02:52 +01:00
rcore.c Update year to 2025 2025-01-01 00:02:52 +01:00
rgestures.h Update year to 2025 2025-01-01 00:02:52 +01:00
rglfw.c Update year to 2025 2025-01-01 00:02:52 +01:00
rlgl.h [rlgl] Optimize rlReadScreenPixels (#4667) 2025-01-08 18:53:27 +01:00
rmodels.c Update year to 2025 2025-01-01 00:02:52 +01:00
rshapes.c Update year to 2025 2025-01-01 00:02:52 +01:00
rtext.c Update year to 2025 2025-01-01 00:02:52 +01:00
rtextures.c Update year to 2025 2025-01-01 00:02:52 +01:00
shell.html [web] Fix undesired scrollbars on shell files (#4104) 2024-06-25 22:15:29 +02:00
utils.c Update year to 2025 2025-01-01 00:02:52 +01:00
utils.h Update year to 2025 2025-01-01 00:02:52 +01:00