Commit Graph

13119 Commits

Author SHA1 Message Date
Sanjay Govind
94f17d6c61 Add support for whammy and tilt on PS4/5 guitars
PS4/5 controllers put device specific data into a specific region in the report, so we have to extract it separately.

No known guitars use the right stick on the guitar, so to keep things working similarly to PS3, i have opted to map whammy and tilt the same way as the PS3 rb guitars.
2026-03-08 11:35:57 -07:00
Petar Popovic
67ac0e5eee SDL_InternalGlobDirectory(): set string length of base directory to 1, if it's just one slash 2026-03-07 12:43:56 -05:00
Petar Popovic
93e3e8a5fe SDL_InternalGlobDirectory(): keep track of pathlen and reuse it, instead of calling SDL_strlen(path) 2026-03-07 12:43:56 -05:00
Petar Popovic
961a04fa26 SDL_GlobDirectory(): Don't chop off first slash from path, if it's just multiple slashes 2026-03-07 12:43:56 -05:00
Ethan Lee
ee5c5cf755 render: Add Suspend/Resume calls for GDK support 2026-03-07 11:19:09 -05:00
Ethan Lee
0c57e99b4a gpu: Fix swapchain texture cycling.
This is actually a 1:1 copy of a patch we wrote for GPU PS5 some time ago!
2026-03-07 10:36:19 -05:00
Frank Praznik
89393c5519 wayland: Use the built-in names of interfaces to enable protocols 2026-03-06 13:29:32 -05:00
Frank Praznik
7605f192d5 wayland: Remove Wayland interface definitions
These are relics from very long ago, before the Wayland protocols lived in-tree and the headers and sources were generated at configure time.
2026-03-06 13:29:32 -05:00
Ethan Lee
c20a058ff4 Revert "render: Added Xbox DXIL for gpu backend".
Turns out Xbox is okay with the PC DXIL, it just isn't as optimal without the root signature annotations.

