Fix GLES compatibility check on VF2 pvr driver
This commit is contained in:
parent
7edbede95d
commit
741e360024
1 changed files with 12 additions and 2 deletions
14
app/wm.cpp
14
app/wm.cpp
|
|
@ -24,6 +24,10 @@
|
||||||
#ifndef EGL_PLATFORM_X11_KHR
|
#ifndef EGL_PLATFORM_X11_KHR
|
||||||
#define EGL_PLATFORM_X11_KHR 0x31D5
|
#define EGL_PLATFORM_X11_KHR 0x31D5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EGL_PLATFORM_GBM_KHR
|
||||||
|
#define EGL_PLATFORM_GBM_KHR 0x31D7
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VALUE_SET 0x01
|
#define VALUE_SET 0x01
|
||||||
|
|
@ -96,9 +100,15 @@ bool WMUtils::supportsDesktopGLWithEGL()
|
||||||
// If the value is not set yet, populate it now.
|
// If the value is not set yet, populate it now.
|
||||||
int val = SDL_AtomicGet(&supportsDesktopGL);
|
int val = SDL_AtomicGet(&supportsDesktopGL);
|
||||||
if (!(val & VALUE_SET)) {
|
if (!(val & VALUE_SET)) {
|
||||||
bool desktopGL = false;
|
// Assume it does if we can't confirm
|
||||||
|
bool desktopGL = true;
|
||||||
|
|
||||||
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
// Prefer GBM as some drivers (pvr) use swrast/llvmpipe for X11/XWayland,
|
||||||
|
// so we'll get a different (and incorrect) result if we query X11.
|
||||||
|
EGLDisplay display = eglGetPlatformDisplay(EGL_PLATFORM_GBM_KHR, EGL_DEFAULT_DISPLAY, nullptr);
|
||||||
|
if (display == EGL_NO_DISPLAY) {
|
||||||
|
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
|
}
|
||||||
if (display != EGL_NO_DISPLAY && eglInitialize(display, nullptr, nullptr)) {
|
if (display != EGL_NO_DISPLAY && eglInitialize(display, nullptr, nullptr)) {
|
||||||
EGLint matchingConfigs = 0;
|
EGLint matchingConfigs = 0;
|
||||||
EGLint const attribs[] =
|
EGLint const attribs[] =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue