Commit Graph

10611 Commits

Author SHA1 Message Date
ATrivialAtomic
293d59887a compress/cmpto_j2k.cpp
Fix merge CUDA issues. Make some static functions now members of state_video_compress_j2k class
2025-04-02 12:04:30 -04:00
ATrivialAtomic
c367401fd6 vulkan_context.cpp - update to match commit 9d8ab81 2025-04-02 12:03:10 -04:00
Martin Piatka
5325a2b78c disp/vulkan: Use unique_ptr for frame mappings 2025-04-02 15:49:39 +02:00
Martin Piatka
aa79670280 disp/vulkan: Drop standard layout requirement
Not really needed
2025-04-02 15:49:39 +02:00
Martin Piatka
36a2f2d97b disp/vulkan: Fix spelling of 'attributes' 2025-04-02 15:49:39 +02:00
Martin Piatka
943ca22be3 disp/vulkan: Use log_msg for logging 2025-04-02 15:49:39 +02:00
Martin Pulec
96486494cd tests improvements
- suppress the output for unit_evaluate
- improve debug printout codec_conversion_test_testcard_uyvy_to_i420
- improve C variant of ASSERT_EQUAL_MESSAGE macro (prints num values
also in hex)
- remove VLA from codec_conversions_test.cpp (not valid in C++)
2025-04-01 15:42:13 +02:00
Martin Pulec
b86d62876d configure.ac: sdl2_compat detect fix
sdl2.pc does no longer provide sdl2_compat - add a fallback parsing
it from the .pc file manually (pkgconf) and from --debug (pkg-config).
2025-04-01 14:09:45 +02:00
Martin Pulec
f6dd5b15c2 uuvu_to_nv12: handle irregular sizes 2025-04-01 14:02:32 +02:00
Martin Pulec
301aa47a88 y216_to_p010le: handle odd number of rows/lines 2025-04-01 14:02:32 +02:00
Martin Pulec
c06691d045 add test for y216_to_p010le 2025-04-01 14:02:31 +02:00
Martin Pulec
92e8d99b28 fixed uyvy_to_i420
fix test codec_conversion_test_testcard_uyvy_to_i420 fail caused by the
merge of testcard_common toI420 to to_lavc uyvy_to_yuv420p

Last line was incorrectly checked in case of odd number of lines.
2025-04-01 14:02:31 +02:00
Martin Pulec
5c13644cd8 configure: sdl aux fix
Fixed $sdl_ver_suffix used instead of $sdl_version - the former is ""
for SDL1 - when testing _ttf and _mixer.
2025-04-01 14:02:31 +02:00
Martin Pulec
1092abdfe8 sdl3: blacklist P010 for direct3d[12] 2025-04-01 14:02:31 +02:00
Martin Pulec
39554640f9 sdl_mixer (3): if mono requested, capture stereo
Workaround for SDL3 mixer, that doesn't respect selected ch_count=1 now.

Reduced the channel count later in audio stack (this will work for other
acaps as well).
2025-04-01 14:02:31 +02:00
Martin Pulec
85679c4fad sdl3: add errata + Vulkan warning 2025-04-01 14:02:30 +02:00
Martin Pulec
b073f9d105 configure.ac: add option not to use MoltenVK [mac]
On mac, we can link either to MoltenVK or the vulkan-loader. The MoltenVK
variant is default, because the bundler then bundles the library as the
compat layer. If linked to vulkan-loader, Vulkan will likely not work if
the MoltenVK is not installed on the host computer.

But it is useful for debugging (the behavior is slightly different if
loaded via vulkan-loader even if the backend is MoltenVK - the KHR
portability bit/enumeration stuff).
2025-04-01 14:02:30 +02:00
Martin Pulec
fa764db2d6 share some more convs between sdl3, to_lavc, testc
1. to SDL3 nv12 (not supported before)

2. to_lavc - use rgba_to_bgra - the vc_copyline version was not keeping alpha
(if ever used - this may cause regressions, unfortunately, if alpha is
assumed to be 100%, because the orig version set it always)

3. uyvy_to_i420 use by testcard and to_lavc

uyvy_to_i420: do not write out of bounds

If width % 2 = 1, 1 extra luma on first line of pair will override the
first luma on the second.
2025-04-01 14:02:30 +02:00
Martin Pulec
6bdc223e15 sdl3: disable alpha blend by default
but added option to allow (in help shown newly in "fullhelp")
2025-04-01 14:02:30 +02:00
Martin Pulec
faf1367cb7 y216_to_p010le: make it usable also for FFmpeg
to_lavc conversion
2025-04-01 14:02:30 +02:00
Martin Pulec
d6de83ebb2 v210_to_p010le: handle irregular dimensions
handle W % 6 !=0 and H % 2 != 0

last pixels on last (2) line(s) just copy
2025-04-01 14:02:29 +02:00
Martin Pulec
6c4d62413c sdl3: support AV_PIX_FMT_P010LE
v210_to_p010le moved 1:1 to pixfmt_conv.c (with different signature)
2025-04-01 14:02:29 +02:00
Martin Pulec
1c646424b6 configure.ac: prefer 2 over 3 for now
but not if sdl2 is SDL3 sdl2_compat - this won't bring any advantage

There is still some issues with 3 that was not with v2 - see sdl3.c and
sdl_mixer.c heading. Also, there is still no stable SDL_ttf release,
and even not a preview v3 build of SDL_mixer.
2025-04-01 14:02:29 +02:00
Martin Pulec
5e643e8d49 sdl[123]: allow -d sdl[123]
a convenient module name - regiestered as a hidden module

