Commit Graph

2068 Commits

Author SHA1 Message Date
Sam Lantinga
4601c46a68 Rebuilt test shader headers 2026-08-23 10:08:59 -07:00
momoko-h
902484f65c Update testgpurender_effects_grayscale.frag.hlsl
The formular did not use blue at all but red twice and the factor intended for blue was off.
2026-08-23 10:02:00 -07:00
Anonymous Maarten
a0db66a718 cmake: add FFmpeg components as argument to find_package 2026-08-21 17:50:43 +02:00
Anonymous Maarten
b30cda60c1 Make interactive tests work on SDL3 built with disabled param checking (or assert on invalid) 2026-08-21 07:44:30 -07:00
Anonymous Maarten
80ad29564c ci: vita's lame does not declare mpg123 dependency, so disable testffmpeg
[sdl-ci-filter *vita*]
2026-08-21 02:54:49 +02:00
Cameron Cawley
6f3d0c1337 Include transparency information for icon.png in the image data 2026-08-20 07:57:18 -07:00
Caleb Cornett
d4440c0446 test: Fix MSAA support in testgpu_spinning_cube 2026-08-14 16:45:55 -04:00
Sam Lantinga
982787979f testcolorspace: added an additional PQ blend color case 2026-07-23 10:50:23 -07:00
Sam Lantinga
413ac5084d testcolorspace: show the blend color when it's incorrect
Also added an additional PQ blend color case
2026-07-23 10:40:20 -07:00
Sam Lantinga
148241117b Define SCRGB_NITS for use in HDR color calculations 2026-07-23 10:25:25 -07:00
Sam Lantinga
9f4a1215e2 testcolorspace: show a reasonable HDR gradient on Wayland
On some Wayland configurations, the SDR white level is 203 nits and the max luminance is 10000 nits, and HDR content in the PQ range is mapped by the compositor into the actual display capabilities. We don't want to show an HDR gradient up to 10000 nits, so let's cap it to ~1000 nits in this case.
2026-07-23 08:01:05 -07:00
Sam Lantinga
0d21a1aa7a testcolorspace: add optional cycling of colorspaces 2026-07-22 11:36:32 -07:00
Sam Lantinga
e10457d52f testcolorspace: added an HDR10 gradient 2026-07-22 11:36:32 -07:00
Sam Lantinga
23b641070c Added HDR10 display support for the direct3d11, direct3d12, and vulkan renderers 2026-07-22 11:36:32 -07:00
Frank Praznik
d63137082a test: Fix memory leak in testclipboard 2026-07-21 14:38:48 -04:00
Sam Lantinga
08b9c55393 Fixed error: cast from pointer to integer of different size 2026-07-17 22:08:39 -07:00
Sam Lantinga
f00052ffe2 testffmpeg: fixed memory leak using DRM frames with the Vulkan renderer 2026-07-17 19:24:46 -07:00
Sam Lantinga
762f4abbd0 Fixed an error with goto crossing variable initialization 2026-07-17 16:56:23 -07:00
Sam Lantinga
332e7a050e testffmpeg: added support for VA-API and DRM frames when using Vulkan rendering 2026-07-17 16:23:48 -07:00
Antonio Ospite
d330686798 test: Remove superfluous null byte from ps3_hid_report_descriptor
Remove a superfluous null byte at the end of ps3_hid_report_descriptor,
as it might confuse some more stricter parser.

The data in ps3_hid_report_descriptor probably comes for a libinput
recording, and sometimes those can have superfluous null byte at the
end.

This is mentioned for example in the hidreport project:
64d4067403/tools/libinput-recording-extract-hid-descriptor.py (L25-L27)

