-
-
Notifications
You must be signed in to change notification settings - Fork 190
Surface module compiling in SDL3 #3435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Starbuck5
wants to merge
6
commits into
pygame-community:main
Choose a base branch
from
Starbuck5:surface-sdl3-comp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
2025f7e
to
a756521
Compare
a756521
to
c44f364
Compare
ankith26
reviewed
Jun 11, 2025
We'll figure out SDL3 relevance later, right now it's just important to get Surface compiling.
c44f364
to
741db24
Compare
ankith26
reviewed
Jun 21, 2025
Update surface.c
ankith26
approved these changes
Jun 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR 🎉
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.
This PR consists of 4 commits, and it gets the surface module to compile with SDL3. It still fails lots of tests when run in SDL3 mode, but there is lots of SDL-function porting to be done with int->bool stuff.
Commit 1 focuses on Surface.c
This commit does not change the SDL2 codepath at all, except for a cliprect thing similar to what I've done in other PRs.
The RLEaccel stuff is confusing, even digging through the SDL2 source it's hard to understand. Our code uses
surf->flags & SDL_RLEACCEL
to check, interchangeably withSDL_SurfaceHasRLE(surf)
, but if you check the source SDL_SurfaceHasRLE does not check the same flags. However, in testing it seems to be equivalent, somehow.I also just declined to port a whole section that covers a blitting edge case, we'll get to it later, for now I think it will be valuable to have people able to compile at all.
EDIT: also added a commit 5 for surface.c.
Commit 2 and 3 focus on filling and blitting respectively
There are a lot of lines changed but it's just passing formats around, nothing complex
Commit 4 makes intrinsics compile properly
I took Ankith's prior work on this and moved it up to _surface.h, as well as making sure it defines SSE2 and AVX2 itself if necessary. On my (Windows) system it doesn't compile at least the SSE2 stuff without this, so in SDL2 we must be getting that define from SDL itself.