Commit Graph

650 Commits

Author SHA1 Message Date
Cameron Gutman
93dc6d6b60 Convert Metal shaders to FP16 2025-12-29 01:45:49 -06:00
Cameron Gutman
3e5aa9b127 Simplify EGLImageFactory and remove caching logic for now
The platforms that would most benefit (embedded V4L2 decoders)
either don't use frame pooling or don't synchronize with
modified DMA-BUFs unless eglCreateImage() is called each time.
2025-12-28 17:54:31 -06:00
Cameron Gutman
085480e9f4 Add EGLImage caching to improve performance 2025-12-28 17:08:45 -06:00
Cameron Gutman
c3ce0918b3 Optimize blending in DXVA2 and D3D11VA renderers 2025-12-28 13:53:13 -06:00
Cameron Gutman
c5b7a9c679 Optimize EGLRenderer with overlay VAOs and reduced GL_BLEND usage 2025-12-28 13:14:16 -06:00
Cameron Gutman
f1451a0db3 Fix UB due to missing shader attribute location binding
Mesa drivers seem to generally bind attributes in order, but the
proprietary PowerVR driver (pvr) doesn't and renders incorrectly
as a result.
2025-12-27 23:56:17 -06:00
Cameron Gutman
8a5f34fb01 Remove logic to force the OpenGL ES library to load
This isn't necessary now that we turn on EGL everywhere,
and it breaks OpenGL ES 2.0 support too.
2025-12-27 23:11:53 -06:00
Cameron Gutman
d1f43ca258 Use ESSL 1.0 for EGLRenderer shaders
We still ostensibly support GLES 2.0 GPUs.
2025-12-27 22:56:20 -06:00
Cameron Gutman
4f08d52754 Enable DRM_PRIME frames for the TH1520 2025-12-27 15:40:59 -06:00
Cameron Gutman
41ad3c0938 Add environment variable override helper function
This allows FORCE_QT_GLES and SEPARATE_TEST_DECODER to override both true and false.
2025-12-27 15:33:39 -06:00
Cameron Gutman
a6f8901a18 Reuse the test decoder to improve startup performance 2025-12-23 00:32:36 -06:00
Cameron Gutman
d501a627f0 Test all renderers before use
Every renderer except SDL had opted-in for testing due to various
quirks discovered over the years, so just do away with this option
and test all renderers.
2025-12-22 23:58:26 -06:00
Cameron Gutman
3425fec33d Use EGL+GLES workaround for Nvidia X11
We can avoid disabling EGL entirely by forcing Qt to use GLES,
which is not impacted by the black window issue. This lets us
simplify back to EGL everywhere.
2025-12-14 16:21:32 -06:00
Cameron Gutman
de844f2a0c Deprioritize the Nvidia VAAPI driver if Vulkan or CUDA are available 2025-12-11 20:13:14 -06:00
Cameron Gutman
54163e30d0 Disable EGL on Nvidia XWayland environments too
It renders a black window, just like native X11.
2025-12-11 20:13:14 -06:00
Cameron Gutman
9c6d2bab19 Use EGL_VENDOR instead of NV-CONTROL for Nvidia detection
The latter will still match on a hybrid system when the iGPU's EGL
implementation is in use. This scenario works properly with EGL
rendering in Qt and SDL, so we want to allow that.
2025-12-06 11:20:03 -06:00
Cameron Gutman
c92dc2495e Don't use vaPutSurface() if there are no valid subpicture formats 2025-12-05 23:52:41 -06:00
Cameron Gutman
1c24aada0a Never use X11 EGL on Nvidia proprietary drivers
Fixes #1751
2025-12-05 23:10:31 -06:00
Cameron Gutman
58f9b2a83b Use opaque black in ClearRenderTargetView()
Intel's old Gen9 performance guide says it's a little faster.
2025-12-01 22:39:28 -06:00
Cameron Gutman
d3c23b55dc Disable the VAAPI RFI latency workaround by default
I can no longer reproduce this issue on the same system running
Ubuntu 24.04 with the core22-based edge channel snap anymore.
2025-11-30 22:23:09 -06:00
Cameron Gutman
f0821d9543 Use D3D11_COPY_DISCARD when updating our video texture
This ensures the driver knows it doesn't have to synchronize with the previous texture data.
2025-11-24 18:49:19 -06:00
Cameron Gutman
4164a222ae Consolidate D3D11 constant buffers now that all shaders need a CSC constant buffer 2025-11-24 18:47:14 -06:00
Cameron Gutman
245cd7f1a8 Don't trim the alignment padding with CopySubresourceRegion()
The shader already handles trimming for the bound output texture case.
2025-11-24 01:44:51 -06:00
Cameron Gutman
f5ef201905 Create a separate X11 Display object for libva
Sharing these directly is fraught with concurrency issues that
require extreme care on both sides to avoid spurious X11 errors,
hangs, and other nasty stuff. We can't necessarily depend on SDL,
libva, or the underlying VA drivers to do the right thing here.

