Commit Graph

10980 Commits

Author SHA1 Message Date
Sam Lantinga
20d0a1a3d1 Added a defensive check against XINPUTGETCAPABILITIES being NULL
This should never happen, but it does, possibly due to a data segment overwrite elsewhere.
2024-09-04 16:30:27 -07:00
Sam Lantinga
abd2ac5992 Set the desired channel count when opening audio on Android 2024-09-04 13:59:48 -07:00
Sam Lantinga
e2c9a0a427 Updated Android audio log messages 2024-09-04 13:59:48 -07:00
Evan Hemsley
1788be8547 GPU: Add const to some function parameters (#10694) 2024-09-04 13:53:41 -07:00
Sam Lantinga
c9387bcca5 pipewire: spa_list_is_empty() returns bool 2024-09-03 13:45:00 -07:00
Sam Lantinga
0fd275e16e pulseaudio: fixed cleanup if couldn't connect to pulseaudio server 2024-09-03 13:34:19 -07:00
Sam Lantinga
a56315cd48 Fixed return value failing to load pulseaudio functions 2024-09-03 13:24:27 -07:00
Sam Lantinga
7ca676aeed Use ASCII characters in SDL source and headers
Fixes https://github.com/libsdl-org/SDL/issues/10636
2024-09-03 12:52:27 -07:00
Daniel Ludwig
b1b4a9cd1b GDK build: PFN_D3D12_XBOX_CREATE_DEVICE not defined for Xbox One (#10690) 2024-09-03 08:09:00 -05:00
Sam Lantinga
73898a0a64 Renamed NDA platform constants to "PRIVATE" 2024-09-02 21:00:34 -07:00
Sam Lantinga
35dadda327 Fixed build warnings 2024-09-02 17:17:48 -07:00
Sam Lantinga
eacf119923 Renamed SDL_size_add_overflow() and SDL_size_mul_overflow() 2024-09-02 17:17:48 -07:00
Andrei Alexeyev
fb7245fb93 GPU: Add support for more texture formats (#10641) 2024-09-02 19:14:48 -05:00
Caleb Cornett
f405def691 Change GPU flag enums to defines (#10681) 2024-09-02 15:19:43 -07:00
Sam Lantinga
d501f6db07 Make newer DRM and GBM functions optional
Fixes https://github.com/libsdl-org/SDL/issues/10675
2024-09-02 10:37:50 -07:00
Sam Lantinga
8371114009 Fixed error: multiple storage classes in declaration specifiers 2024-09-02 09:50:19 -07:00
Sam Lantinga
93423c1c46 spin_acquire_lock() takes a volatile pointer parameter 2024-09-02 09:50:19 -07:00
Sam Lantinga
01fa9cad80 Fixed error: conflicting types for 'getpagesize' 2024-09-02 09:50:19 -07:00
Sam Lantinga
8b0798a3da Fixed error: variable 'nfences' set but not used 2024-09-02 09:50:19 -07:00
Sam Lantinga
b5700ccc02 Updated dlmalloc to version 2.8.6
From https://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.c
2024-09-02 09:50:19 -07:00
Davis Gallinghouse
deb313dd99 GPU: Compile Metal shader source from NSString
Using the @() syntax to construct an NSString assumes the parenthesized
pointer is null-terminated, but the Metal shader source included in
render/sdlgpu/shaders/metal.h is not null-terminated.

Quoting the clang documentation on Objective-C literals:

    When the type of the parenthesized expression is (char *) or (const
    char *), the result of the boxed expression is a pointer to an
    NSString object containing equivalent character data, which is
    assumed to be ‘\0’-terminated and UTF-8 encoded.

Because the @() syntax assumes null-termination, it may read garbage
data after the shader source (up to the next null byte), which can then
cause the Metal shader compiler to fail. To prevent this, instead of
using the @() boxing syntax, we explicitly construct an NSString using
the string length passed by the caller.
2024-09-02 07:20:36 -07:00
Sam Lantinga
df501040fd Fixed random seed not affecting SDLTest_RandomIntegerInRange() 2024-09-01 14:05:27 -07:00
Zero
2c0ffdc6d5 GPU: Pass the new window size when resizing the swapchain for d3d12 (#10665) 2024-09-01 08:48:29 -07:00
Andrei Alexeyev
d4b8072614 GPU: Fix and generalize BytesPerRow() and BytesPerImage() (#10663)
These functions had special cases for a few BC formats, but all
block-compressed formats should need the same logic. Furthermore they
weren't handling the sRGB variants of those formats.
2024-08-31 23:07:38 -07:00
coffeechriph
b15d79a35a Fix texture_rgba_frag for metal in SDL_shaders_gpu.c 2024-08-31 20:09:11 -07:00
Anonymous Maarten
c11b58ead7 Increase maximum line length of SDLTest_LogAllocations 2024-09-01 02:19:39 +02:00
Sam Lantinga
b17ca32d8c Changed GPU driver names to match renderer driver names
Fixes https://github.com/libsdl-org/SDL/issues/10650
2024-08-31 10:06:27 -07:00
Sam Lantinga
51a0b58f75 GPU logging should be quiet by default 2024-08-31 09:52:21 -07:00
Sam Lantinga
6c30a0f60b Added scaleMode validation to SDL_SetTextureScaleMode() 2024-08-31 09:43:02 -07:00
Anonymous Maarten
63e58e5d66 SDL_Log: always use WriteFile/WriteConsole on Windows
OutputDebugString and fprintf(stderr) (of mslibc) both output
to the debug window of Visual Studio.
In other debuggers (e.g. RAD), this does not happen.

To avoid double output, this commit always uses WriteFile/WriteConsole.
2024-08-31 17:48:57 +02:00
Anonymous Maarten
8ffc1c2705 SDL_Log: don't rely on printf to forward stderr to the debug stream
This partially reverts 125ce71379
2024-08-31 17:48:57 +02:00
Sam Lantinga
f827c1322c Renamed SDL_Del* to SDL_Remove* 2024-08-31 07:46:28 -07:00
Sam Lantinga
cf1d8e2dfd Renamed SDL_AtomicSetPtr() and SDL_AtomicGetPtr()
Fixes https://github.com/libsdl-org/SDL/issues/10601
2024-08-31 07:46:28 -07:00
Jan Sedivy
00708b976a GPU Metal: Fix uninitialized memory 2024-08-31 07:29:32 -07:00
Sam Lantinga
2010a22f44 Removed unneeded separate return statement. 2024-08-31 07:26:13 -07:00
Sam Lantinga
4759a97c09 Fixed return value from D3D12_UpdateVertexBuffer()
Fixes https://github.com/libsdl-org/SDL/issues/10649
2024-08-31 07:26:13 -07:00
Anonymous Maarten
31a5f3b833 Fix C4090: 'function': different 'const' qualifiers 2024-08-31 06:49:33 -07:00
Frank Praznik
5d5a685a80 wayland: Add support for setting window icons via the xdg-toplevel-icon-v1 protocol 2024-08-31 09:38:43 -04:00
Anonymous Maarten
ea0ab2647a SDL_test: print no procname when SDL_TRACKMEM_SYMBOL_NAMES is false
On ci, by default this variable is set to a false value.
By adding [sdl-ci-trackmem] to the commit message,
it will become true.
2024-08-31 13:16:51 +02:00
Anonymous Maarten
384afa378c SDL_test: fix proc names on older libunwind
Older libunwind does not have unw_get_proc_name_by_ip.
Instead, use unw_get_proc_name.

Reference: 4c00433b69
2024-08-31 13:16:51 +02:00
Andrei Alexeyev
0e08d15cca GPU: Fix unhandled R16G16_UNORM in SDL_GPUTextureFormatTexelBlockSize() (#10638) 2024-08-30 17:05:17 -07:00
Sam Lantinga
f13dc502c6 Sort exported functions 2024-08-30 15:45:30 -07:00
Evan Hemsley
12ecdb9dde GPU: Rename some awkwardly named functions (#10642) 2024-08-30 15:31:10 -07:00
Sam Lantinga
bef07023d6 Fixed memory leak if the GPU renderer can't be initialized
DestroyRenderer needs to be set before we return false from GPU_CreateRenderer()
2024-08-30 14:49:49 -07:00
cosmonaut
906044569d GPU D3D12: Fix command buffer leak 2024-08-30 10:46:41 -07:00
Sam Lantinga
b602c449e5 Remove SDL_SCALEMODE_BEST
Fixes https://github.com/libsdl-org/SDL/issues/10619
2024-08-30 10:30:14 -07:00
Evan Hemsley
4bbf0d45fd GPU D3D12: Fix teardown and leaks on device creation failure (#10639) 2024-08-30 10:24:02 -07:00
Sam Lantinga
40d85109ac Fixed crash when using the dummy video driver
The higher level code will clean up the renderer if initialization fails.
2024-08-30 07:16:47 -07:00
Sam Lantinga
580a496391 Adjust rounding when calculating resampled output frames
Fixes https://github.com/libsdl-org/sdl2-compat/issues/95
2024-08-30 07:16:47 -07:00
Anonymous Maarten
88fe52df7b SDL_test: add --gpu option 2024-08-30 13:43:38 +02:00