Avoid RLE for software render alpha subrect copies#15982
Merged
Conversation
slouken
reviewed
Jul 13, 2026
slouken
reviewed
Jul 17, 2026
Collaborator
|
Merged, thanks! I'm leaving this in 3.6 for now, in case there are performance regressions with other use cases. |
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.
Description
Add a software-renderer copy preparation step that disables surface RLE when all of these are true:
Whole texture alpha copies can still use RLE.
Existing Issue(s)
This resolves #15958
Benchmark
I compared unmodified SDL against this branch with a small benchmark. The benchmark creates an alpha texture atlas in memory, uses the software renderer, and renders 768 transparent 16x16 subrect copies per frame for 1000 frames.
Unmodified SDL:
frames=1000
copies_per_frame=768
seconds=1.805
fps=553.91
With my fix:
frames=1000
copies_per_frame=768
seconds=0.406
fps=2464.84