Commit Graph

20812 Commits

Author SHA1 Message Date
TheSniperFan
ac0f77b7e6 Allow SDL GPU to opt into additional Vulkan features (#14204) 2025-11-11 15:53:06 -08:00
Anonymous Maarten
6905714986 android: remove dependency on cpu-features.h
android: remove dependency on cpu-features.h

getauxval got introduced into bionic well before Android 5.0
2025-11-11 23:41:43 +00:00
Ryan C. Gordon
25ab8c99df pen: Offer the current window during promixity events on most platforms.
Fixes #12356.
2025-11-11 16:34:22 -05:00
Anonymous Maarten
7073cfc58e release: don't use legacy Android CMake toolchain file 2025-11-11 21:46:26 +01:00
Sam Lantinga
5bed8ec603 Implemented render batching for D3D9 2025-11-11 08:31:37 -08:00
SDL Wiki Bot
a63e848509 Sync SDL3 wiki -> header
[ci skip]
2025-11-11 15:38:49 +00:00
Maia
5ec6147acb Add missing type suffix to SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION prop 2025-11-11 10:37:27 -05:00
Sam Lantinga
6b07e13fef Fixed spacing 2025-11-10 18:30:59 -08:00
Sam Lantinga
fffaf122df Added temporary workaround for failing Emscripten test 2025-11-10 18:30:02 -08:00
Sam Lantinga
dde7fa3b17 Validate the output colorspace before setting up a renderer 2025-11-10 18:30:02 -08:00
Sam Lantinga
6baaa0fe87 Destroy the window surface if a software renderer couldn't be created 2025-11-10 18:30:02 -08:00
Sam Lantinga
6a7fb838f4 Return false if we couldn't update the emscripten framebuffer 2025-11-10 18:30:02 -08:00
Sam Lantinga
eccd5c03c3 testautomation: added tests to cover linear <-> sRGB colorspace conversion 2025-11-10 18:30:02 -08:00
Sam Lantinga
33c70af2f8 Fixed SDL_COLORSPACE_SRGB_LINEAR being used for RGBA32 textures 2025-11-10 18:30:02 -08:00
Sam Lantinga
1c77304ee9 Fixed getting an 8-bit window surface on Apple platforms
The Metal renderer doesn't support XRGB texture formats, so we ended up matching SDL_PIXELFORMAT_INDEX8 for the window surface.
2025-11-10 18:30:02 -08:00
Sam Lantinga
ff890d1733 Fixed crash blitting to an 8-bit surface with no palette 2025-11-10 18:30:02 -08:00
Sam Lantinga
6389f4db4c SDL_FindColor() can be static 2025-11-10 18:30:02 -08:00
Sam Lantinga
ead02b08dd Skip tonemapping for render targets with unspecified HDR headroom 2025-11-10 18:30:02 -08:00
Sam Lantinga
4e5ba722fd Change the batch if the color scale changes
The color scale is a shader constant so it can be applied in linear space
2025-11-10 18:30:02 -08:00
Sam Lantinga
d29f368ca8 Change the batch if the GPU render state changes 2025-11-10 18:30:02 -08:00
Sam Lantinga
3399bc600e gpu renderer: add color to the point/line vertex data
This allows us to batch color changes in a single draw call
2025-11-10 18:30:02 -08:00
Sam Lantinga
97ebfbf7a0 Only convert color to linear once in VULKAN_QueueDrawPoints() 2025-11-10 18:30:02 -08:00
Sam Lantinga
d9be8b9a00 Implemented render batching for D3D11, D3D12, Metal, and Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/7534
2025-11-10 18:30:02 -08:00
SDL Wiki Bot
01a812cbca Sync SDL3 wiki -> header
[ci skip]
2025-11-11 01:21:27 +00:00
Ethan Lee
b5624e14ff gpu: Add SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION property 2025-11-10 20:20:05 -05:00
Ethan Lee
0b2073d143 gpu: Remove dead code in the Vulkan device ranking system.
This block was a sloppy way of trying to avoid prioritizing lavapipe over another device, but truthfully the only way to guarantee avoiding CPU drivers is to add a property to allow apps to require hardware acceleration.
2025-11-10 18:16:54 -05:00
Ethan Lee
1b79ba9ab6 gpu: Separate device suitability from device rank when enumerating Vulkan devices.
This makes it a bit clearer what the "minimum" is vs. the "best", which should be two separate queries.
2025-11-10 18:16:54 -05:00
Ethan Lee
6976b57988 gpu: Move device ranking to the bottom of IsDeviceSuitable.
This prevents devices without presentation/graphics support from getting ranked.
2025-11-10 18:16:54 -05:00
Ethan Lee
799c6aa629 gpu: Move device ranking to a standalone function.
This allows us to treat Dozen as an "other" driver, rather than blacklisting it outright.
2025-11-10 18:16:54 -05:00
Ethan Lee
0cc2b026e7 gpu: Check for MSFT_layered_driver, skip layered drivers during enumeration 2025-11-10 18:16:54 -05:00
Frank Praznik
f3d39815e7 progressbar: Ensure buffers are large enough for string manipulation 2025-11-09 16:59:35 -05:00
Frank Praznik
f6a05121ec wayland: Handle dispatch errors when showing a window
If a dispatch event when showing a window returns a failure code, handle the display disconnected condition and break out of the loop, otherwise, it will hang forever.
2025-11-09 12:38:05 -05:00
Frank Praznik
5d0236ad51 wayland: Don't leave un-acked configurations when throttling resize events
Compositors that send multiple resize events per frame could result in the most recent configuration requests being left un-acked when the resize ends. Ack the most recent resized state on frame callbacks, so as to always ack the most recent configuration within a reasonable timeframe.
2025-11-09 12:38:04 -05:00
Ryan C. Gordon
2382d3831c cmake: List enabled camera backends. 2025-11-09 12:05:05 -05:00
Sam Lantinga
a96664674f Fixed windows events on 32-bit Windows
When running on 32-bit Windows, DefWindowProc resolves to a function in ntdll.dll, but after the window is created the actual window proc is a function in user32.dll. We solve this by using our own custom default window proc and looking for that instead.

Fixes https://github.com/libsdl-org/SDL/issues/1442
2025-11-09 07:44:45 -08:00
Eddy Jansson
836dad75ae Remove redundant semicolons.
[ci skip]
2025-11-09 07:29:27 -08:00
Marcin Serwin
53ee410d7a Don't divide by zero in slow blitter
Other blitters seem to handle zero width/height destinations correctly.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-11-09 07:26:04 -08:00
Anonymous Maarten
2bc886d0bd testqsort: add custom macro to allow comparing with qsort 2025-11-09 11:24:03 +00:00
Anonymous Maarten
2be18f340f testqsort: use SDLTest_TestSuite 2025-11-09 11:24:03 +00:00
unknown
b9c790949e wasapi: Don't ignore device disconnect events on unopened devices.
Reference Issue #13317.
2025-11-09 01:15:45 -05:00
Ryan C. Gordon
2f41dd7b5c pen: Better pen position precision on Windows 8 and later.
Fixes #12084.
2025-11-09 00:46:45 -05:00
Sam Lantinga
704ac98d3f Make sure the blit mapping is cleared when undoing RLE encoding
This fixes a crash if a surface is RLE encoded, then locked and unlocked.

We also mark the surface as no longer needing to be locked after undoing RLE encoding
2025-11-08 15:38:47 -08:00
Sam Lantinga
089dc86bcf Lazily redo RLE encoding
Also stop lying about the RLE encoding state, which causes crashes if we do RLE blit operations while the surface is locked.
2025-11-08 14:51:27 -08:00
Sam Lantinga
cc2a272d6f Enable RLE more often in the software renderer
We don't need to aggressively disable RLE acceleration anymore because the original pixels remain available for operations that aren't supported by the RLE blitter.
2025-11-08 14:51:27 -08:00
Sam Lantinga
ac0edbe9d2 Just assert that RLE encoding isn't active
We undo RLE encoding in the calling code, so we shouldn't need to do anything here.
2025-11-08 14:51:27 -08:00
Sam Lantinga
2b365983db Save the original pixels when RLE encoding is enabled
Trying to reconstruct the original image when undoing RLE encoding was never completely accurate.

Fixes https://github.com/libsdl-org/SDL/issues/14424
2025-11-08 12:56:25 -08:00
Sam Lantinga
78152d13ee Added SDL_ConvertSurfaceRect() for internal use 2025-11-08 12:56:25 -08:00
Sam Lantinga
d145e78cd6 Improved performance scaling 8-bit surfaces 2025-11-08 12:56:25 -08:00
Sam Lantinga
01d359c1df Don't create a larger surface than we need when scaling 2025-11-08 12:56:25 -08:00
Sam Lantinga
7d628ef76c Fixed scaling YUV surfaces 2025-11-08 12:56:25 -08:00