Commit Graph

10980 Commits

Author SHA1 Message Date
Simon McVittie
23f855a970 render: Integrate fix-shaders.sh into build-shaders.sh
By writing the fxc and dxc output to a temporary file and then
converting that temporary file to the desired filename, we avoid
the incompatible semantics of sed -i on GNU systems (sed -i does not
create a backup filename, and does not take an argument unless it is
"bundled") and macOS (sed -i requires an argument, possibly empty).

Resolves: https://github.com/libsdl-org/SDL/issues/10878
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-18 10:38:59 -07:00
Sam Lantinga
d658ef6627 Don't guess about the size of an int, assert it! 2024-09-18 10:37:11 -07:00
Sam Lantinga
a90ad3b0e2 Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
2024-09-18 08:32:30 -07:00
Sam Lantinga
407ccadfd7 Added copyright header to edid.h 2024-09-18 08:18:26 -07:00
Sam Lantinga
bd04459cde Fix typos (thanks @qndel!)
Fix typos in comments and in one case in a returned error ("insuffient -> insufficient" fb273eb)
codespell src/ *.cpp *.h *.hpp --ignore-words-list unknwn,thid,algebric,statics,pixelX,pEvents,caf,ptd,parms,pEvent,parm,TextureRS,TE,HDA,LOD,datas,UE,xwindows,IIF
cd src; git checkout \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    libm \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    video/khronos \
    video/x11/edid.h \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
2024-09-18 08:18:26 -07:00
Sam Lantinga
03ae792df3 Fixed the recording field in audio device events
Fixes https://github.com/libsdl-org/SDL/issues/10885
2024-09-17 11:36:55 -07:00
Sam Lantinga
c68e9e157c Fixed typo 2024-09-17 10:59:28 -07:00
Sam Lantinga
bc9780299c Don't define backends if SDL_GPU_DISABLED is set 2024-09-17 09:40:29 -07:00
Sam Lantinga
807b8a9d4d Allow initializing hints and properties from any thread 2024-09-17 08:53:27 -07:00
Sam Lantinga
d0edf68774 Added Uint32 versions of the atomic functions 2024-09-17 08:53:27 -07:00
Sam Lantinga
8d223b3037 Renamed atomic functions to match SDL 3.0 naming convention
This will also allow us to cleanly add atomic operations for other types in the future.
2024-09-17 08:53:27 -07:00
Sam Lantinga
f3e419596b Removed SDL_INIT_TIMER
This is no longer necessary before calling SDL_AddTimer()
2024-09-17 08:53:27 -07:00
Sam Lantinga
9275c533ca Added thread-safe initialization/cleanup support
Also went through and removed inappropriate uses of spinlocks.

Fixes https://github.com/libsdl-org/SDL/issues/10872
2024-09-17 08:53:27 -07:00
Sam Lantinga
7edd43c276 Don't define render_drivers if SDL_RENDER_DISABLED is set
Fixes https://github.com/libsdl-org/SDL/issues/10861
2024-09-17 08:46:05 -07:00
Sam Lantinga
98cd8b34a7 Close the other file descriptors after redirection has taken place
Fixes https://github.com/libsdl-org/SDL/issues/10868
2024-09-17 07:46:48 -07:00
Simon McVittie
4b3058d58d render: Don't try to rebuild D3D11, D3D12, Metal shaders without spirv-cross
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-17 07:43:37 -07:00
Simon McVittie
13500bbf50 render: Fix detection of fxc, dxc in build-shaders.sh
We want `$USE_FXC` to default to the result of evaluating the variable
`$HAVE_FXC`, not the literal string `HAVE_FXC`, and the same for dxc.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-17 07:43:37 -07:00
Green Sky
11129761e7 v4l2: return success if the device is ready 2024-09-17 07:41:43 -07:00
Simon McVittie
ab9c68d9ff pipewire: Always destroy hotplug loop during deinitialization
We always need to destroy the hotplug loop and its associated resources
(if created) before we can deinitialize and unload the Pipewire library.

In the happy path where everything worked correctly, this means we will
call hotplug_loop_destroy() twice (once from PIPEWIRE_DeinitializeStart()
and a second time from PIPEWIRE_Deinitialize()), but that's OK, because
it's idempotent and so will do nothing the second time.

