Commit Graph

320 Commits

Author SHA1 Message Date
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
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
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
Chris Genova
6a01d6e7d3 D3D12 GPU: Prevent reading out of bounds when uploading textures.
When the upload needs realignment, a new buffer is created to do the
upload, and the source data is copied to the new buffer. This commit
fixes the issue where the memcopy can read off the end of the source
buffer since it is reading based on destination pitch instead of source
pitch.
2025-11-07 17:47:51 -08:00
Sam Lantinga
4db63e323e Save a copy of the D3D12 semantic string
Fixes https://github.com/libsdl-org/SDL/issues/14383
2025-11-02 16:16:20 -08:00
Katelyn Gadd
9479ac039c If VULKAN_Submit fails during VULKAN_INTERNAL_CreateTexture, destroy the texture and return NULL 2025-10-20 16:24:20 -07:00