wiiu: Improve SDL_UpdateTexture performance + add max texture size#97
Merged
GaryOderNichts merged 2 commits intodevkitPro:wiiu-sdl2-2.28from May 25, 2025
Merged
Conversation
According to https://www.x.org/docs/AMD/old/R6xx_R7xx_3D.pdf in section 1.3 (page 6), GX2 supports textures of up to 8192x8192 resolution.
When possible, use the DMA to copy the whole texture data at once, this improves performance by nearly 15x in the best case. In all other cases, use OSBlockMove instead of the base memcpy implementation for a ~1.5x speedup in the slowest path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDL_UpdateTextureis often used in software rendered games for uploading the game's current framebuffer to the GPU for display. This PR greatly improves performance by using optimized memory copy routines from the OS and DMA transfer when possible.Speedup is anywhere between 1.5x and 15x faster than the original implementation.
This PR also adds the missing max texture size for games that might rely on it, based on AMD GPU documentation close to GX2 found here: https://www.x.org/docs/AMD/old/R6xx_R7xx_3D.pdf.