Using a new Display (as FFmpeg does for VAAPI and VDPAU) avoids
all these problems.
2025-11-23 13:26:46 -06:00
Cameron Gutman
01288be937 Use the same X display name for VDPAU that SDL is using 2025-11-23 13:20:36 -06:00
Andy Grundman
66b96e75af Convert all time-based stats to be microsecond-based, improving accuracy of very fast events. Add bitrate average/peak. 2025-11-15 12:17:59 -06:00
Cameron Gutman
8324f61db0 Reduce per-frame GL calls in EGLRenderer
Uniforms are attached to the program object, so they don't need to
be set each time we swap between the YUV shader and the overlay
shader.

Since 0 overlays is by far the most common case and > 1 is highly
unlikely, move the glViewport() call into renderOverlay() to let
us skip it in the common case (and be no worse than today in the
2nd most common case of 1 overlay).
2025-11-06 17:52:30 -06:00
Cameron Gutman
a2670dd568 Use hasFrameFormatChanged() in DRMRenderer 2025-11-06 00:04:08 -06:00
Cameron Gutman
c54e6e4459 Use hasFrameFormatChanged() in VDPAU 2025-11-05 23:58:51 -06:00
Cameron Gutman
dd6f1c5873 Use hasFrameFormatChanged() in SDLRenderer 2025-11-05 23:51:51 -06:00
Cameron Gutman
7fab5007a8 Switch Metal to the shared functions for CSC matrix generation and chroma co-siting 2025-11-05 23:22:15 -06:00
Cameron Gutman
7f7cc89e61 Switch EGLRenderer to the shared functions for CSC matrix generation and chroma co-siting 2025-11-05 22:27:31 -06:00
Cameron Gutman
7116efd8de Switch D3D11VA to the shared functions for CSC matrix generation and chroma co-siting 2025-11-05 22:26:27 -06:00
Cameron Gutman
229f5e4cea Add functions for color matrix generation and chroma co-siting in the renderer interface 2025-11-05 21:59:13 -06:00
ns6089
af37002a60 Select correct color matrix for 10-bit SDR 2025-11-05 00:13:25 -06:00
Cameron Gutman
181dba5864 Use correct chroma co-siting offsets in Metal 2025-11-04 23:51:39 -06:00
ns6089
fd314db27e Use correct chroma co-siting offsets in D3D11
Introduced in f67272b153
2025-11-04 23:50:27 -06:00
Cameron Gutman
f67272b153 Handle chroma co-siting in the D3D11 shaders 2025-11-01 22:42:51 -05:00
Cameron Gutman
9b3050514b Handle chroma co-siting in the Metal shaders 2025-11-01 21:57:13 -05:00
Cameron Gutman
2c12ad297f Fix accuracy issues in YUV to RGB conversion of 10-bit content in Metal
See #1667 for details.
2025-11-01 19:19:19 -05:00
Cameron Gutman
50223dbdb8 Fix accuracy issues in YUV to RGB conversion of 10-bit content in D3D11VA
See #1667 for details.
2025-11-01 18:45:02 -05:00
Cameron Gutman
ccaca68570 Don't use CAMetalDisplayLink on Intel Macs
When in Direct mode, skipping a frame will cause the display to flash black on Tahoe.
2025-10-23 21:16:53 -05:00
Cameron Gutman
57db20016a Rewrite frame pacing mechanism for VTMetalRenderer
This should hopefully improve performance and avoid performance issues on Tahoe.
2025-10-23 19:43:10 -05:00
Cameron Gutman
200cab9d17 Attach EDR metadata to Metal layer
This improves the accuracy of HDR streaming and enables HDR->SDR tonemapping.
2025-10-20 22:28:27 -05:00
Cameron Gutman
a20d429bc1 Remove usage of deprecated Metal API 2025-10-11 11:41:28 -05:00
armin-25689
1fd545ae1f build: fix no <linux/dma-buf.h> for BSDs 2025-08-31 15:05:03 -05:00
Cameron Gutman
bf51577787 Fix macOS build 2025-02-18 19:52:33 -06:00
Cameron Gutman
fd70865026 Avoid retrying renderer init if we know the error was not transient 2025-02-18 19:02:12 -06:00
Cameron Gutman
351aaa6759 Add an enum type for each renderer 2025-02-18 18:58:04 -06:00
Cameron Gutman
dd2a99a96b Prepare for SDL3 support 2025-01-25 16:20:20 -06:00