After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694537 - Fails to compile if the EGL stack doesn't implement KHR_create_context
Fails to compile if the EGL stack doesn't implement KHR_create_context
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: EGL
1.13.x
Other Linux
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-23 16:28 UTC by Sjoerd Simons
Modified: 2013-11-27 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
egl: define missing EGL_KHR_create_context enums (1.30 KB, patch)
2013-02-27 15:30 UTC, Robert Bragg
accepted-commit_now Details | Review

Description Sjoerd Simons 2013-02-23 16:28:54 UTC
Building cogl 1.13 with EGL against mesa 8.0 fails due to unconditionally using defines only available if the stack implements KHR_create_context (which mesa only does since 9.0)

Compiler error below:

./winsys/cogl-winsys-egl.c: In function 'try_create_context':
./winsys/cogl-winsys-egl.c:360:20: error: 'EGL_CONTEXT_MAJOR_VERSION_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c:360:20: note: each undeclared identifier is reported only once for each function it appears in
./winsys/cogl-winsys-egl.c:362:20: error: 'EGL_CONTEXT_MINOR_VERSION_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c:364:20: error: 'EGL_CONTEXT_FLAGS_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c:365:20: error: 'EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c:366:20: error: 'EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c:367:20: error: 'EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR' undeclared (first use in this function)
Comment 1 Robert Bragg 2013-02-27 15:30:26 UTC
Created attachment 237526 [details] [review]
egl: define missing EGL_KHR_create_context enums

I've attached a patch that I think should fix this; maybe you can verify that it fixes your build?
Comment 2 Neil Roberts 2013-03-04 18:59:25 UTC
The patch looks good to land to me even without waiting for verification.
Comment 3 Sjoerd Simons 2013-03-05 21:52:44 UTC
Sorry for the slow reply, with the patch:

./winsys/cogl-winsys-egl.c: In function 'try_create_context':
./winsys/cogl-winsys-egl.c:375:20: error: 'EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c:375:20: note: each undeclared identifier is reported only once for each function it appears in
./winsys/cogl-winsys-egl.c:377:20: error: 'EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR' undeclared (first use in this function)
./winsys/cogl-winsys-egl.c: In function '_cogl_winsys_display_destroy':
./winsys/cogl-winsys-egl.c:420:19: warning: unused variable 'egl_display' [-Wunused-variable]
./winsys/cogl-winsys-egl.c: In function '_cogl_winsys_destroy_gles2_context':
./winsys/cogl-winsys-egl.c:564:19: warning: unused variable 'egl_display' [-Wunused-variable]
./winsys/cogl-winsys-egl.c: In function '_cogl_winsys_onscreen_init':
./winsys/cogl-winsys-egl.c:581:19: warning: unused variable 'egl_display' [-Wunused-variable]
Comment 4 Robert Bragg 2013-11-27 20:44:35 UTC
Just realised we didn't close this bug when we landed a fix:

commit bd034b7451e7d9c602bcc91f1a00f6aaa7b05ec0
Author: Robert Bragg <robert@linux.intel.com>
Date:   Wed Feb 27 15:22:59 2013 +0000

    egl: define missing EGL_KHR_create_context enums
    
    This makes sure the EGL_KHR_create_context enums are always defined in
    cogl-winsys-egl.c so we will build with drivers that don't support this
    extension. Cogl will do runtime checks to explicitly check that the
    extension is available before ever referencing these enums so this is
    safe to do.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694537
    
    Reviewed-by: Neil Roberts <neil@linux.intel.com>