The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/client: Add some sanity checking and debug print OpenGL information

+35
+35
src/xrt/compositor/client/comp_egl_client.c
··· 330 330 return XRT_ERROR_OPENGL; 331 331 } 332 332 333 + 334 + /* 335 + * Some sanity checking. 336 + */ 337 + 338 + if (glGetString == NULL) { 339 + EGL_ERROR("glGetString not loaded!"); 340 + restore_context(&old); 341 + return XRT_ERROR_OPENGL; 342 + } 343 + 344 + EGL_DEBUG("EGL made context:\n\tGL_VERSION: %s\n\tGL_RENDERER: %s\n\tGL_VENDOR: %s", // 345 + glGetString(GL_VERSION), glGetString(GL_RENDERER), glGetString(GL_VENDOR)); 346 + 347 + /* 348 + * If a renderer is old enough to not support OpenGL(ES) 3 or above 349 + * it won't support Monado at all, it's not a hard requirement and 350 + * lets us detect weird errors early on some platforms. 351 + */ 352 + if (!GLAD_GL_VERSION_3_0 && !GLAD_GL_ES_VERSION_3_0) { 353 + switch (egl_client_type) { 354 + default: EGL_ERROR("Unknown OpenGL version!"); break; 355 + case EGL_OPENGL_API: EGL_ERROR("OpenGL 3.0 or above!"); break; 356 + case EGL_OPENGL_ES_API: EGL_ERROR("OpenGL ES 3.0 or above!"); break; 357 + } 358 + 359 + restore_context(&old); 360 + return XRT_ERROR_OPENGL; 361 + } 362 + 363 + 364 + /* 365 + * Now do the allocation and init. 366 + */ 367 + 333 368 struct client_egl_compositor *ceglc = U_TYPED_CALLOC(struct client_egl_compositor); 334 369 ceglc->current.dpy = display; 335 370 ceglc->current.ctx = context;