Skip to content

Fastest 2D video mode #187

Answered by rofl0r
rofl0r asked this question in Q&A
Mar 8, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

alright, after reading the source code of the PSP implementation it becomes clear that the PSP implements only 2 videomodes "natively": SDL_PIXELFORMAT_ABGR8888 and SDL_PIXELFORMAT_BGR565. by natively i mean that these map directly to modes supported by the GU. using anything else basically requires SDL to recalculate every single pixel in the texture to one of those 2 formats.

i also found the function SDL_LockTextureToSurface which provides a temporary surface which let's me write directly to the texture's memory (which i assume is in VRAM).

using this function, the ABGR mode, and removing SDL_RenderClear() from the draw loop now give me 75 fps with nothing else changed.

the code now lo…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@rofl0r
Comment options

@sharkwouter
Comment options

@rofl0r
Comment options

Answer selected by rofl0r
@sharkwouter
Comment options

@rofl0r
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants