[Webkit-unassigned] [Bug 197971] GLContextEGL should check the supported EGL version at compile time

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 20 05:17:24 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=197971

--- Comment #12 from Adrian Perez <aperez at igalia.com> ---
(In reply to Michael Catanzaro from comment #11)
> Mads, can you copy/paste the build error you are seeing please?

OK, I have been investigating a bit about this: in EGL version 1.5
the extension EGL_KHR_create_context is built-in, but headers for
*older* versions of EGL will not have defined the constants which
were added in 1.5 and that is likely the cause for the compilation
failure, checking the EGL 1.4 spec [1]:

 - EGL_CONTEXT_MAJOR_VERSION was EGL_CONTEXT_CLIENT_VERSION in EGL <1.5
 - EGL_CONTEXT_MINOR_VERSION was not defined prior to EGL 1.5

I would do something like the following instead, because the constant
values for the macros above are set on stone in the spec and official
headers:


  // The EGL headers being used may not include version 1.5 symbols,
  // so we define here the ones we need, which will be used *only*
  // if the EGL version detected at runtime is 1.5 or newer. Values
  // taken from the official headers as published by Khronos, see:
  //
  // https://www.khronos.org/registry/EGL/api/EGL/egl.h

  #ifndef EGL_CONTEXT_MAJOR_VERSION
  #define EGL_CONTEXT_MAJOR_VERSION 0x3098
  #endif
  #ifndef EGL_CONTEXT_MINOR_VERSION
  #define EGL_CONTEXT_MINOR_VERSION 0x30FB
  #endif

  // ...

  if (platformDisplay.eglCheckVersion(1, 5) {
      contextAttributes[0] = EGL_CONTEXT_MAJOR_VERSION;
      contextAttributes[1] = 3;
      contextAttributes[2] = EGL_CONTEXT_MINOR_VERSION;
      // ...and so on, no #ifdefs needed here.
  }

---
[1] https://www.khronos.org/registry/EGL/specs/eglspec.1.5.withchanges.pdf

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190520/20c1b33b/attachment.html>


More information about the webkit-unassigned mailing list