Commit Graph

10980 Commits

Author SHA1 Message Date
Sam Lantinga
3f446d8fb5 Minor cleanup 2024-09-27 14:10:46 -07:00
Ozkan Sezer
1088ea55fa SDL_gpu_d3d11.c: define D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD for old toolchains 2024-09-27 23:55:02 +03:00
cosmonaut
de40d6bae0 GPU Metal: Set texture to NULL even if AcquireSwapchainTexture fails 2024-09-27 13:49:26 -07:00
David Fort
f32e96f5e2 clipboard: add SDL_ClipboardMimeTypes
This function allows to retrieve the available mime types without doing any
synthesizing.
2024-09-27 13:38:40 -07:00
cosmonaut
eedd2039f9 GPU: 32-bit component texture formats 2024-09-27 16:26:43 -04:00
Evan Hemsley
05d0656bd6 GPU: Simultaneous compute pass read-write (#10965) 2024-09-27 12:49:37 -07:00
Sam Lantinga
d39acc6d1e Fixed warning C4702: unreachable code 2024-09-27 11:19:54 -07:00
Caleb Cornett
5ff6e8d522 GPU: Add enable_depth_clip to RasterizerState (#10964) 2024-09-27 11:18:54 -05:00
Daniel Ludwig
e98cf3c870 Fix Xbox builds 2024-09-27 08:10:03 -07:00
Evan Hemsley
be401dd1e3 GPU: More robust error reporting (#10958)
---------

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-27 00:30:18 -07:00
Sam Lantinga
48e213b4cd Fixed SDL_ShouldQuit() returning false during status transitions
We should wait for the state to stabilize before SDL_ShouldQuit() returns.

For example:
Thread A initializes and increments a use refcount
Thread B skips initializing and increments the use refcount
Thread B starts cleaning up and checks the use refcount
Thread A starts cleaning up, returns because SDL_ShouldQuit() returns false (not initialized), not touching the use refcount
Thread B returns because the use refcount isn't zero

Now we have the state where the refcount is greater than one and both thread A and B have attempted to cleanup.

With this change:
Thread A initializes and increments a use refcount
Thread B skips initializing and increments the use refcount
Thread B starts cleaning up and decrements and checks the use refcount
Thread A starts cleaning up, waits for thread B
Thread B returns because the use refcount isn't zero
Thread A continues and decrements and checks the use refcount, and finishes cleaning up because it has reached 0.
2024-09-26 18:08:58 -07:00
Ryan C. Gordon
d8c76d2f34 filesystem: POSIX SDL_SYS_CopyFile shouldn't use a temp file.
Fixes #10957.
2024-09-26 19:34:34 -04:00
Ryan C. Gordon
f267ec7681 filesystem: Improve docs, make some promises about overwrites and file caches.
Note that SDL_FlushIO() doesn't make promises about file data sync but that
is intended to be changed in the IOStream code in a later commit.

Fixes #10886.
2024-09-26 19:29:03 -04:00
Sam Lantinga
125e592844 Added SDL_ShouldInit() and SDL_ShouldQuit()
These are handy functions to support thread-safe initialization and shutdown.
2024-09-26 16:26:12 -07:00
Ryan C. Gordon
38f971bac5 filesystem: SDL_SYS_EnumerateDirectory() now returns bool. 2024-09-26 16:35:15 -04:00
Frank Praznik
671a33c2f7 wayland: Raise all touches on a cancel event 2024-09-26 14:45:10 -04:00
Petar Popovic
457d0edeaf Remove some extra semicolons 2024-09-26 20:01:56 +03:00
Sam Lantinga
345d9bfe19 A zero source rect is valid for blitting
A zero sized source rect draws pixels sourced from a 0x0 region on the source surface.

Fixes https://github.com/libsdl-org/SDL/issues/8580
2024-09-25 22:36:55 -07:00
Sam Lantinga
1aea43846e Don't use BlitARGBto555PixelAlpha() for SDL_PIXELFORMAT_ARGB1555
This didn't properly take into account destination alpha.

Fixes https://github.com/libsdl-org/SDL/issues/8401
2024-09-25 21:54:05 -07:00
Sam Lantinga
d9a7da4fac Optimized SDL_HasEvent() and SDL_HasEvents()
Also document the counting behavior of SDL_PEEKEVENT.

Fixes https://github.com/libsdl-org/SDL/issues/6209
2024-09-25 21:20:00 -07:00
Ryan C. Gordon
3abb213083 opengl: Fixed SDL_RENDERCMD_SETDRAWCOLOR code checking the wrong variable. 2024-09-25 23:14:32 -04:00
Ryan C. Gordon
961cd51611 opengl: Removed a FIXME (this is documented as not-thread-safe now. 2024-09-25 23:14:32 -04:00
Anonymous Maarten
76f28ea120 Fix stdlib usage 2024-09-25 23:59:35 +02:00
Ryan C. Gordon
4c48ff51f8 render: SDL_RenderPresent now behaves when a render target is currently set.
It'll temporarily unbind it, draw letterboxing if necessary, present, and
then rebind the previous render target.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
7a6a0becb8 render: Fixed a FIXME for SDL_SetRenderViewport with a negative size. 2024-09-25 16:26:36 -04:00
Ryan C. Gordon
54459def69 render: Remove the logical presentation render target.
Now we render directly to the window, scaling as appropriate. This fixes some
concerns the render target introduced, like the quality of the final scaled
output, how to step outside of the logical size temporarily to draw some
things sharply at the native resolution, and loss of sub-pixel precision.

Fixes #8736.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
bf7a48cdcc render/gpu: Change some memcpy calls to SDL_memcpy. 2024-09-25 16:26:36 -04:00
cosmonaut
925e47a077 GPU: Fix backwards LogError and SetError calls 2024-09-25 12:47:40 -07:00
cosmonaut
557c6dfb18 GPU: call SDL_SetError where appropriate 2024-09-25 10:47:14 -07:00
Cameron Gutman
6ec8b1a173 Throttle tickle reports to PS4/PS5 controllers
UpdateDevice() can be called at an arbitrary rate, so we need to
pace ourselves to avoid filling up the rumble queue with these.
2024-09-25 07:20:35 -07:00
Anthony
53bf2baac3 Change JNI calls to comply with recent Boolean changes
Android OpenURL and Toast methods return Booleans now, so let's use the correct interface.
2024-09-24 14:45:24 -07:00
Frank Praznik
ad3a4c677b wayland: Clean up cursor scaling
Handle named and custom cursor scaling in a cleaner manner, and account for edge cases where named cursor sizes may not exactly match the required size.
2024-09-24 11:46:56 -04:00
Cameron Gutman
57418475ce kmsdrm: Keep fd around if we can drop master
Modern kernels (v5.8+) allow non-root usage of drmDropMaster(), so
we can hold on to our fd after dropping master on it. This fixes
populating drm_fd in the KMSDRM SysWMinfo when using Vulkan.

Also add a missing error check for open() while we're here
2024-09-24 12:55:02 +03:00
Cameron Gutman
13f88df190 kmsdrm: Fix KMSDRM_Vulkan_CreateSurface() return value 2024-09-23 23:33:15 -05:00
Cameron Gutman
8f55f48337 kmsdrm: Move property initialization a bit further down
KMSDRM_GBMInit() must be called first to set drm_fd and gbm_dev.
2024-09-23 23:00:14 -05:00
Petar Popovic
004ac40226 Fix warning: no function prototype 2024-09-23 10:03:18 -07:00
Ethan Lee
4a3faf20ac gpu: Replace high-level logs with SetError 2024-09-23 10:57:10 -04:00
mausimus
0685b96469 GPU: fix build when SDL_GPU_DISABLED is set 2024-09-23 08:09:17 -04:00
Caleb Cornett
97d1056e16 GPU: MSAA fixes (#10917) 2024-09-21 17:38:10 -05:00
Evan Hemsley
89c6bc5f50 Prefer Vulkan even on Windows (#10912) 2024-09-20 13:42:15 -07:00
Evan Hemsley
980b4ff6db GPU: Vulkan descriptor management rewrite (#10910) 2024-09-20 12:55:39 -07:00
Frank Praznik
fcb8a2c016 wayland: Fix animated cursor timing
Adjust the frame timing so it will still advance if the frame callback fires faster than the frame duration.
2024-09-20 14:19:28 -04:00
Sam Lantinga
ea2e2e451d Better fix for initializing Android environment variables 2024-09-20 11:09:48 -07:00
Sam Lantinga
095fb5f522 Fixed infinite recursion at startup on Android 2024-09-20 10:56:02 -07:00
T3hD0gg
594edb6bd2 Add Thrustmaster TMX VID & PID to wheel device list. 2024-09-18 22:19:54 -07:00
Sam Lantinga
34c6011360 Fixed Windows build 2024-09-18 14:55:51 -07:00
Sam Lantinga
d29a0e3f31 Fixed warning: no previous prototype for function 2024-09-18 14:34:14 -07:00
Sam Lantinga
398dff7c25 Added support for the HORI licensed Steam Controller 2024-09-18 14:08:32 -07:00
Sam Lantinga
481203c074 Fixed Xcode warnings 2024-09-18 13:20:53 -07:00
Sam Lantinga
95c3ee77c1 Removed testing code 2024-09-18 11:12:06 -07:00