In error-handling code paths, this avoids needing to remember to call
hotplug_loop_destroy() explicitly, which should make it easier to avoid
bugs like #10787.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-17 07:35:42 -07:00
Sam Lantinga
231ea07617 Added SDL_LogTrace() 2024-09-17 02:04:54 -07:00
Sam Lantinga
6180da00e1 Skip a lock/unlock when logging known categories 2024-09-17 02:04:54 -07:00
Caleb Cornett
c499f79fe9 GPU: Fix multisample texture usage validation 2024-09-16 17:55:27 -05:00
Sam Lantinga
1bbc897e48 Updated documentation for bool return type
Also updated the test CRC functions to return bool.
2024-09-16 13:12:15 -07:00
Sam Lantinga
dc639956ba Improve logging performance and make log priorities thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/9679
2024-09-16 13:09:17 -07:00
Caleb Cornett
9416917353 GPU: Rework MSAA (#10859) 2024-09-16 12:19:09 -05:00
Sam Lantinga
0f85fdefc8 Fixed warning: "SDL_VIDEO_RENDER_D3D12" is not defined, evaluates to 0 2024-09-16 07:40:00 -07:00
Caleb Cornett
4f722d372a GPU: Metal vertex buffer indices should grow upward (#10837) 2024-09-15 20:17:43 -05:00
Sam Lantinga
5b5b1a8926 Fixed cleaning up dependent subsystems if initialization fails 2024-09-15 11:40:31 -07:00
Sam Lantinga
97d40b9218 Removed SDL_CleanupEnvironment() 2024-09-15 10:00:21 -07:00
Sam Lantinga
28b94c4758 Re-added SDL_getenv() as a thread-safe getenv() implementation 2024-09-15 09:37:04 -07:00
Sam Lantinga
718845a33d Fixed warning C4701: potentially uninitialized local variable 'startup_info' used 2024-09-15 09:21:04 -07:00
Sam Lantinga
19243092c6 Renamed SDL_GpuGraphicsPipelineTargetInfo to SDL_GPUGraphicsPipelineTargetInfo
Fixes https://github.com/libsdl-org/SDL/issues/10855
2024-09-15 07:46:26 -07:00
Sam Lantinga
604d0c519e If posix_spawn() is available, so is sigaction 2024-09-14 22:54:18 -07:00
Sam Lantinga
ec5d280c90 Make sure we ignore SIGPIPE so we don't crash if we write when the pipe is closed 2024-09-14 22:15:18 -07:00
Sam Lantinga
34b2f4ffca Use non-blocking pipes for process I/O on Windows
Fixes https://github.com/libsdl-org/SDL/issues/10846
2024-09-14 21:16:35 -07:00
Anonymous Maarten
dd07cc8991 SDL_Process: WAIT_TIMEOUT means the process has not exited yet 2024-09-14 21:16:29 -07:00
Carl Åstholm
1f3fd65c4c cpuinfo: Rename SDL_GetCPUCount to SDL_GetNumLogicalCPUCores
This was the only API that broke the "GetNumThings" convention
used elsewhere, so renaming it helps with consistency.
Adding "logical cores" to the name also makes it a bit
more immediately obvious what the count actually represents.
2024-09-14 19:33:30 -07:00
Sam Lantinga
dcb2a8c2fe Use CreateProcessW() to handle non-ASCII file paths and arguments 2024-09-14 12:27:22 -07:00
Sam Lantinga
e97f636590 SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER is an SDL_Environment pointer 2024-09-14 12:27:22 -07:00
Sam Lantinga
56fc4b790c Reduce strcmp() calls in hashtable lookup 2024-09-14 11:46:40 -07:00
Sam Lantinga
e673479449 Removed SDL_WriteProcess()
This had the unfortunate side-effect of blocking if you tried to write too much. Instead you can use SDL_GetProcessInput() and handle SDL_IO_STATUS_NOT_READY as needed.

Fixes https://github.com/libsdl-org/SDL/issues/10834
2024-09-14 11:15:50 -07:00
Ozkan Sezer
a833ee2e63 SDL_gpu.c: fixed build when SDL_GPU_DISABLED is defined. 2024-09-14 20:40:56 +03:00
ritalat
f6f49de134 Add convenience functions to get process IOStreams 2024-09-14 10:33:29 -07:00
Sam Lantinga
7ff015ceae Close file descriptors not used by the child process 2024-09-14 10:29:02 -07:00
Sam Lantinga
fed0149172 Switched wayland messageboxes to use the new process API 2024-09-14 10:29:02 -07:00
Sam Lantinga
aa7357a14d SDL_CreateEnvironment() fills the environment with a non-zero parameter 2024-09-14 10:29:02 -07:00
Sam Lantinga
76c469910e Added SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN 2024-09-14 10:29:02 -07:00
Sam Lantinga
44c6cfda05 Switched zenity dialogs to use the new process API 2024-09-14 10:29:02 -07:00
Semphriss
27862907c6 Update src/process/windows/SDL_windowsprocess.c
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-09-13 22:15:56 -07:00
Semphriss
82b33a7d3f Update src/process/windows/SDL_windowsprocess.c
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-09-13 22:15:56 -07:00