As a proof that the original HID report descriptor of the actual device
is 148 bytes long, the following lsusb capture can be compared:
http://ps3.jim.sh/sixaxis/usb/lsusb.txt

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
2026-07-16 08:53:14 -07:00
Ozkan Sezer
a6c294410e introduce new printf format macros SDL_PRISZu, SDL_PRISZx and SDL_PRISZX 2026-07-13 22:35:03 +03:00
Antonio Ospite
b9758218c8 Misc cleanup for src/joystick/hidapi/SDL_report_descriptor.c and new test program (#15959)
* testevdev: Always use decimal for HID report descriptors size

The size of the HID report descriptors in the SDL_COMPILE_TIME_ASSERT
checks is specified sometimes in decimal and sometimes in octal.

Always used decimal for consistency.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_report_descriptor: Add missing include guards in header file

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_report_descriptor: Fix some ignored return values

Fix some ignored return values resulting in incomplete error checking.

For instance:

  - ParseMainItem() was always returning true because the return value of
    AddInputFields() was not handled.

  - ParseLocalItem() was always returning true because the return value of
    AddUsage() was not handled.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* test: Add new test program for SDL_report_descriptor code

Add support for testing the SDL_report_descriptor code by adding a new
executable to make it easier to experiment with HID report descriptor
parsing.

The main() function which originally was in
src/joystick/hidapi/SDL_report_descriptor.c is moved to a separate file
named test/testdescriptor.c in order to simplify dealing with multiple
build systems.

For instance if the main() was in
src/joystick/hidapi/SDL_report_descriptor.c the code would have to
account for the cases when the file is built as part of the library or
when it's built as part of a standalone executable, in which case the
dynamic API mechanism needs to be disabled.

This would pose a problem especially with MSVC which uses pre-compiled
headers (PCH) which do not sit well with the preprocessor logic that
would be needed, like the hacks added in test/testevdev.c

Using a completely separate source file for the standalone executable
avoids the issue, especially considering that the new file is not built
with MSVC at all.

The new test program can be built with:

  cmake -DCMAKE_BUILD_TYPE=Debug -DSDL_TESTS=ON -S . -B build
  make -C testdescriptor

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* testdescriptor: Fix compiler warning

Fix compiler warning:

-----------------------------------------------------------------------
.../test/testdescriptor.c: In function ‘main’:
.../test/testdescriptor.c:56:17: warning: unused variable ‘file’ [-Wunused-variable]
   56 |     const char *file = argv[1];
      |                 ^~~~

-----------------------------------------------------------------------

Use the `file` variable when appropriate since it is already declared
and assigned.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* testdescriptor: Clean up descriptor context before exiting

For correctness clean up the descriptor parsing context before exiting,
even though this is not a problem in practice for a standalone
executable.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* testdescriptor: Exercise public API for parsing report descriptor

This gives some more coverage when running the SDL_report_descriptor
test program.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_report_descriptor: use size_t for variables that represent buffer sizes

Using size_t type for variables that represent buffer sizes in
src/joystick/hidapi/SDL_report_descriptor.[hc] addresses possible errors
when using the functions in combination with SDL_LoadFile, like in
test/testdescriptor.c

When building with CMake on Windows x64 the compilation was failing with
the following error:

-----------------------------------------------------------------------
D:\a\SDL\SDL\test\testdescriptor.c(69): error C2220: the following warning is treated as an error
D:\a\SDL\SDL\test\testdescriptor.c(69): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
-----------------------------------------------------------------------

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_hidapi_xboxone: protect against passing negative size to SDL_ReadReportData

Since SDL_ReadReportData() is now using size_t for the buffer size, also
change its user HIDAPI_DriverXboxOne_HandleDescriptorReport to pass
size_t, but protecting against possible cases of passing negative values
to SDL_ReadReportData().

To do that it is enough to check that the "size" argument is not zero,
so it will never be negative when decremented (size--) a few lines
below.

Note: this just addresses a theoretical issue with future callers of
HIDAPI_DriverXboxOne_HandleDescriptorReport, the current code would be
already safe as the current caller already checks that size > 0.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

---------

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
2026-07-13 08:26:03 -07:00
Sam Lantinga
9149eca207 testffmpeg_vulkan: enable the VK_KHR_video_maintenance1 extension
This is used by ffmpeg, so we'll enable it if it's available
2026-07-10 11:40:30 -07:00
Sam Lantinga
094213b3be testffmpeg_vulkan: fixed goto jump past variable initialization 2026-07-10 10:07:50 -07:00
Sam Lantinga
4a00b98c91 testffmpeg: added a --nodelay command line option 2026-07-10 10:06:48 -07:00
Sam Lantinga
573fc51938 testffmpeg_vulkan: use C++ compatible code structure 2026-07-10 10:06:48 -07:00
Sam Lantinga
6ce3d843fc testffmpeg_vulkan: fixed usage of timeline semaphores 2026-07-10 10:06:48 -07:00
Can H. Tartanoglu
bb6f24e542 testprocess: handle async exec failure for missing executables 2026-07-04 11:16:57 -07:00
Sam Lantinga
07ecc125cf Added SDL_PIXELFORMAT_P408 and SDL_PIXELFORMAT_P416 2026-06-22 17:01:54 -05:00
Semphriss
e52dbf4442 Add basic Ubuntu Touch functions #12543
This adds support for:
* System theme
* Sandbox detection
* Device form factor detection

Many things aren't properly supported yet, but changes and upgrades will happen on the Ubuntu Touch side, so SDL should automatically support more Ubuntu Touch features as time goes.
2026-06-21 11:51:15 -07:00
Ryan C. Gordon
72771ac0b4 credits: Update links to Will Provost's album "The Living Proof"
Amazon's store link was still "http://" instead of "https://", and since they
don't have the physical CD in stock anymore (and probably won't ever again), I
added a link to the album on Amazon Music, for those that want to access it.
2026-06-10 20:48:57 -04:00
Frank Praznik
8275f6e90d Add D-Bus notification driver
Use the core and portal notification implementations to dispatch system notifications.
2026-06-10 13:25:38 -04:00
Frank Praznik
068e405912 Add notification framework with test and dummy driver 2026-06-10 13:25:38 -04:00
Frank Praznik
96919c37c9 stdlib: Add SDL_wcstoul(), SDL_wcstoll(), and SDL_wcstoull()
Includes the appropriate stdlib checks and automated tests.
2026-06-08 11:58:47 -04:00
Sam Lantinga
e04bfb4c6e render: an empty clip rect should clip all drawing
Added a test to validate this and fixed the Metal renderer

