Fix threaded video shader-backend detection (black screen / crash on glcore)#19092
Merged
LibretroAdmin merged 1 commit intoJun 6, 2026
Conversation
…o shader-backend detection resolves the wrapped driver ident
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.
Description
With
video_threaded = true, theglcoredriver fails to create its slang filter chain, resulting in a black screen (audio only). On some platforms (e.g. H700) this crashes with a SIGSEGV in the video thread:gl3_get_fallback_shader_type()queries the context driver's advertised shader flags, which (e.g. ingfx_ctx_wl_get_flags) gate onvideo_driver_get_ident()matching glcore.In
video_init_thread(), current_video is repointed to the thread wrapper before the underlying driver'sinit()runs, butVIDEO_FLAG_THREAD_WRAPPER_ACTIVEis only set afterinit()completes. During that window the underlyinggl3_init()runs on the worker thread and callsvideo_driver_get_ident(), which — with the flag still unset — resolves to the wrapper's ident Thread wrapper instead of the wrapped driver glcore.As a result the slang backend is not detected,
gl3_get_fallback_shader_type()returnsRARCH_SHADER_NONE, and no filter chain is ever created (filter_chainandfilter_chain_defaultboth NULL), whichgl3_frame()then dereferences. In non-threaded mode current_video is the real driver at init time, so it works.Related Pull Requests
The change was introduced by #18151, which made glcore shader-backend selection depend on the context-driver ident.