Monado OpenXR Runtime
comp_egl_client.c File Reference

Glue code to EGL client side glue code. More...

#include "xrt/xrt_config_os.h"
#include "xrt/xrt_config_have.h"
#include "xrt/xrt_gfx_egl.h"
#include "xrt/xrt_handles.h"
#include "util/u_misc.h"
#include "util/u_logging.h"
#include "util/u_debug.h"
#include "ogl/egl_api.h"
#include "ogl/ogl_api.h"
#include "client/comp_gl_client.h"
#include "client/comp_egl_client.h"
#include "client/comp_gl_memobj_swapchain.h"
#include "client/comp_gl_eglimage_swapchain.h"
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for comp_egl_client.c:

Macros

#define EGL_TRACE(...)   U_LOG_IFL_T(log_level, __VA_ARGS__)
 
#define EGL_DEBUG(...)   U_LOG_IFL_D(log_level, __VA_ARGS__)
 
#define EGL_INFO(...)   U_LOG_IFL_I(log_level, __VA_ARGS__)
 
#define EGL_WARN(...)   U_LOG_IFL_W(log_level, __VA_ARGS__)
 
#define EGL_ERROR(...)   U_LOG_IFL_E(log_level, __VA_ARGS__)
 
#define DESTROY_CONTEXT(DPY, CTX)   destroy_context_with_check(DPY, CTX, __func__)
 
#define DUMP_EXTENSION_STATUS(EXT)   EGL_DEBUG(" - " #EXT ": %s", GLAD_##EXT ? "true" : "false")
 

Typedefs

typedef EGLBoolean EGLAPIENTRY(* PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
 

Functions

static xrt_result_t client_egl_insert_fence (struct xrt_compositor *xc, xrt_graphics_sync_handle_t *out_handle)
 
static void save_context (struct client_egl_context *ctx)
 
static bool restore_context (struct client_egl_context *ctx)
 
static const char * egl_error_str (EGLint ret)
 
static void destroy_context_with_check (EGLDisplay display, EGLContext context, const char *func)
 
static XRT_MAYBE_UNUSED bool has_extension (const char *extensions, const char *ext)
 
static void ensure_native_fence_is_loaded (EGLDisplay dpy, PFNEGLGETPROCADDRESSPROC get_gl_procaddr)
 
static xrt_result_t create_context (EGLDisplay display, EGLConfig config, EGLContext app_context, EGLint api_type, EGLContext *out_our_context)
 
static xrt_result_t load_gl_functions (EGLint egl_client_type, PFNEGLGETPROCADDRESSPROC get_gl_procaddr)
 
static xrt_result_t check_context_and_debug_print (EGLint egl_client_type)
 
static xrt_result_t get_client_gl_functions (client_gl_swapchain_create_func_t *out_sc_create_func, client_gl_insert_fence_func_t *out_insert_fence)
 
static xrt_result_t client_egl_context_begin (struct xrt_compositor *xc, enum client_gl_context_reason reason)
 
static void client_egl_context_end (struct xrt_compositor *xc, enum client_gl_context_reason reason)
 
static void client_egl_compositor_destroy (struct xrt_compositor *xc)
 
xrt_result_t xrt_gfx_provider_create_gl_egl (struct xrt_compositor_native *xcn, EGLDisplay display, EGLConfig config, EGLContext context, PFNEGLGETPROCADDRESSPROC get_gl_procaddr, bool renderdoc_enabled, struct xrt_compositor_gl **out_xcgl)
 

Variables

static enum u_logging_level log_level
 

Detailed Description

Glue code to EGL client side glue code.

Author
Drew DeVault sir@c.nosp@m.mpwn.nosp@m..com
Simon Ser conta.nosp@m.ct@e.nosp@m.mersi.nosp@m.on.f.nosp@m.r
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ client_egl_context_begin()

static xrt_result_t client_egl_context_begin ( struct xrt_compositor xc,
enum client_gl_context_reason  reason 
)
static
Todo:
Handle this better, don't just assume that the context is current.

References client_egl_compositor::client_egl_compositor(), CLIENT_GL_CONTEXT_REASON_SYNCHRONIZE, and XRT_SUCCESS.

◆ client_egl_context_end()

static void client_egl_context_end ( struct xrt_compositor xc,
enum client_gl_context_reason  reason 
)
static
Todo:
Handle this better, don't just assume that the context is current.

References client_egl_compositor::client_egl_compositor(), and CLIENT_GL_CONTEXT_REASON_SYNCHRONIZE.