Commit Graph

330 Commits

Author SHA1 Message Date
RaceTheMaSe
f1a7a64eb4 Fix warnings: Extra semi - macro usage (#15015) 2026-02-08 16:58:53 -08:00
RaceTheMaSe
7c7ffb9115 tests: Fix unreachable code warnings (#14993) 2026-02-07 20:42:59 +03:00
RaceTheMaSe
9fda8f2669 Fix -Wnewline-eof warnings (#14989) 2026-02-07 18:04:18 +03:00
Sam Lantinga
c9116daa71 Fixed build 2026-02-06 10:32:19 -08:00
Sam Lantinga
8e783e0892 Fixed building with Visual Studio 2019 2026-02-06 10:15:39 -08:00
Sam Lantinga
1a99861510 Fixed warnings building on Android 2026-02-04 14:55:29 -08:00
Ozkan Sezer
59e3ad0079 SDL_gpu_d3d12.c: Silence -Wuninitialized warning from old gcc versions:
SDL_gpu_d3d12.c: In function 'D3D12_GetXRSwapchainFormats':
SDL_gpu_d3d12.c:9107:26: warning: 'sdlFormat' may be used uninitialized in this function
2026-02-04 07:47:02 +03:00
Ozkan Sezer
427941012e SDL_gpu_vulkan.c: Silence -Wuninitialized warning from old gcc versions:
SDL_gpu_vulkan.c: In function 'VULKAN_GetXRSwapchainFormats':
SDL_gpu_vulkan.c:12927: warning: 'sdlFormat' may be used uninitialized in this function
2026-02-04 07:39:20 +03:00
Evan Hemsley
e25e0f3c5b GPU: Allow D3D12 backend to load vendored D3D12Core.dll (#14946)
---------

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
2026-02-02 11:10:03 -08:00
Aaron Benjamin
1f7db1ebcf Improve OpenXR loader error messages
When the OpenXR loader library fails to load, provide a detailed error
message explaining:
- On Windows: need openxr_loader.dll in app directory or PATH
- On Linux: install libopenxr-loader package or set LD_LIBRARY_PATH
- Can use SDL_HINT_OPENXR_LIBRARY hint to specify path

Also update D3D12 backend to include the error in its warning log,
and remove redundant SDL_SetError in Vulkan backend that was
overwriting the detailed message.
2026-02-02 10:31:59 -05:00
Ethan Lee
e8065ad9a0 gpu: Update the CHECK_DEVICE_MAGIC comments one more time.
Me fail English? That's unpossible!
2026-02-01 14:02:58 -05:00
Ethan Lee
415cc64d2f gpu: Update comments above CHECK_DEVICE_MAGIC macro 2026-02-01 13:54:27 -05:00
Lucas Murray
a0dc3a6727 GPU: Fix memory leak when creating D3D12 compute pipelines 2026-01-31 16:23:04 -05:00
Caleb Cornett
742a6fd092 GPU: Query UnrestrictedBufferTextureCopyPitchSupported to avoid D3D12 realignment copies 2026-01-31 16:22:32 -05:00
Ethan Lee
fe8b68db60 gpu: Rank dzn above lavapipe, for WSL Vulkan support 2026-01-31 08:34:47 -05:00
Aaron Benjamin
9a91d7236a GPU: OpenXR integration (#14837)
Based on Beyley's initial draft in #11601.

Co-authored-by: Beyley Cardellio <ep1cm1n10n123@gmail.com>
Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
2026-01-30 17:18:51 -05:00
Eddy Jansson
23fec649c2 Fix typos in comments. 2026-01-30 07:25:02 -08:00
Ethan Lee
db9676875e gpu: MSVC buildfix for Vulkan device property struct initialization 2026-01-30 09:40:24 -05:00
Ethan Lee
ad70aac0db gpu: Check for Vulkan conformance while checking the device rank.
This should behave largely the same, except now Dozen is given a pass for WSL.

This is a better fix for #14915.
2026-01-30 09:20:26 -05:00
Sam Lantinga
696c12826f Reference count window claim calls for a given GPU device
Fixes https://github.com/libsdl-org/SDL/issues/14918
2026-01-29 14:05:00 -08:00
Ethan Lee
a4fa04f2d4 gpu: Vulkan should fail if the best device is non-conformant 2026-01-29 14:41:34 -05:00
Sam Lantinga
17c375738f Add the type to SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1 2026-01-25 09:12:15 -08:00
Ethan Lee
16f2037efd gpu: Add SDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1 property 2026-01-25 09:09:08 -08:00
Madeline Whitmore
97b177c92f SDL GPU: Fix features not being enabled with Vulkan 1.1 (#14885)
Use pre-Vulkan 1.2 structs to request features from a Vulkan 1.1 instance.
2026-01-25 08:18:57 -08:00
Eddy Jansson
83fb7b6636 Prefer SDL_zero()/SDL_zerop()
Replace uses of 'SDL_memset(E, 0, sizeof(E))' and similar
with the SDL_zero()/SDL_zerop() macros.
2026-01-23 11:23:27 -08:00
Cameron Cawley
cd72f6b02e Fix B4G4R4A4_UNORM swizzle with the Metal GPU driver 2026-01-18 12:48:24 -08:00
Cameron Cawley
25583798a0 Fix mapping between surface and GPU pixel formats 2026-01-18 12:48:24 -08:00
Lucas Murray
cced3ce8b9 GPU: Add error message to Vulkan buffer creation error path 2026-01-04 15:17:53 -08:00
Ethan Lee
f472f93db8 gpu: D3D12 uploads should also factor in block size for height, not just width.
It turns out the reason this function was having so many overread issues was because our row copies were wrong - for compressed images we also need to reduce the row count based on the block size, similar to what we already do for pitch calculation - these copies are byte copies, not pixel copies!
2026-01-02 07:37:30 -08:00
Sam Lantinga
5f086e7623 Updated copyright for 2026 2026-01-01 09:40:08 -08:00
Frank Praznik
cb4f33b644 gpu: Use the window event watcher list for Vulkan and D3D12
Events won't be delivered to the regular event watcher list callbacks if a client event filter discards events. Use the special window event watcher list to watch for resizes in the GPU renderers, as events are delivered to this list before a client can potentially discard them.
2025-12-30 22:18:19 -05:00
Edgar San Martin, Jr.
bd29d60d3c GPU: Add bounds validation for slot bindings and uniform data pushes. (#14692) 2025-12-23 08:36:06 -08:00
999pingGG
5a257202d2 GPU: Better detection of surface destruction 2025-12-21 17:16:34 -08:00
999pingGG
190b902fac GPU: Fix Android surface and swapchain recreation on app resume (#14676) 2025-12-19 09:54:08 -08:00
Nuno Silva
d94cd1efad GPU: Ensure Vulkan doesn't pass unsupported feature structures for requested vulkan version (#14662) 2025-12-15 17:57:49 -08:00
Evan Hemsley
1260c10aab GPU Vulkan: Only modify surface on window claim or release (#14659) 2025-12-15 12:54:16 -08:00
Jakub Wasilewski
73c9f25867 GPU: Metal: Rebind storage buffers when changing the pipeline moves them. 2025-12-15 11:45:29 -08:00
Arnoldo Adonaí Barón Robles
e5731f9bac GPU: Fix crash on Android upon returning from the background 2025-12-10 20:58:19 -05:00
LuncyBloont
ab67be7e5a Fix crash in UploadToTexture() on DX12. 2025-12-05 11:46:41 -08:00
Jakub Wasilewski
f5ea8805e1 Change how WinPixEventRuntime.dll is used under D3D12/Windows. (#14600)
* GPU: D3D12: Missing WinPixEventRuntime.dll now logs warning at device creation time.
* GPU: D3D12: Debug label functions are now a no-op when WinPixEventRuntime.dll is missing.
* Docs: GPU: Debug function documentation now notes WinPixEventRuntime.dll is required under D3D12.
2025-12-05 09:40:57 -08:00
cosmonaut
aae2f74ae6 GPU: Remove erroneous buffer usage flag from defrag process 2025-12-03 15:03:25 -08:00
Jakub Wasilewski
0c5ad99ec1 GPU: D3D12: Use WinPixEventRuntime.dll for debug events when available.
This prevents validation errors on D3D12 caused by the previous solution
that utilized internal D3D12 functions. This is still the fallback
solution if WinPixEventRuntime.dll is not present in PATH, but a warning
is printed to let you know how to fix these errors.
2025-12-03 12:00:17 -08:00
Evan Hemsley
2b1904a849 GPU: Prefer D3D12 over Vulkan when available 2025-12-01 17:50:23 -05:00
Antti Ala-Fossi
29f3844b01 Fix assert in SDL_BeginGPURenderPass 2025-11-25 10:46:53 -08:00
Sam Lantinga
1fc093491a vulkan gpu: set the sample count for depth prepass
Fixes https://github.com/libsdl-org/SDL/issues/14500
2025-11-22 07:53:16 -08:00
Ethan Lee
9dbde4542c gpu: Windows 11 guarantees a D3D12 minimum, skip checks accordingly 2025-11-12 16:22:35 -05:00
Ethan Lee
04a62cba1f gpu: Set up D3D12 device checks to avoid unnecessary queries 2025-11-12 11:19:07 -05:00
Ethan Lee
b2585ac236 gpu: Vulkan feature/extension lists do not need to be stored in the renderer 2025-11-11 21:24:45 -05:00
Ethan Lee
536507101d gpu: De-duplicate property enumeration for Vulkan features 2025-11-11 20:58:14 -05:00
TheSniperFan
ac0f77b7e6 Allow SDL GPU to opt into additional Vulkan features (#14204) 2025-11-11 15:53:06 -08:00