-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Reduce errors in src_c/surface.c when compiling with SDL3 #3215
base: main
Are you sure you want to change the base?
Conversation
src_c/_pygame.h
Outdated
#define PG_GetSurfacePalette SDL_GetSurfacePalette | ||
#define PG_SurfaceMapRGBA(surf, r, g, b, a) \ | ||
SDL_MapSurfaceRGBA(surf, r, g, b, a) | ||
#define PG_GetSurfaceClipRect(surf, rect) SDL_GetSurfaceClipRect(surf, rect) |
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.
I think this approach is fine for now, but eventually we may have to look into how this can be improved. For now we have no idea how cheap or how expensive these functions are, and they are called in tight loops in performance critical sections.
Many of those places probably need to be refactored to call this method once outside any tight loops and then use that result wherever possible.
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.
Definitely something to remember in the future ports, but in the src_c/surface.c
it seems like only surf_get_bounding_rect
falls in this category.
Hello. Looking through this I see some parts that won't work for us. |
Oh right...
You're right, but currently seems like it's only for |
Not a full port.
Things left to do:
Logic for palettes.RLEACCEL
alphablit
surface_fill
simd_blitters_avx2
simd_blitters_sse2
simd_surface_fill_avx2
simd_surface_fill_sse2
Unchecked points will be done in a different PR / different PRs.