Fixes https://github.com/libsdl-org/SDL/issues/15434
2026-05-29 13:58:34 -07:00
Sam Lantinga
a95f5f9874 testcontroller: make sure touchpad touches are visible even at very light pressure 2026-05-28 09:58:33 -07:00
Ryan C. Gordon
d7ba3efe6b filesystem: Implement SDL_GetExeName() for all platforms. 2026-05-27 15:41:51 -04:00
Sam Lantinga
1db2b71ef0 testgpurender_msdf: allow changing the text being rendered 2026-05-25 20:21:32 -07:00
Anonymous Maarten
32c19b9dc8 Fix buffer-overflow access in process_testStdinToStdout
Backing memory of SDL_IOFromDynamicMem is not null-terminated.
2026-05-25 17:29:58 +02:00
Frank Praznik
f31ca02723 video: Windows keep any position set when in fullscreen after leaving fullscreen
Adds an automated test for the behavior as well.
2026-05-18 09:09:49 -07:00
ceski
d8b2434047 testcontroller: correct fix for touchpad free/allocate 2026-05-17 18:19:29 -07:00
Cameron Gutman
6d3404e4bb gamepad: Add SDL_GAMEPAD_TYPE_STEAM for Steam Controllers 2026-05-17 11:19:16 -07:00
ceski
5b98c1cc2f Add capacitive sense gamepad events (#15627) 2026-05-17 08:26:29 -07:00
ceski
984fcdaa8a testcontroller: free/allocate touchpads only when needed 2026-05-17 07:45:59 -07:00
Ozkan Sezer
a34b35a382 cygwin, test/cmake: hard-code opengl as native opengl32.
FindOpenGL from cmake >= 3.19, or cygwin-provided cmake versions don't
test for native windows opengl32, but we want native windows opengl32.
2026-05-17 09:55:31 +03:00
Anonymous Maarten
d1d54b8c56 test: build testsprite as c++ application 2026-05-15 18:08:09 +02:00
stahta01
6586bebfec Fix Cygwin building and add CI (#15566)
Co-authored-by: TrueCat17 <truecat17@gmail.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2026-05-15 08:48:24 -07:00
ceski
006959ca87 Add dual touchpad support to testcontroller (#15540) 2026-05-13 23:49:01 -07:00
Gabriel Wang
0f175891a6 Add SVE2 SIMD Alpha-Blending Blitter (#15504)
SVE/SVE2 is a new SIMD extension for AArch64. Compared to NEON, SVE/SVE2 brings the following benefits that are good for SDL projects:

- Lane prediction: we don't have to treat the tail part of a stride separately when the width is n times the hardware vector size
- Although the performance is almost no difference from NEON when the hardware vector size is 128bits, when the hardware provides a longer vector size, e.g. 256, 512, ... 2048, we can enjoy the large performance gain without modifying the source code or recompiling a library.

The functional correctness is validated in a dedicated [qemu project](https://github.com/GorgonMeducer/aarch64_qemu_mac_template/tree/SDL-SVE2-Acceleration-Validation).

The performance is tested on [Radxa Orion 6 N](https://radxa.com/products/orion/o6n/), which provides 4x A720 and 4x A520 processors. Since the vector size is 128 bits, which is the same as NEON, the performance is almost the same (or no worse than) the NEON acceleration.
2026-05-13 23:37:46 -07:00
Cameron Cawley
e50faf4e6a Support the full set of standard CSS cursors 2026-05-13 20:24:44 -07:00