710 Commits

Author SHA1 Message Date
Cameron Gutman
778eb07c5f Reject YUV444 rendering using D3D11VA until it properly supported 2024-07-26 01:19:26 -05:00
Cameron Gutman
e2ffeae3f6 Add YUV444 support to VT Metal renderer 2024-07-26 00:39:13 -05:00
Cameron Gutman
eb6d16fdcf Remove guards for older macOS and SDK versions 2024-07-26 00:38:54 -05:00
Cameron Gutman
e548697a36 Move VT decoding support detection into a single base class 2024-07-26 00:35:32 -05:00
Cameron Gutman
c707dab70a Plumb YUV444 logic into additional renderers 2024-07-25 06:36:40 -05:00
ns6089
da0244c538 Support YUV 4:4:4 formats 2024-07-24 20:54:13 -05:00
Cameron Gutman
9e92c07cb7 Use VK_NULL_HANDLE instead of nullptr to initialize VkSurfaceKHR field
Fixes #1367
2024-07-24 20:38:36 -05:00
Cameron Gutman
45ccd1a811 Add plane selection workaround for Spacemit driver bug
Expose plane bug workaround logic through new envvars:
- DRM_MIN_PLANE_ZPOS
- DRM_ALLOW_PRIMARY_PLANE
2024-07-12 19:37:56 -05:00
Cameron Gutman
52583f5c71 Consolidate decoder checks to reduce code duplication 2024-07-12 19:02:20 -05:00
Cameron Gutman
952ebcd0d2 Prefer zero-copy formats for non-hwaccel hardware decoders
SpacemiT K1's BSP has a version of FFmpeg that contains both
v4l2m2m and their own *_stcodec decoders. Not only is their
V4L2 driver for their mvx decoder seemingly totally broken
(output buffers are all zeros), but it doesn't have any of
the DRM_PRIME support work that is maintained out of tree.

The result is we use a broken copyback decoder instead of
a (mostly) working zero-copy decoder because we didn't
include any logic to rank non-hwaccel decoders by pixfmt
like we have with device type for hwaccel decoders.
2024-07-12 18:45:46 -05:00
Cameron Gutman
d5a198b764 YUV420P10 is also compatible with PlVkRenderer 2024-07-06 17:24:46 -05:00
Cameron Gutman
b5b2731d5f Add support for rendering software decoded frames with Vulkan 2024-07-06 16:49:35 -05:00
Cameron Gutman
d085722911 Don't attempt to use mismatched 8-bit formats with 10-bit codecs
In addition to silently truncating the samples, this also tickles
some nasty bugs in the VF2's out-of-tree OMX decoder.
2024-07-06 02:27:46 -05:00
Cameron Gutman
34fa7167b1 Force AV_CODEC_CAP_HARDWARE set for OMX decoders
There are at least 2 out-of-tree OMX decoder implementations
that both lack AV_CODEC_CAP_HARDWARE, so they trick us into
thinking that neither of them is hardware accelerated.

Fixes false decoder warnings when linked against the patched
FFmpeg builds shipping on VisionFive 2 and LicheePi 4A SBCs.
2024-07-05 23:04:10 -05:00
Cameron Gutman
27b173b76b Add a GenericHwAccelRenderer for unknown hwaccels
This will get us limited hardware acceleration even for hwaccels
that we don't know about yet.
2024-07-05 22:49:52 -05:00
Cameron Gutman
335ed0e8e6 Only sample directly from the video decoder output texture on Intel GPUs
This technique seems to actually make performance worse on some AMD GPUs (RX 480)
and causes rendering errors on others (HD 5570). These might be AMD-specific bugs
but let's not risk a behavior change for AMD/NVIDIA where nobody was having perf
issues with the old copy method anyway.
2024-06-29 14:44:08 -05:00
Cameron Gutman
0abb9fd7c2 Revert "Avoid using D3D11VA on older AMD TeraScale GPUs"
This reverts commit 93408386aea19ea428314e3a0621f8efc3cd8bf2.
2024-06-29 14:12:03 -05:00
Cameron Gutman
1a1ce05959 Revert "Use a Texture2DArray in HLSL to match the SRVs"
This reverts commit d389f9a6e9bc0e06dec1b299a330be0640b75652.
2024-06-29 14:07:41 -05:00
Cameron Gutman
93408386ae Avoid using D3D11VA on older AMD TeraScale GPUs 2024-06-28 20:24:47 -05:00
Cameron Gutman
415b512c75 Require FL 11.0 for the D3D11VA renderer
We would probably be okay with 10.0 (SM4), but let's not risk
encountering GPU driver bugs like we do on old AMD cards.
2024-06-28 19:56:00 -05:00
Cameron Gutman
d389f9a6e9 Use a Texture2DArray in HLSL to match the SRVs 2024-06-27 19:46:27 -05:00
Cameron Gutman
dff02eab7d Fix DrmRenderer build 2024-06-25 23:29:37 -05:00
Cameron Gutman
ecfcedad58 Fix window resizing on Windows with software decoding 2024-06-25 23:21:08 -05:00
Cameron Gutman
e76780e105 Add a new prepareToRender() callback for renders to perform their initial window clears
This consolidates all the clearing that was strewn across the codebase.
2024-06-25 23:12:18 -05:00
Cameron Gutman
a9d7c8e495 Move forced KMSDRM modesetting operation into Session init code
Performing this each time DrmRenderer is initialized leads to long
delays when choosing a decoder on embedded platforms, particularly
those like TH1520/JH7110 which lack accelerated GL drivers.
2024-06-25 21:57:02 -05:00
Cameron Gutman
ac0e1098b9 Take COLOR_ENCODING values into account when choosing a colorspace
Replace the generic starfive hack with proper logic to examine the
supported enum values to select a colorspace. This fixes incorrect
colors with vs-drm on the TH1520.
2024-06-23 19:33:37 -05:00
Cameron Gutman
35695642d5 Use the first available plane that meets the zpos requirement
Planes seem to be listed in descending order of capabilities
with later planes sometimes lacking scaling capabilities, which
is the case with vs-drm on the TH1520.
2024-06-23 19:03:35 -05:00
Cameron Gutman
e458682a23 Refactor plane property loop to avoid leak 2024-06-23 18:13:20 -05:00
Cameron Gutman
0f57abf6f8 Don't select an overlay plane with a lower zpos than the primary plane 2024-06-23 17:55:27 -05:00
Cameron Gutman
94943d2865 Clamp chroma texcoords to avoid sampling alignment padding
This resolves #885 without the massive perf hit on lower end Intel GPUs.
2024-06-22 16:19:26 -05:00
Cameron Gutman
c3bd7edc4e Revert "Use a separate texture for rendering to avoid blending in the alignment padding"
This kills performance on some Intel iGPUs (particularly Atom chips like N100),
so let's remove the copy and solve this issue a different way instead.

