WIP: [common] port to SDL3 #2645

Draft
octocar wants to merge 16 commits from octocar/eden:sdl3 into master
First-time contributor
No description provided.
octocar changed title from [common] port to SDL3 to WIP: [common] port to SDL3 2025-10-01 21:56:38 +02:00
octocar force-pushed sdl3 from dce3d96aaa
Some checks failed
eden-license / license-header (pull_request) Failing after 24s
to 726fe8cf09
Some checks failed
eden-license / license-header (pull_request) Failing after 30s
2025-10-01 22:04:10 +02:00
Compare
CMakeLists.txt Outdated
@ -635,16 +635,16 @@ if (ENABLE_SDL2)
if ("${YUZU_SYSTEM_PROFILE}" STREQUAL "steamdeck")
Owner

this is now unneeded

this is now unneeded
octocar marked this conversation as resolved
CMakeLists.txt Outdated
@ -645,3 +645,3 @@
endif()
find_package(SDL2 2.26.4 REQUIRED)
find_package(SDL3 3.2.22 REQUIRED)
Owner

DO NOT always require the newest, we should use 3.2.12 which is the earliest found in any current distro except Ubuntu (which lacks sdl3 entirely)

DO NOT always require the newest, we should use 3.2.12 which is the earliest found in any current distro except Ubuntu (which lacks sdl3 entirely)
octocar marked this conversation as resolved
cpmfile.json Outdated
@ -184,0 +180,4 @@
"repo": "libsdl-org/SDL3",
"version": "3.2.22",
"min_version": "3.2.0",
"cmake_filename": "sdl3"
Owner

This is a special CI repo and should be left as it previously was, I will create an SDL3 CI

