render/gles2: rename wlr_egl.exts to better match Khronos

Khronos refers to extensions with their namespace as a prefix in
uppercase. Change our naming to align with Khronos conventions.
This also makes grepping easier.
This commit is contained in:
Simon Ser 2021-07-11 20:00:02 +02:00 committed by Simon Zeni
parent 4c51a0f6eb
commit 9b70eab194
2 changed files with 15 additions and 15 deletions

View File

@ -39,10 +39,10 @@ struct wlr_gles2_renderer {
const char *exts_str; const char *exts_str;
struct { struct {
bool read_format_bgra_ext; bool EXT_read_format_bgra;
bool debug_khr; bool KHR_debug;
bool egl_image_external_oes; bool OES_egl_image_external;
bool egl_image_oes; bool OES_egl_image;
} exts; } exts;
struct { struct {

View File

@ -274,7 +274,7 @@ static bool gles2_render_subtexture_with_matrix(
case GL_TEXTURE_EXTERNAL_OES: case GL_TEXTURE_EXTERNAL_OES:
shader = &renderer->shaders.tex_ext; shader = &renderer->shaders.tex_ext;
if (!renderer->exts.egl_image_external_oes) { if (!renderer->exts.OES_egl_image_external) {
wlr_log(WLR_ERROR, "Failed to render texture: " wlr_log(WLR_ERROR, "Failed to render texture: "
"GL_TEXTURE_EXTERNAL_OES not supported"); "GL_TEXTURE_EXTERNAL_OES not supported");
return false; return false;
@ -407,7 +407,7 @@ static uint32_t gles2_preferred_read_format(
return fmt->drm_format; return fmt->drm_format;
} }
if (renderer->exts.read_format_bgra_ext) { if (renderer->exts.EXT_read_format_bgra) {
return DRM_FORMAT_XRGB8888; return DRM_FORMAT_XRGB8888;
} }
return DRM_FORMAT_XBGR8888; return DRM_FORMAT_XBGR8888;
@ -427,7 +427,7 @@ static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
return false; return false;
} }
if (fmt->gl_format == GL_BGRA_EXT && !renderer->exts.read_format_bgra_ext) { if (fmt->gl_format == GL_BGRA_EXT && !renderer->exts.EXT_read_format_bgra) {
wlr_log(WLR_ERROR, wlr_log(WLR_ERROR,
"Cannot read pixels: missing GL_EXT_read_format_bgra extension"); "Cannot read pixels: missing GL_EXT_read_format_bgra extension");
return false; return false;
@ -530,7 +530,7 @@ static void gles2_destroy(struct wlr_renderer *wlr_renderer) {
glDeleteProgram(renderer->shaders.tex_ext.program); glDeleteProgram(renderer->shaders.tex_ext.program);
pop_gles2_debug(renderer); pop_gles2_debug(renderer);
if (renderer->exts.debug_khr) { if (renderer->exts.KHR_debug) {
glDisable(GL_DEBUG_OUTPUT_KHR); glDisable(GL_DEBUG_OUTPUT_KHR);
renderer->procs.glDebugMessageCallbackKHR(NULL, NULL); renderer->procs.glDebugMessageCallbackKHR(NULL, NULL);
} }
@ -760,11 +760,11 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
return NULL; return NULL;
} }
renderer->exts.read_format_bgra_ext = renderer->exts.EXT_read_format_bgra =
check_gl_ext(exts_str, "GL_EXT_read_format_bgra"); check_gl_ext(exts_str, "GL_EXT_read_format_bgra");
if (check_gl_ext(exts_str, "GL_KHR_debug")) { if (check_gl_ext(exts_str, "GL_KHR_debug")) {
renderer->exts.debug_khr = true; renderer->exts.KHR_debug = true;
load_gl_proc(&renderer->procs.glDebugMessageCallbackKHR, load_gl_proc(&renderer->procs.glDebugMessageCallbackKHR,
"glDebugMessageCallbackKHR"); "glDebugMessageCallbackKHR");
load_gl_proc(&renderer->procs.glDebugMessageControlKHR, load_gl_proc(&renderer->procs.glDebugMessageControlKHR,
@ -772,18 +772,18 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
} }
if (check_gl_ext(exts_str, "GL_OES_EGL_image_external")) { if (check_gl_ext(exts_str, "GL_OES_EGL_image_external")) {
renderer->exts.egl_image_external_oes = true; renderer->exts.OES_egl_image_external = true;
load_gl_proc(&renderer->procs.glEGLImageTargetTexture2DOES, load_gl_proc(&renderer->procs.glEGLImageTargetTexture2DOES,
"glEGLImageTargetTexture2DOES"); "glEGLImageTargetTexture2DOES");
} }
if (check_gl_ext(exts_str, "GL_OES_EGL_image")) { if (check_gl_ext(exts_str, "GL_OES_EGL_image")) {
renderer->exts.egl_image_oes = true; renderer->exts.OES_egl_image = true;
load_gl_proc(&renderer->procs.glEGLImageTargetRenderbufferStorageOES, load_gl_proc(&renderer->procs.glEGLImageTargetRenderbufferStorageOES,
"glEGLImageTargetRenderbufferStorageOES"); "glEGLImageTargetRenderbufferStorageOES");
} }
if (renderer->exts.debug_khr) { if (renderer->exts.KHR_debug) {
glEnable(GL_DEBUG_OUTPUT_KHR); glEnable(GL_DEBUG_OUTPUT_KHR);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR); glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR);
renderer->procs.glDebugMessageCallbackKHR(gles2_log, NULL); renderer->procs.glDebugMessageCallbackKHR(gles2_log, NULL);
@ -831,7 +831,7 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
renderer->shaders.tex_rgbx.pos_attrib = glGetAttribLocation(prog, "pos"); renderer->shaders.tex_rgbx.pos_attrib = glGetAttribLocation(prog, "pos");
renderer->shaders.tex_rgbx.tex_attrib = glGetAttribLocation(prog, "texcoord"); renderer->shaders.tex_rgbx.tex_attrib = glGetAttribLocation(prog, "texcoord");
if (renderer->exts.egl_image_external_oes) { if (renderer->exts.OES_egl_image_external) {
renderer->shaders.tex_ext.program = prog = renderer->shaders.tex_ext.program = prog =
link_program(renderer, tex_vertex_src, tex_fragment_src_external); link_program(renderer, tex_vertex_src, tex_fragment_src_external);
if (!renderer->shaders.tex_ext.program) { if (!renderer->shaders.tex_ext.program) {
@ -859,7 +859,7 @@ error:
pop_gles2_debug(renderer); pop_gles2_debug(renderer);
if (renderer->exts.debug_khr) { if (renderer->exts.KHR_debug) {
glDisable(GL_DEBUG_OUTPUT_KHR); glDisable(GL_DEBUG_OUTPUT_KHR);
renderer->procs.glDebugMessageCallbackKHR(NULL, NULL); renderer->procs.glDebugMessageCallbackKHR(NULL, NULL);
} }