This reverts commit a6fccf93d149a8b67eeac0b0fe109a142f0937d8.
2024-06-22 12:35:00 -05:00
Cameron Gutman
b6bb96223d Revert "Remove manual hwframe ctx setup for D3D11VA"
We need this back to avoid the copy that's tanking performance on Intel iGPUs.

This reverts commit 2cef09471b80d46ea3b59a936494a44a68ad5d67.
2024-06-22 12:34:10 -05:00
Cameron Gutman
d3219ae24a Don't use VAAPI fallback driver names on libva 2.20+
libva 2.20 is good enough at detecting driver names (even under XWayland)
that we don't need to use the fallback name list anymore. This saves time
probing drivers, avoids excessive log output from failed probes, and avoids
tickling bugs in VAAPI drivers that are installed but unused.
2024-06-18 00:31:59 -05:00
Cameron Gutman
bd60b873ec Add missing check for no Vulkan devices 2024-06-18 00:12:08 -05:00
Cameron Gutman
17af71fe7a Allow the Vulkan renderer to accept HDR input even without HDR output capability
In addition to resolving issues with mixing HDR and SDR displays and moving
between them while streaming, it also allows streaming HDR content to an SDR
display with tone mapping handled transparently by libplacebo.
2024-06-09 15:00:56 -05:00
Cameron Gutman
ec7137e693 Flush window events in MMAL and DRM renderers 2024-06-09 14:26:26 -05:00
Cameron Gutman
e67d83e097 Move declaration under ifdef to eliminate unused variable warning 2024-05-25 17:01:46 -05:00
Cameron Gutman
4474f815af Only use fallback VDPAU/VAAPI driver paths on AppImages
Native packages and Flatpak/Snap packages both have properly set
driver path values embedded in libva.so/libvdpau.so. Let's not go
splunking for drivers in random folders on those systems.
2024-05-25 14:39:09 -05:00
Cameron Gutman
e130a15037 Remove dependency on AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES for VDPAU wrapper identification
These quirks may be deprecated and no longer populated in an upcoming FFmpeg version.
2024-05-25 14:24:31 -05:00
Cameron Gutman
845ef147c9 Add new libva driver path values for Fedora 40 2024-05-25 14:22:43 -05:00
Dylan Frankcom
58e27875ae
Fix Raised Black Levels on Steam Deck OLED (#1265)
Add getDecoderColorRange to plvk
2024-04-30 20:31:00 -05:00
Cameron Gutman
4aa2b8570c Autorelease the system default Metal device 2024-04-19 00:29:51 -05:00
Cameron Gutman
fe6562e31c Allow forcing Metal renderer on or off via VT_FORCE_METAL=1 and VT_FORCE_METAL=0 respectively 2024-04-19 00:27:45 -05:00
Cameron Gutman
654e386263 Only pace presentation if display sync is enabled 2024-04-19 00:17:13 -05:00
Cameron Gutman
76d0eb6b63 Avoid trying VDPAU when Vulkan is preferred
The VDPAU renderer causes interoperability issues with Vulkan.
2024-04-18 00:41:24 -05:00
Cameron Gutman
5e46c4ec2b Update Windows and Mac prebuilt libraries
SDL2 -> 1fa6142
FFmpeg -> 7.0
opus -> 1.5.1
dav1d -> 1.4.1
2024-04-06 19:56:38 -05:00
Cameron Gutman
fd2ff61a40 Support Vulkan AV1 decoding with FFmpeg 7.0 2024-04-06 12:31:14 -05:00
Cameron Gutman
f2535f1e6e Avoid D3D9 fallback on lack of codec support unless a D3D11 FL11.0 GPU wasn't found
We'd rather not waste time (and risk crashes) loading the D3D9 driver if the GPU doesn't have the physical decoding hardware at all.
2024-03-26 23:59:18 -05:00
Cameron Gutman
cefa567f95 Demote DXVA2 renderer to second pass of hwaccels 2024-03-26 23:04:54 -05:00
Cameron Gutman
97bd515b11 Remove leftover preferred Metal device logic 2024-03-26 01:16:57 -05:00