Skip to content

gl: report views from init, not from the first frame - #19953

Merged
LibretroAdmin merged 1 commit into
libretro:masterfrom
Davey-Hughes:gl2-views-init
Nov 4, 2026
Merged

LibretroAdmin merged 1 commit into
libretro:masterfrom
Davey-Hughes:gl2-views-init

Conversation

@Davey-Hughes

Copy link
Copy Markdown
Contributor

Guidelines

  1. Rebase before opening a pull request
  2. If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
  3. If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises
  4. RetroArch codebase follows C89 coding rules for portability across many old platforms check using C89_BUILD=1

Description

What it does

  • gl2 now says whether it can draw views from its init, as vulkan does. Before, it said so only from gl2_frame(), so a new gl2 reported no views until it had drawn a frame.
  • At content start and after each video driver reinit, a core asking RETRO_ENVIRONMENT_GET_VIDEO_VIEWS_STATUS on its first retro_run() was told views are neither presented nor stereo. That frame was also not laid out as views. On gl the user saw one frame of the core's own layout, or of its packed frame shown whole. vulkan was not affected.

Tested

  • New threaded_video lane on the gl driver: it reads the views flag right after a reinit and again after two frames. On master it fails with views 0 from init, 1 after a frame. With the fix it passes, on Linux (llvmpipe under Xvfb) and in a mingw-w64 build under Wine.
  • Linux builds with and without threads, and C89_BUILD=1 on gl2.o.
  • The CI jobs that cover these two files, run locally with tools/ci_local.py in an Ubuntu 24.04 image, all pass: gl-harness (every api and sanitizer entry), the vulkan validation, ASan, TSan and OpenXR harnesses, menu-harness, pace-shadow, tsan-harness, vulkan-resize, egl-hw-core, overlay-on-screen, samples-gfx, slang-last-pass-target, windows-wine-menu and compile-matrix.

Related Issues

[Any issues this pull request may be addressing]

Related Pull Requests

[Any other PRs from related repositories that might be needed for this pull request to work]

Reviewers

[If possible @mention all the people that should review your pull request]

gl2 published whether it can draw views only from gl2_frame(), so
until its first frame it reported none. At content start and after
each video driver reinit, a core asking for the views status on its
first retro_run() was told views are neither presented nor stereo,
and that frame was not laid out as views: one frame of the core's
own layout, or of its packed frame shown whole.

gl2 now publishes it at init, as vulkan does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants