Began work on WGPU video backend

Currently only supports Wayland, and it's quite..... bad

This is a DRAFT! Just a small proof-of-concept.

I'll submit a draft PR to the SDL project to see if I should continue
development.

If this is greenlit, I might making consider a WGPU SDL_GPU backend if
wgpu-native is in a good enough state (maybe Dawn if it isn't?)

No promises though! Don't get angry at me if I don't!

Current known issues:
1: Error handling is sparse.
2: It only supports the shared library version of wgpu-native, and it
does that by just loading it whenever it needs to do something
3: wgpu-native is bad and doesn't implement wgpuGetProcAddress so we're
just using SDL_LoadFunction instead. I'd much prefer using the native
wgpuGetProcAddress but alas....
This commit is contained in:
The Stickmahn 2026-05-30 10:25:18 +02:00
parent 687a59f277
commit 7e733d0934
15 changed files with 6999 additions and 99 deletions

View file

@ -1290,3 +1290,4 @@ _SDL_LoadJPG
_SDL_HasSVE2
_SDL_GamepadHasCapSense
_SDL_GetGamepadCapSense
_SDL_WGPU_CreateSurface

View file

@ -1291,6 +1291,7 @@ SDL3_0.0.0 {
SDL_HasSVE2;
SDL_GamepadHasCapSense;
SDL_GetGamepadCapSense;
SDL_WGPU_CreateSurface;
# extra symbols go here (don't modify this line)
local: *;
};

View file

@ -1317,3 +1317,4 @@
#define SDL_HasSVE2 SDL_HasSVE2_REAL
#define SDL_GamepadHasCapSense SDL_GamepadHasCapSense_REAL
#define SDL_GetGamepadCapSense SDL_GetGamepadCapSense_REAL
#define SDL_WGPU_CreateSurface SDL_WGPU_CreateSurface_REAL

View file

@ -1325,3 +1325,4 @@ SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadJPG,(const char *a),(a),return)
SDL_DYNAPI_PROC(bool,SDL_HasSVE2,(void),(),return)
SDL_DYNAPI_PROC(bool,SDL_GamepadHasCapSense,(SDL_Gamepad *a,SDL_GamepadCapSenseType b),(a,b),return)
SDL_DYNAPI_PROC(bool,SDL_GetGamepadCapSense,(SDL_Gamepad *a,SDL_GamepadCapSenseType b),(a,b),return)
SDL_DYNAPI_PROC(WGPUSurface,SDL_WGPU_CreateSurface,(SDL_Window *a,WGPUInstance b),(a,b),return)