mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
egl: Don't try to dereference native displays unless there's a detectable platform
Not all native displays are pointers to dereferenceable memory, e.g. DCs on Windows. Don't bother dereferencing if no platforms are available that can be detected that way. Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed By: Bill Kristiansen <billkris@microsoft.com> Acked-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
This commit is contained in:
parent
eb7d150743
commit
58389dd55f
1 changed files with 2 additions and 2 deletions
|
|
@ -128,11 +128,10 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
|
|||
if (nativeDisplay == EGL_DEFAULT_DISPLAY)
|
||||
return _EGL_INVALID_PLATFORM;
|
||||
|
||||
#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM)
|
||||
if (_eglPointerIsDereferencable(nativeDisplay)) {
|
||||
void *first_pointer = *(void **) nativeDisplay;
|
||||
|
||||
(void) first_pointer; /* silence unused var warning */
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
/* wl_display is a wl_proxy, which is a wl_object.
|
||||
* wl_object's first element points to the interfacetype. */
|
||||
|
|
@ -146,6 +145,7 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
|
|||
return _EGL_PLATFORM_DRM;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
return _EGL_INVALID_PLATFORM;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue