pygame-ce icon indicating copy to clipboard operation
pygame-ce copied to clipboard

Reduce errors in src_c/surface.c when compiling with SDL3

Open gresm opened this issue 1 year ago • 2 comments
trafficstars

Not a full port.

Things left to do:

  • [x] ~Logic for palettes.~
  • [x] ~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.

gresm avatar Nov 06 '24 19:11 gresm

Hello.

Looking through this I see some parts that won't work for us. SDL_GetPixelFormatDetails and SDL_GetSurfaceClipRect need to be error checked, for one thing. Also when mapping to or from the same surface over and over again getting the format every time is going to be a large hit to performance, which doesn't come up a bunch in surface.c but does apply at least to surf_get_bounding_rect.

Starbuck5 avatar Nov 09 '24 08:11 Starbuck5

SDL_GetPixelFormatDetails and SDL_GetSurfaceClipRect need to be error checked, for one thing.

Oh right... SDL_GetSurfaceClipRect errors only when invalid surface is passes, so I assumed that it would be checked, but in many cases it doesn't seem like it. And for SDL_GetPixelFormatDetails, didn't notice that.

which doesn't come up a bunch in surface.c but does apply at least to surf_get_bounding_rect.

You're right, but currently seems like it's only for surf_get_bounding_rect.

gresm avatar Nov 12 '24 19:11 gresm

Hi Gresm, thanks for your effort in working this up in the first place, but these changes have been supplanted by other incremental Surface SDL3 PRs, so I will close this out.

Starbuck5 avatar Jul 27 '25 19:07 Starbuck5