Monado OpenXR Runtime
ogl_helpers.c File Reference

Common OpenGL code. More...

#include "util/u_handles.h"
#include "util/u_logging.h"
#include "ogl_helpers.h"
#include "ogl_api.h"
Include dependency graph for ogl_helpers.c:

Macros

#define CHECK_GL()
 Check for OpenGL errors, context needs to be current. More...
 

Functions

void ogl_texture_target_for_swapchain_info (const struct xrt_swapchain_create_info *info, uint32_t *out_tex_target, uint32_t *out_tex_param_name)
 Determine the texture target and the texture binding parameter to save/restore for creation/use of an OpenGL texture from the given info. More...
 
XRT_CHECK_RESULT uint32_t ogl_vk_format_to_gl (int64_t vk_format)
 Converts a Vulkan format to corresponding OpenGL format, will return 0 if no mapping exist for the given format. More...
 
XRT_CHECK_RESULT bool ogl_import_from_native (struct xrt_image_native *natives, uint32_t native_count, const struct xrt_swapchain_create_info *info, struct ogl_import_results *results)
 Import native images, a context needs to be current when called. More...
 

Detailed Description

Macro Definition Documentation

◆ CHECK_GL

#define CHECK_GL ( )
Value:
do { \
GLint err = glGetError(); \
if (err != 0) { \
U_LOG_RAW("%s:%u: error: 0x%04x", __func__, __LINE__, err); \
} \
} while (false)

Check for OpenGL errors, context needs to be current.