mirror of https://github.com/mpv-player/mpv
vo_opengl: EGL: fix hwdec probing
If ANGLE was probed before (but rejected), the ANGLE API can remain "initialized", and eglGetCurrentDisplay() will return a non-NULL EGLDisplay. Then if a native GL context is used, the ANGLE/EGL API will then (apparently) keep working alongside native OpenGL API. Since GL objects are just numbers, they'll simply fail to interact, and OpenGL will get invalid textures. For some reason this will result in black textures. With VAAPI-EGL, something similar could happen in theory, but didn't in practice.
This commit is contained in:
parent
e5e1088c92
commit
f56555b514
|
@ -116,6 +116,9 @@ static int create(struct gl_hwdec *hw)
|
|||
if (!egl_display)
|
||||
return -1;
|
||||
|
||||
if (!eglGetCurrentContext())
|
||||
return -1;
|
||||
|
||||
const char *exts = eglQueryString(egl_display, EGL_EXTENSIONS);
|
||||
if (!exts || !strstr(exts, "EGL_ANGLE_d3d_share_handle_client_buffer") ||
|
||||
!strstr(exts, "EGL_EXT_device_query"))
|
||||
|
|
|
@ -99,6 +99,9 @@ static int create(struct gl_hwdec *hw)
|
|||
if (!egl_display)
|
||||
return -1;
|
||||
|
||||
if (!eglGetCurrentContext())
|
||||
return -1;
|
||||
|
||||
const char *exts = eglQueryString(egl_display, EGL_EXTENSIONS);
|
||||
if (!exts ||
|
||||
!strstr(exts, "EGL_ANGLE_d3d_share_handle_client_buffer")) {
|
||||
|
|
|
@ -183,7 +183,7 @@ static int create(struct gl_hwdec *hw)
|
|||
|
||||
if (hw->hwctx)
|
||||
return -1;
|
||||
if (!eglGetCurrentDisplay())
|
||||
if (!eglGetCurrentContext())
|
||||
return -1;
|
||||
|
||||
const char *exts = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS);
|
||||
|
|
Loading…
Reference in New Issue