mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 11:30:11 +01:00
egl: add automatic zink fallback loading between hw and sw drivers
if loading the default hardware driver fails, implicitly loading zink should now be preferable to hitting the software fallback now that zink has all the same capabilities Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
This commit is contained in:
parent
cedb534a17
commit
8cd44b8843
1 changed files with 11 additions and 4 deletions
|
|
@ -695,10 +695,17 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
|
|||
if (disp->Options.ForceSoftware)
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
else {
|
||||
disp->Options.Zink = EGL_FALSE;
|
||||
disp->Options.ForceSoftware = EGL_TRUE;
|
||||
if (!_eglDriver.Initialize(disp))
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
bool success = disp->Options.Zink;
|
||||
if (!disp->Options.Zink && !getenv("GALLIUM_DRIVER")) {
|
||||
disp->Options.Zink = EGL_TRUE;
|
||||
success = _eglDriver.Initialize(disp);
|
||||
}
|
||||
if (!success) {
|
||||
disp->Options.Zink = EGL_FALSE;
|
||||
disp->Options.ForceSoftware = EGL_TRUE;
|
||||
if (!_eglDriver.Initialize(disp))
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue