From 689321419b8ea78b939bb718d177457cc961f0b0 Mon Sep 17 00:00:00 2001 From: Maxim Solovyov Date: Sun, 18 Jun 2023 19:27:22 +0300 Subject: [PATCH 1/2] backend: egl: remove references to the glx backend --- src/backend/gl/egl.c | 12 ++++++------ src/backend/gl/egl.h | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/backend/gl/egl.c b/src/backend/gl/egl.c index 9f651544..761eb635 100644 --- a/src/backend/gl/egl.c +++ b/src/backend/gl/egl.c @@ -67,7 +67,7 @@ const char *eglGetErrorString(EGLint error) { } /** - * Free a glx_texture_t. + * Free a gl_texture_t. */ static void egl_release_image(backend_t *base, struct gl_texture *tex) { struct egl_data *gd = (void *)base; @@ -88,14 +88,14 @@ static void egl_release_image(backend_t *base, struct gl_texture *tex) { } /** - * Destroy GLX related resources. + * Destroy EGL related resources. */ void egl_deinit(backend_t *base) { struct egl_data *gd = (void *)base; gl_deinit(&gd->gl); - // Destroy GLX context + // Destroy EGL context if (gd->ctx != EGL_NO_CONTEXT) { eglMakeCurrent(gd->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(gd->display, gd->ctx); @@ -225,12 +225,12 @@ static backend_t *egl_init(session_t *ps) { gd->ctx = eglCreateContext(gd->display, config, NULL, NULL); if (gd->ctx == EGL_NO_CONTEXT) { - log_error("Failed to get GLX context."); + log_error("Failed to get EGL context."); goto end; } if (!eglMakeCurrent(gd->display, gd->target_win, gd->target_win, gd->ctx)) { - log_error("Failed to attach GLX context."); + log_error("Failed to attach EGL context."); goto end; } @@ -423,7 +423,7 @@ struct backend_operations egl_ops = { PFNEGLGETDISPLAYDRIVERNAMEPROC eglGetDisplayDriverName; /** - * Check if a GLX extension exists. + * Check if a EGL extension exists. */ static inline bool egl_has_extension(EGLDisplay dpy, const char *ext) { const char *egl_exts = eglQueryString(dpy, EGL_EXTENSIONS); diff --git a/src/backend/gl/egl.h b/src/backend/gl/egl.h index 171b1735..f482032b 100644 --- a/src/backend/gl/egl.h +++ b/src/backend/gl/egl.h @@ -1,13 +1,11 @@ // SPDX-License-Identifier: MPL-2.0 // Copyright (c) Yuxuan Shui #pragma once -#include -// Older version of glx.h defines function prototypes for these extensions... -// Rename them to avoid conflicts #include #include #include #include +#include #include #include From 15667d6b6eaf6ecdc4bc134d12f7e114d0b7dcab Mon Sep 17 00:00:00 2001 From: Maxim Solovyov Date: Sun, 18 Jun 2023 19:34:53 +0300 Subject: [PATCH 2/2] backend: gl: remove references to the glx backend --- src/backend/gl/gl_common.c | 2 +- src/backend/gl/gl_common.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/gl/gl_common.c b/src/backend/gl/gl_common.c index df502dc0..ef9a34b8 100644 --- a/src/backend/gl/gl_common.c +++ b/src/backend/gl/gl_common.c @@ -808,7 +808,7 @@ bool gl_init(struct gl_data *gd, session_t *ps) { glGenQueries(2, gd->frame_timing); gd->current_frame_timing = 0; - // Initialize GLX data structure + // Initialize GL data structure glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE); diff --git a/src/backend/gl/gl_common.h b/src/backend/gl/gl_common.h index 5e3a505d..4de3ad6a 100644 --- a/src/backend/gl/gl_common.h +++ b/src/backend/gl/gl_common.h @@ -77,7 +77,7 @@ typedef struct { GLint color_loc; } gl_fill_shader_t; -/// @brief Wrapper of a binded GLX texture. +/// @brief Wrapper of a binded GL texture. struct gl_texture { int refcount; bool has_alpha; @@ -214,7 +214,7 @@ static inline const char *gl_get_err_str(GLenum err) { } /** - * Check for GLX error. + * Check for GL error. * * http://blog.nobel-joergensen.com/2013/01/29/debugging-opengl-using-glgeterror/ */ @@ -225,10 +225,10 @@ static inline void gl_check_err_(const char *func, int line) { const char *errtext = gl_get_err_str(err); if (errtext) { log_printf(tls_logger, LOG_LEVEL_ERROR, func, - "GLX error at line %d: %s", line, errtext); + "GL error at line %d: %s", line, errtext); } else { log_printf(tls_logger, LOG_LEVEL_ERROR, func, - "GLX error at line %d: %d", line, err); + "GL error at line %d: %d", line, err); } } } @@ -265,7 +265,7 @@ static inline bool gl_check_fb_complete_(const char *func, int line, GLenum fb) #define gl_check_fb_complete(fb) gl_check_fb_complete_(__func__, __LINE__, (fb)) /** - * Check if a GLX extension exists. + * Check if a GL extension exists. */ static inline bool gl_has_extension(const char *ext) { int nexts = 0;