vo_gpu_next: only re-upload OSD textures when they change - #18352
Open
rlauuzo wants to merge 1 commit into
Open
Conversation
rlauuzo
force-pushed
the
osd-upload-cache
branch
from
August 14, 2026 06:14
15ff0f4 to
e6ecea9
Compare
update_overlays() uploaded every sub_bitmaps item to its texture on every call, and draw_frame() calls it unconditionally, so an OSD that was not changing got re-uploaded at the display refresh rate rather than at the rate it actually changed. vo_gpu already avoids this: gen_osd_cb() compares sub_bitmaps.change_id against a cached copy and skips upload_osd() when they match. osd_render() computes that change_id for both VOs, so vo_gpu_next had the information and did not read it. Cache the id next to the texture and skip pl_tex_upload() when it matches. Also restrict pl_tex_recreate() to the cases where the size or format has to change. The cache requires this, because pl_tex_recreate() invalidates the texture even when it keeps it, and the cached id would then describe contents that are no longer defined.
rlauuzo
force-pushed
the
osd-upload-cache
branch
from
August 18, 2026 15:15
e6ecea9 to
62146ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update_overlays() uploaded every sub_bitmaps item to its texture on
every call, and draw_frame() calls it unconditionally, so an OSD that
was not changing got re-uploaded at the display refresh rate rather
than at the rate it actually changed.
vo_gpu already avoids this: gen_osd_cb() compares sub_bitmaps.change_id
against a cached copy and skips upload_osd() when they match.
osd_render() computes that change_id for both VOs, so vo_gpu_next had
the information and did not read it. Cache the id next to the texture
and skip pl_tex_upload() when it matches.
Also restrict pl_tex_recreate() to the cases where the size or format
has to change. The cache requires this, because pl_tex_recreate()
invalidates the texture even when it keeps it, and the cached id would
then describe contents that are no longer defined.
AI Disclosure: The patch was written with AI assistance. I understand
what it does and why. The change is submitted under the same
licence as
video/out/vo_gpu_next.c(LGPLv2.1+).