Commit Graph

34 Commits

Author SHA1 Message Date
Cameron Gutman 30274f3ae8 Don't keep the dummy renderer alive for EGLRenderer's lifetime
At best, it doesn't do anything other than some queue some viewport
changes via SDL_RendererEventWatch(). At worst, it can race with
the render thread and cause trouble.
2026-01-17 01:06:41 -06:00
Cameron Gutman 9ffe5218d5 Hoist the logic to keep an AVFrame reference up to Pacer 2026-01-07 17:50:43 -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 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 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 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 fd70865026 Avoid retrying renderer init if we know the error was not transient 2025-02-18 19:02:12 -06:00
Cameron Gutman 96fb6ee5e9 Share SDL's EGL display with EGLRenderer
Fixes #1396
2024-09-12 22:37:25 -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 2a05b890d8 Enable transparent resizing and display changes for supported renderers 2023-12-17 21:15:40 -06:00
Cameron Gutman 481f23b6e9 Remove some dependencies on fixed window and frame sizes 2023-12-17 20:39:26 -06:00
Cameron Gutman 68c6d6c932 Attempt to fix build with SDL 2.26 on systems with old GL headers 2022-11-21 20:32:10 -06:00
Cameron Gutman e3a7b54f90 Use EGL fences to reduce video latency 2022-04-08 19:28:22 -05:00
Cameron Gutman 474591c6a5 Use a separate callback to indicate EOS instead of renderFrame() 2022-04-07 21:30:20 -05:00
Cameron Gutman 2fc1dda232 Partially revert e64b15d and b85d5b8
These changes cause excessive window recreation using the Flatpak on Nvidia with Wayland
2022-03-19 14:50:38 -05:00
Cameron Gutman 3fcf31d009 Improve robustness of EGL retry logic for 10-bit color 2022-01-29 01:12:38 -06:00
Cameron Gutman b85d5b8822 Enable P010 surface export from VAAPI to EGL 2022-01-23 18:33:30 -06:00
Cameron Gutman dd941154d6 Fix EGL renderer overlay rendering with SDL_ttf 2.0.18
Fixes #721
2022-01-20 18:02:44 -06:00
Cameron Gutman 2959faca0c Fix colorspace transitions in EGLRenderer 2021-11-19 00:54:59 -06:00
Cameron Gutman 43e3679297 Revert "Disable the EGL render thread on Wayland"
This reverts commit dcc567ebda.
2021-11-15 21:33:28 -06:00
Cameron Gutman dcc567ebda Disable the EGL render thread on Wayland 2021-07-31 17:24:18 -05:00
Cameron Gutman e74753bec1 Allow fallback from EGL to direct on EGLImage export failure 2021-03-22 22:51:29 -05:00
Cameron Gutman 26d04b5f9c Render DRM-PRIME frames as opaque images
We can't always assume they are NV12. Even if they _are_ NV12,
they may have DRM format modifiers that are incompatible with
simply assuming linear Y and UV buffers (such as tiling).
2021-03-21 23:23:12 -05:00
Cameron Gutman a0b9684504 Continue refactoring for non-NV12 support in EGLRenderer 2021-03-21 21:43:57 -05:00
Cameron Gutman d33ccce683 Hold a reference to the underlying DMA-BUFs until the next frame 2021-03-07 12:01:25 -06:00
Cameron Gutman c3895f06c0 Fix handling of preferred/compatible pixel formats with EGLRenderer and VAAPI/DRM backends 2021-02-04 19:39:18 -06:00
Cameron Gutman e5bcc793e5 Implement overlay support in EGLRenderer
Fixes #405
2020-12-19 23:01:41 -06:00
Cameron Gutman 2f3a1a5d79 Work around bug where GLES surface creation repeatedly fails on X11 2020-09-07 23:53:29 -07:00
Cameron Gutman 994312c212 Force GL to block after the current frame instead during the next frame 2020-05-16 16:25:13 -07:00
Cameron Gutman ed128c558f Add support for EGLRenderer on EGL 1.4 2020-05-16 12:13:00 -07:00
Cameron Gutman 42ced309d3 Restore the original GL attributes after EGLRenderer is destroyed 2020-05-15 20:22:11 -07:00
Cameron Gutman 26c9ad7f06 Use eglGetProcAddress() for all GLES 2.0 extensions 2020-05-15 19:39:41 -07:00
Cameron Gutman eb9e1f81d4 Enable the EGLRenderer to use the render thread 2020-05-13 19:09:20 -07:00
Antoine Damhet 0a396f3112 Introduce a new FFMPEG frontend renderer: EGLRenderer
Right now this renderer works on X11 & Wayland with VAAPI as a backend.

Some rendering latency benchmarks on my `i7-10510U` (with
`intel-media-driver` 20.1.1 which cause a *huge* regression with the
SDL_Renderer):
|             | X11    | Wayland |
| Before      | 6.78ms | 22.50ms |
| EGLRenderer | 0.76ms | 00.77ms |

Signed-off-by: Antoine Damhet <antoine.damhet@lse.epita.fr>
2020-05-12 11:11:35 +02:00