this is now consistent with wulkan_sdl[23] that has both vulkan ahd
the vulkan_sdl[23]
2025-04-01 14:02:29 +02:00
Martin Pulec
d897709956 vulkan_sdl[23]: vulkan_display_log: fix log_level
fixed log_level shadowing

The vulkan_sdl mapped log_level shadows the global log_level variable,
so that automatic variable log_level is compared to itself (always true).
2025-04-01 14:02:28 +02:00
Martin Pulec
1a4e90996f vulkan_sdl3: pass vulkan_display_log also to :help 2025-04-01 14:02:28 +02:00
Martin Pulec
afb9c4788f vulkan_sdl3: make it work with macOS
make it work when linked with both vulkan-loader:
- set VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR
(vk::InstanceCreateFlagBits::eEnumeratePortabilityKHR) when creating
the instance

and MoltenVK:
- erase VK_KHR_portability_enumeration from required extensions that
reports SDL3 SDL_Vulkan_GetInstanceExtension() on macOS

Also now the ENUMERATE_PORTABILITY_BIT is always set whenever
VK_KHR_portability_enumeration supported.
2025-04-01 14:02:28 +02:00
Martin Pulec
1de0982bb2 vulkan_sdl3: set logging level as in vdisp/sdl3 2025-04-01 14:02:28 +02:00
Martin Pulec
bcd7688267 vulkan_sdl3: remove win32 specific code
Taken with the original code of vulkan_sdl2 but doesn't seem to be
required. It doesn't compile, either, because SDL_syswm.h is no longer
present.
2025-04-01 14:02:28 +02:00
Martin Pulec
0d3f19d2e5 sdl3: notice that driver= may change disp listing 2025-04-01 14:02:27 +02:00
Martin Pulec
94fea79318 sdl3: removed unneeded compat from SDL2 2025-04-01 14:02:27 +02:00
Martin Pulec
94517c0e83 sdl3: set SRGB for R10k
The vulkan renderer assumes HDR10, which is probably not the case.
2025-04-01 14:02:27 +02:00
Martin Pulec
35ef6f4e6b sdl3: handle eventual big-endian 2025-04-01 14:02:27 +02:00
Martin Pulec
10059f9e71 mixer+ttf compat with SDL3 2025-04-01 14:02:27 +02:00
Martin Pulec
28198b39d0 vulkan_sdl3: change branding
+ use the name "vulkan" for vulkan_sdl3 (for `-d`), also accept this
for vulkan_sdl2. This makes it easier to use `-d vulkan` regardless
SDL version
2025-04-01 14:02:26 +02:00
Martin Pulec
82ebb9a0aa vulkan_sdl3: remove config*.h includes 2025-04-01 14:02:26 +02:00
Martin Pulec
430573a82b vulkan_sdl3: rewrite the code changed with SDL 3
+ use vulkan_sdl3 if SDL3 is detected by configure.ac
2025-04-01 14:02:26 +02:00
Martin Pulec
6656db1599 copy vulkan_sdl2.cpp to vulkan_sdl3.cpp 2025-04-01 14:02:26 +02:00
Martin Pulec
00e510bbf6 sdl3: set SDL logging if UG LL > INFO 2025-04-01 14:02:26 +02:00
Martin Pulec
87bb9fc8dc sdl3: handle vulkan renderer formats
Aside of the common YUV (YV12,IYUV,NV12,NV12) supports P010, RGBA
(ARGB8888), ARGB2101010 and RGBA64_FLOAT (Linux).
2025-04-01 14:02:25 +02:00
Martin Pulec
c89d9c2c8b sdl3: r10k to argb2101010 - handle by conv
use the new API for conversions

Doesn't seem to be usable, anyways - not supported by opengl/opengles2/gpu
render nor vulkan (but this has SDL_PIXELFORMAT_ABGR2101010).
2025-04-01 14:02:25 +02:00
Martin Pulec
7420a19cc6 sdl3: handle UYVY
Since the UYVY pixel format is no longer handled if the renderer doesn't
support it, handle the conversion manually (gl_renderer doesn't handle
UYVY except of macOS neigher for SDL3 nor SDL2 - but there obviously
some convertion occured implicitly).
2025-04-01 14:02:25 +02:00
Martin Pulec
5715347b23 sdl3: present only pixfmts supported by renderer
otherwise SDL_LockTexture() would fail
2025-04-01 14:02:25 +02:00
Martin Pulec
672958618a sdl3: use RGBX for RGBA
Alpha is almost always unused by UltraGrid so avoid interpreting it as
SDL3 does.
2025-04-01 14:02:24 +02:00
Martin Pulec
040b6a9bf5 sdl3: really rewrite the incomatible sdl2 stuff
+ add to configure.ac
2025-04-01 14:02:21 +02:00
Martin Pulec
00b7c03859 SDL3: use logger prefix SDL3 instead of SDL
Both SDL1 and SDL2 use just "[SDL] ".

But SDL2 may remain default for quite a while so that I'd rather use
"[SDL3] " to discriminate the "flavor" explicitly.
2025-03-31 13:43:04 +02:00
Martin Pulec
890cd02ae1 sdl3: reindent
reindent prior to modifying the code
2025-03-31 13:43:04 +02:00
Martin Pulec
a513c18ae9 sdl3: rename symbols 2->3 2025-03-31 13:43:03 +02:00
Martin Pulec
98921e70b2 copy sdl2.c as a base for sdl3 2025-03-31 13:43:00 +02:00
Martin Pulec
7378bae7c9 unit_evaluate_dbl: fixed err check
arm64 (Apple silicon) needs the comparison with NAN with isnan().

Fixes also failing test misc_test_unit_evaluate on GH macos-14 runner
(arm64 mac),
2025-03-31 12:17:56 +02:00