This reverts commit f2c4c66429.
2026-03-04 15:52:07 -05:00
ImpDi
89cab56536 Texture2DArray and Compute Pipeline in DirectX12 (#15161)
Apparently, because PlaneSlice wasn't initialized, we couldn't use SDL_GPU_TEXTURETYPE_2D_ARRAY and SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE together, as the error d3d12:
"ID3D12Device::CreateUnorderedAccessView occurred: The PlaneSlice -858993460 is invalid when the resource format is R8G8B8A8_UNORM and the view format is R8G8B8A8_UNORM. Only Plane Slice 0 is valid when creating a view on a non-planar format. [ STATE_CREATION ERROR #344: CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE]"
2026-03-03 19:19:45 -08:00
Frank Praznik
e7199cad0b Deprecate SDL_INIT_EVERYTHING from SDL2
Adds SDL_INIT_EVERYTHING to the deprecated symbol list, and renames an internal usage to avoid a warning.
2026-03-03 14:00:40 -05:00
Frank Praznik
5880b8a283 Log failure reasons during early X11 and Wayland initialization
Log the reason for failure during initialization to the debug log to aid in troubleshooting.
2026-03-03 13:29:57 -05:00
Frank Praznik
8c8efd4ccd wayland: Don't add keys with the super/GUI modifier to the keymap
SDL normalizes the super/GUI modifier away, so adding a key with this modifier will overwrite the base, unmodified value.
2026-03-02 18:29:23 -05:00
Void Star Caster
2e3300e872 Functions to bind GPURenderState storage textures, buffers and sampler bindings (#15150) 2026-03-02 12:50:58 -08:00
Qiu Qiang
e2a2e2c31e camera: Fix crash when setting frame rate and improve FPS precision
- Use exact numerator/denominator from spec for CMTime to avoid rounding errors.
- Wrap frame rate setting in @try-catch to prevent crashes on strict drivers.
2026-03-02 11:59:17 -08:00
MSRPP-dev
4dbf5811e9 Update SDL_render_sw.c
Fix the bug in the standard scaling path, SDL_RENDERCMD_COPY should follow the same pattern as SW_RenderCopyEx.
2026-03-02 09:49:46 -08:00
Sanjay Govind
34378609bb fix off by one with tilt on ps3 guitars (#15144) 2026-03-02 09:45:44 -08:00
Sam Lantinga
73b13728de Added surface validation to SDL_DuplicateSurface() 2026-03-02 09:40:53 -08:00
Ethan Lee
f2c4c66429 render: Added Xbox DXIL for gpu backend 2026-03-01 19:09:55 -05:00
Petar Popovic
77f4a8e2b8 Fix potential memory leak in VULKAN_AcquireCommandBuffer() on error 2026-03-01 14:10:54 -08:00
Petar Popovic
fb1d1ab306 Fix memory leak when X11 toolkit window locale SDL_strdup() fails 2026-03-01 11:44:43 -08:00
Sam Lantinga
72d5fe213f Loading PNG files are part of the core SDL library
Don't disable this functionality when defining SDL_LEAN_AND_MEAN, but if you need to, you can define SDL_DISABLE_STB if you want to compile this out.

Fixes https://github.com/libsdl-org/SDL/issues/15139
2026-03-01 11:42:28 -08:00
Petar Popovic
6cf03ca729 Fix potential memory leak in SDL_HIDAPI_HapticOpenFromJoystick() on error 2026-03-01 11:35:58 -08:00
Sam Lantinga
2d9fca46c6 Added surface validation to SDL_ConvertSurfaceRect()
Fixes https://github.com/libsdl-org/SDL/issues/15141
2026-03-01 11:34:34 -08:00
Frank Praznik
0a45525242 wayland: Handle min/max sizes in fixed-size windows with viewports
Wayland is sometimes at-odds with clients that want to enforce an aspect ratio or min/max window size, as certain window states have dimensions that either must be obeyed (maximized), or will give terrible results if they aren't (tiled). Use a viewport and a masking subsurface to handle cases where surfaces are unable to match the exact window size.

The changes made to accommodate this also catches some additional windowing related edge-cases, simplifies synchronization, and prevents commits before a buffer has been attached to the surface.
2026-02-28 12:55:17 -05:00
Brenton Bostick
3ac4e684ab make sure #endif comment matches the macro name 2026-02-28 08:43:42 -08:00
Sam Lantinga
0a1c7b5348 Fixed SDL_GetIOSize() return value
Fixes https://github.com/libsdl-org/SDL/issues/15129
2026-02-28 08:41:47 -08:00
Sam Lantinga
f600c74c80 Don't enable extended features for GameSir controllers over Bluetooth 2026-02-26 09:18:07 -08:00
Sam Lantinga
170e3a81d8 Fixed the GameSir-G7 Pro 8K button mapping 2026-02-26 09:18:07 -08:00
Sam Lantinga
7775bbef9f Fixed the GameSir-G7 Pro 8K accelerometer scale 2026-02-26 09:18:07 -08:00
Sam Lantinga
862e1e8600 Fixed the GameSir-G7 Pro 8K sensor rate
The reports are delivered at 250 Hz both wired and via the wireless dongle.
2026-02-26 09:18:07 -08:00
zuiki_inn
29ca920fdf Add ZUIKI EVOTOP controller support with gyroscope and accelerometer sensor capabilities. (#15034) 2026-02-25 20:24:29 -08:00
rabbit-ecl
230814e85e Use Uint64 instead for tick_numerators in USE_128BIT_MATH 2026-02-25 20:18:51 -08:00
Sam Lantinga
24404d9047 Fixed timer overflow on some platforms
We have an implementation that uses 128-bit math and one that handles large values without it (thanks @jessechounard and @rabbit-ecl!)

Fixes https://github.com/libsdl-org/SDL/issues/15042
2026-02-25 11:41:31 -08:00
Ethan Lee
a4cd62ef93 render: Reduce scope of D3D12 GDK event watcher to Xbox 2026-02-25 09:23:20 -05:00
Ethan Lee
5770e013c2 gdk: Render/GPU can call SuspendX, document when to call SuspendComplete 2026-02-25 09:20:25 -05:00
Sam Lantinga
49a8b4229b Added battery status for newer FlyDigi controllers 2026-02-24 20:49:45 -08:00
Sanjay Govind
0c859452ef Support accelerometers on 3rd party ps3 controllers (#15109) 2026-02-24 18:58:13 -08:00
Sanjay Govind
a7ccd48957 Set joystick_type for known ps3/wii instruments (#15111) 2026-02-24 17:26:46 -08:00
Sanjay Govind
1419bcb6cb deal with controllers that don't have report ids 2026-02-24 15:18:53 -08:00
Frank Praznik
2f38b6a396 x11: Also send key releases when reconciling state 2026-02-24 17:12:00 -05:00
Sanjay Govind
0e4008441f Fix up controller types for various playstation and wii instruments (#15104) 2026-02-24 13:35:45 -08:00
Sam Lantinga
2385dc6297 Added support for the Flydigi Vader 5 Pro in Xbox 360 mode 2026-02-24 10:18:17 -08:00
Brenton Bostick
c259f969f2 fix unknown argument nBufSize 2026-02-24 09:50:17 -08:00
Brenton Bostick
0d0db08b61 fix JNI parameter types 2026-02-24 09:49:42 -08:00
Brenton Bostick
a5889b0e44 make sure #endif comment matches the macro name 2026-02-24 09:48:57 -08:00
Void Star Caster
4a4ae4a79d Fix GetSampler() bug for INDEX8 pixel format (#15099) 2026-02-24 08:05:30 -08:00
Vicki Pfau
ab6dd970ac camera: Don't try to fake entire range for FRMIVAL_TYPE_CONTINUOUS
V4L2 is able to advertise that a video device is able to display any frame
interval within a continuous range. SDL does not allow advertising this and
only exposes discrete frame intervals. To work around this, SDL attempted to
generate a subset of the range with a fixed interval. Unfortunately, the way
this was accomplish is inherently broken and led to attempting to allocate a
very large number of formats per resolution and colorspace. With the Magewell
Pro Capture HDMI, which can expose FRMSIZE_TYPE_CONTINUOUS as well, this can
expose a truly astronomical number of formats, exceeding 1 PB of RAM. This will
lead to an OOM kill for any process that tries to initialize the camera
subsystem.

This patch just tests to see if some common frame rates are within the
contiuous range and expose those. SDL still does not handle
FRMSIZE_TYPE_CONTINUOUS in a graceful way so it still uses over a gigabyte of
RAM for each possible combination of sizes, but with this patch it no longer
leads to an OOM kill. The API will need amending for proper support for both
continuous frame sizes and frame intervals.
2026-02-24 06:54:31 -08:00
Vicki Pfau
8a1684fbbc Support SL/SR on Switch 2 controllers, but only in mini-controller mode
It doesn't really make sense to support these in combined mode since they're usually occluded.
2026-02-24 06:52:32 -08:00
Frank Praznik
550394eecd x11: Don't send duplicate key down events when reconciling
Modifier keys shouldn't be repeated.
2026-02-23 15:09:34 -05:00