This is a special CI repo and should be left as it previously was, I will create an SDL3 CI
octocar marked this conversation as resolved
docs/Deps.md Outdated
@ -33,3 +33,3 @@
* [FFmpeg](https://ffmpeg.org/) (should use `-DYUZU_USE_EXTERNAL_FFMPEG=ON`)
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+ (should use `-DYUZU_USE_EXTERNAL_SDL2=ON` OR `-DYUZU_USE_BUNDLED_SDL2=ON` to reduce compile time)
* [SDL3](https://github.com/libsdl-org/SDL/releases) 2.0.18+ (should use `-DYUZU_USE_EXTERNAL_SDL3=ON` OR `-DYUZU_USE_BUNDLED_SDL3=ON` to reduce compile time)
Owner

change to 3.2.12+

change to 3.2.12+
octocar marked this conversation as resolved
docs/Deps.md Outdated
@ -203,3 +203,3 @@
* Open the `MSYS2 MinGW 64-bit` shell (`mingw64.exe`)
* Download and install all dependencies using:
* `pacman -Syu git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
* `pacman -Syu git make mingw-w64-x86_64-SDL3 mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-qt6 mingw-w64-x86_64-toolchain autoconf libtool automake-wrapper`
Owner

sdl is now lower case here

sdl is now lower case here
octocar marked this conversation as resolved
@ -251,3 +250,4 @@
if (ENABLE_SDL3)
target_sources(audio_core PRIVATE
sink/sdl2_sink.cpp
sink/sdl2_sink.h
Owner

Update filenames to sdl3

Update filenames to sdl3
octocar marked this conversation as resolved
@ -8,3 +9,3 @@
#include <vector>
#include <SDL.h>
#include <SDL3/SDL.h>
Owner

This shouldn't be necessary

This shouldn't be necessary
octocar marked this conversation as resolved
@ -9,3 +9,3 @@
#include "common/settings.h"
#include "common/thread.h"
#include "common/vector_math.h"
// #include "common/vector_math.h" // Not used directly
Owner

If it's not used you can remove it, no need for comment

If it's not used you can remove it, no need for comment
octocar marked this conversation as resolved
crueter left a comment
Owner

Also, we should update docs to mention that Ubuntu needs to use bundled or external sdl3

Also, we should update docs to mention that Ubuntu needs to use bundled or external sdl3
@ -0,0 +8,4 @@
#include <span>
#include <vector>
#include <SDL3/SDL.h>
Owner

Linking to SDL3::SDL3 should set the include directories to include the /path/to/include/SDL3 so SDL.h should still work.

Linking to SDL3::SDL3 *should* set the include directories to include the `/path/to/include/SDL3` so SDL.h should still work.
Author
First-time contributor

SDL.h does not seem to work for me on external dependency

SDL.h does not seem to work for me on external dependency
crueter marked this conversation as resolved
MaranBr force-pushed sdl3 from af6c90e3ff
Some checks failed
eden-license / license-header (pull_request) Failing after 58m45s
to 4c5aaf7f13
Some checks failed
eden-license / license-header (pull_request) Failing after 1m9s
2025-10-02 01:36:30 +02:00
Compare
octocar changed title from WIP: [common] port to SDL3 to [common] port to SDL3 2025-10-02 13:08:35 +02:00
Author
First-time contributor

tested:

  • gyro
  • audio
  • cli
  • gamepad
  • keyboard
  • mouse
  • multiple gamepads
tested: - [x] gyro - [x] audio - [x] cli - [x] gamepad - [x] keyboard - [x] mouse - [ ] multiple gamepads
Author
First-time contributor

cpmfile.json may need changes

cpmfile.json may need changes
Member

Build CI failed, check #2645

Build CI failed, check [#2645](https://github.com/Eden-CI/Workflow/actions/runs/18188827228)
Owner

@DraVee wrote in #2645 (comment):

Build CI failed, check #2645

yeah we just need a bundled sdl3

@DraVee wrote in https://git.eden-emu.dev/eden-emu/eden/pulls/2645#issuecomment-5666: > Build CI failed, check [#2645](https://github.com/Eden-CI/Workflow/actions/runs/18188827228) yeah we just need a bundled sdl3
crueter changed title from [common] port to SDL3 to WIP: [common] port to SDL3 2025-10-08 00:09:02 +02:00
crueter force-pushed sdl3 from 02bd53f0e6
All checks were successful
eden-license / license-header (pull_request) Successful in 24s
to 6c0f4a3472
All checks were successful
eden-license / license-header (pull_request) Successful in 24s
2025-10-08 00:19:21 +02:00
Compare
Owner

Confirmed that SDL3 works with Gyro + Gamepad and Keyboard + Mouse on system, external, and bundled SDL3 on Linux. Need windows testing

Confirmed that SDL3 works with Gyro + Gamepad and Keyboard + Mouse on system, external, and bundled SDL3 on Linux. Need windows testing
Owner
https://cdn.discordapp.com/attachments/1425279065430167644/1425282292317946017/20251008-0041-07.0469107.mp4?ex=68e70512&is=68e5b392&hm=d6b0709c2db8a5f2878bec4553d344fcdf088a776d35859ad40f71c15086fbba& On Windows, gyro is only working vertically
MaranBr force-pushed sdl3 from 558922b369
All checks were successful
eden-license / license-header (pull_request) Successful in 29s
to 87f38902f3
All checks were successful
eden-license / license-header (pull_request) Successful in 26s
2025-10-14 03:19:50 +02:00
Compare
Owner

idea: only use sdl3 on Linux/macOS

idea: only use sdl3 on Linux/macOS
@ -65,3 +60,3 @@
}
bool UpdateMotion(SDL_ControllerSensorEvent event) {
bool UpdateMotion(SDL_GamepadSensorEvent event) {
Author
First-time contributor

We could try fixing the windows issue by changing the axis remapping here?

We could try fixing the windows issue by changing the axis remapping here?
Owner

Go for it. I don't know anything about SDL except SDL1 so I've got nothing

Go for it. I don't know anything about SDL except SDL1 so I've got nothing
Author
First-time contributor

I don't own a Win machine

I don't own a Win machine
MaranBr force-pushed sdl3 from 87f38902f3
All checks were successful
eden-license / license-header (pull_request) Successful in 26s
to 0a29a81b80
Some checks failed
eden-license / license-header (pull_request) Successful in 32s
build.yml / [cmake] sdl3 ci, fixup cpmfile defs, fix sdl headers (pull_request) Failing after 0s
trigger_release.yml / [cmake] sdl3 ci, fixup cpmfile defs, fix sdl headers (pull_request) Failing after 0s
2025-10-16 21:53:00 +02:00
Compare
Some checks failed
eden-license / license-header (pull_request) Successful in 32s
Required
Details
build.yml / [cmake] sdl3 ci, fixup cpmfile defs, fix sdl headers (pull_request) Failing after 0s
trigger_release.yml / [cmake] sdl3 ci, fixup cpmfile defs, fix sdl headers (pull_request) Failing after 0s
This pull request has changes conflicting with the target branch.
  • CMakeLists.txt
  • CMakeModules/CopyYuzuSDLDeps.cmake
  • CMakeModules/MinGWClangCross.cmake
  • CMakeModules/MinGWCross.cmake
  • docs/Deps.md
  • externals/CMakeLists.txt
  • externals/cpmfile.json
  • externals/gamemode/gamemode_client.h
  • src/android/app/build.gradle.kts
  • src/frontend_common/config.cpp
  • src/input_common/CMakeLists.txt
  • src/input_common/main.cpp
  • src/yuzu/main.cpp
  • src/yuzu_cmd/CMakeLists.txt
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u sdl3:octocar-sdl3
git switch octocar-sdl3
Sign in to join this conversation.
No description provided.