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
Eddy Jansson
aaee09d6ed
Don't do NULL-checks before SDL_free()
...
Replaces the pattern
if (ptr) {
SDL_free(ptr);
}
with
SDL_free(ptr);
2025-10-20 00:13:09 -07:00
TheSniperFan
cbcb145eb4
Fix debug mode being set too late
...
-Early error messages were always being skipped
2025-10-18 08:04:11 -07:00
Ethan Lee
2135ecdfcc
gpu: Vulkan on private platforms cannot make use of oldSwapchain, destroy the full swapchain on resize
2025-10-16 15:18:07 -04:00
Evan Hemsley
20206b8e66
GPU: Correctly recycle D3D12 descriptor heaps ( #14234 )
2025-10-13 13:00:00 -07:00
cosmonaut
b067dfa345
GPU: Validate that buffer size is at least 4 bytes
2025-10-13 11:04:59 -07:00
Edu Garcia
c74b406a4c
Fix SDL GPU D3D12 Descriptor Heap leak
...
When descriptor leaks overflow, the D3D12 SDL GPU renderer fetches more from the pool, but never returns them, which eventually causes an "out of memory" crash.
2025-10-09 08:45:18 -07:00
Sam Lantinga
2a92a3c9c5
Recreate the Vulkan GPU swap chain when resuming on Android
...
Fixes https://github.com/libsdl-org/SDL/issues/12957
2025-10-08 21:06:17 -07:00
Sam Lantinga
00ffddece8
Ignore VK_SUBOPTIMAL_KHR on the Android platform
...
This is returned whenever the device has been rotated, and can be safely ignored.
Fixes https://github.com/libsdl-org/SDL/issues/12950
2025-10-08 20:02:31 -07:00
Sam Lantinga
a2a60f75c7
Temporarily disabled texture binding validation
...
There are some advanced use cases that trip over this, so temporarily disabling the validation pending further review.
Reference: https://github.com/libsdl-org/SDL/issues/13871
2025-10-08 19:50:48 -07:00
HTuanPhong
2638537f92
Fix vulkan gpu resize lag on windows
2025-10-04 15:22:28 -07:00
Mathieu Eyraud
86da08b0be
Zero-initialize SDL_GPUDevice
2025-10-01 07:22:17 -07:00
Sam Lantinga
8a5f9a3837
Removed validate_feature_indirect_draw_first_instance_disabled (thanks @rabbit-ecl!)
...
It was incorrectly checking the direct draw functions instead of checking indirect draw buffers.
2025-09-30 11:36:29 -07:00
Sam Lantinga
15f1cb4c98
Added GPU API support on visionOS
...
You must set SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN to false on this platform, since setDepthClipMode is not supported on Apple headsets (as of visionOS 2.3) and clipping is the default.
2025-09-29 13:28:00 -07:00
Sam Lantinga
2809ce9389
Set enable_depth_clip to true by default if SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN is false
2025-09-29 13:28:00 -07:00