GNOME Bugzilla – Bug 694537
Fails to compile if the EGL stack doesn't implement KHR_create_context
Last modified: 2013-11-27 20:44:35 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)
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?
The patch looks good to land to me even without waiting for verification.
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]
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>