Monado OpenXR Runtime
comp_gl_eglimage_swapchain.c File Reference

OpenGL client side glue to swapchain implementation - EGLImageKHR-backed. More...

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

Macros

#define EGL_SC_TRACE(...)   U_LOG_IFL_T(log_level, __VA_ARGS__)
 
#define EGL_SC_DEBUG(...)   U_LOG_IFL_D(log_level, __VA_ARGS__)
 
#define EGL_SC_INFO(...)   U_LOG_IFL_I(log_level, __VA_ARGS__)
 
#define EGL_SC_WARN(...)   U_LOG_IFL_W(log_level, __VA_ARGS__)
 
#define EGL_SC_ERROR(...)   U_LOG_IFL_E(log_level, __VA_ARGS__)
 
#define EGL_PROTECTED_CONTENT_EXT   0x32C0
 

Functions

static void client_gl_eglimage_swapchain_teardown_storage (struct client_gl_eglimage_swapchain *sc)
 
static void client_gl_eglimage_swapchain_destroy (struct xrt_swapchain *xsc)
 
struct xrt_swapchainclient_gl_eglimage_swapchain_create (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_native *xscn, struct client_gl_swapchain **out_sc)
 Create a swapchain, belonging to a client_gl_compositor, that uses some way of producing an EGLImageKHR from the native buffer. More...
 

Variables

static enum u_logging_level log_level
 

Detailed Description

OpenGL client side glue to swapchain implementation - EGLImageKHR-backed.

Author
Rylie Pavlik rylie.nosp@m..pav.nosp@m.lik@c.nosp@m.olla.nosp@m.bora..nosp@m.com
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ client_gl_eglimage_swapchain_create()

struct xrt_swapchain* client_gl_eglimage_swapchain_create ( struct xrt_compositor xc,
const struct xrt_swapchain_create_info info,
struct xrt_swapchain_native xscn,
struct client_gl_swapchain **  out_sc 
)

Create a swapchain, belonging to a client_gl_compositor, that uses some way of producing an EGLImageKHR from the native buffer.

This is used on Android and on desktop when the EGL extension is used.

Todo:
this matches the behavior of the Google test, but is not itself tested or fully rationalized.

Also, glEGLImageTargetTexStorageEXT was added in Android platform 28, so fairly recently.

References client_egl_compositor::client_egl_compositor().