render/egl: 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.
master
Simon Ser 3 years ago committed by Simon Zeni
parent 4554f17377
commit 4c51a0f6eb

@ -37,12 +37,12 @@ struct wlr_egl {
struct { struct {
// Display extensions // Display extensions
bool image_base_khr; bool KHR_image_base;
bool image_dmabuf_import_ext; bool EXT_image_dma_buf_import;
bool image_dmabuf_import_modifiers_ext; bool EXT_image_dma_buf_import_modifiers;
// Device extensions // Device extensions
bool device_drm_ext; bool EXT_device_drm;
} exts; } exts;
struct { struct {

@ -230,16 +230,16 @@ struct wlr_egl *wlr_egl_create_with_drm_fd(int drm_fd) {
} }
if (check_egl_ext(display_exts_str, "EGL_KHR_image_base")) { if (check_egl_ext(display_exts_str, "EGL_KHR_image_base")) {
egl->exts.image_base_khr = true; egl->exts.KHR_image_base = true;
load_egl_proc(&egl->procs.eglCreateImageKHR, "eglCreateImageKHR"); load_egl_proc(&egl->procs.eglCreateImageKHR, "eglCreateImageKHR");
load_egl_proc(&egl->procs.eglDestroyImageKHR, "eglDestroyImageKHR"); load_egl_proc(&egl->procs.eglDestroyImageKHR, "eglDestroyImageKHR");
} }
egl->exts.image_dmabuf_import_ext = egl->exts.EXT_image_dma_buf_import =
check_egl_ext(display_exts_str, "EGL_EXT_image_dma_buf_import"); check_egl_ext(display_exts_str, "EGL_EXT_image_dma_buf_import");
if (check_egl_ext(display_exts_str, if (check_egl_ext(display_exts_str,
"EGL_EXT_image_dma_buf_import_modifiers")) { "EGL_EXT_image_dma_buf_import_modifiers")) {
egl->exts.image_dmabuf_import_modifiers_ext = true; egl->exts.EXT_image_dma_buf_import_modifiers = true;
load_egl_proc(&egl->procs.eglQueryDmaBufFormatsEXT, load_egl_proc(&egl->procs.eglQueryDmaBufFormatsEXT,
"eglQueryDmaBufFormatsEXT"); "eglQueryDmaBufFormatsEXT");
load_egl_proc(&egl->procs.eglQueryDmaBufModifiersEXT, load_egl_proc(&egl->procs.eglQueryDmaBufModifiersEXT,
@ -287,7 +287,7 @@ struct wlr_egl *wlr_egl_create_with_drm_fd(int drm_fd) {
} }
#endif #endif
egl->exts.device_drm_ext = egl->exts.EXT_device_drm =
check_egl_ext(device_exts_str, "EGL_EXT_device_drm"); check_egl_ext(device_exts_str, "EGL_EXT_device_drm");
} }
@ -390,7 +390,7 @@ void wlr_egl_destroy(struct wlr_egl *egl) {
} }
bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImage image) { bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImage image) {
if (!egl->exts.image_base_khr) { if (!egl->exts.KHR_image_base) {
return false; return false;
} }
if (!image) { if (!image) {
@ -448,7 +448,7 @@ bool wlr_egl_restore_context(struct wlr_egl_context *context) {
EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl, EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
struct wlr_dmabuf_attributes *attributes, bool *external_only) { struct wlr_dmabuf_attributes *attributes, bool *external_only) {
if (!egl->exts.image_base_khr || !egl->exts.image_dmabuf_import_ext) { if (!egl->exts.KHR_image_base || !egl->exts.EXT_image_dma_buf_import) {
wlr_log(WLR_ERROR, "dmabuf import extension not present"); wlr_log(WLR_ERROR, "dmabuf import extension not present");
return NULL; return NULL;
} }
@ -461,7 +461,7 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
// have here // have here
if (attributes->modifier != DRM_FORMAT_MOD_INVALID && if (attributes->modifier != DRM_FORMAT_MOD_INVALID &&
attributes->modifier != DRM_FORMAT_MOD_LINEAR) { attributes->modifier != DRM_FORMAT_MOD_LINEAR) {
if (!egl->exts.image_dmabuf_import_modifiers_ext) { if (!egl->exts.EXT_image_dma_buf_import_modifiers) {
wlr_log(WLR_ERROR, "dmabuf modifiers extension not present"); wlr_log(WLR_ERROR, "dmabuf modifiers extension not present");
return NULL; return NULL;
} }
@ -541,7 +541,7 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
} }
static int get_egl_dmabuf_formats(struct wlr_egl *egl, int **formats) { static int get_egl_dmabuf_formats(struct wlr_egl *egl, int **formats) {
if (!egl->exts.image_dmabuf_import_ext) { if (!egl->exts.EXT_image_dma_buf_import) {
wlr_log(WLR_DEBUG, "DMA-BUF import extension not present"); wlr_log(WLR_DEBUG, "DMA-BUF import extension not present");
return -1; return -1;
} }
@ -551,7 +551,7 @@ static int get_egl_dmabuf_formats(struct wlr_egl *egl, int **formats) {
// supported; it's the intended way to just try to create buffers. // supported; it's the intended way to just try to create buffers.
// Just a guess but better than not supporting dmabufs at all, // Just a guess but better than not supporting dmabufs at all,
// given that the modifiers extension isn't supported everywhere. // given that the modifiers extension isn't supported everywhere.
if (!egl->exts.image_dmabuf_import_modifiers_ext) { if (!egl->exts.EXT_image_dma_buf_import_modifiers) {
static const int fallback_formats[] = { static const int fallback_formats[] = {
DRM_FORMAT_ARGB8888, DRM_FORMAT_ARGB8888,
DRM_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888,
@ -594,11 +594,11 @@ static int get_egl_dmabuf_modifiers(struct wlr_egl *egl, int format,
*modifiers = NULL; *modifiers = NULL;
*external_only = NULL; *external_only = NULL;
if (!egl->exts.image_dmabuf_import_ext) { if (!egl->exts.EXT_image_dma_buf_import) {
wlr_log(WLR_DEBUG, "DMA-BUF extension not present"); wlr_log(WLR_DEBUG, "DMA-BUF extension not present");
return -1; return -1;
} }
if (!egl->exts.image_dmabuf_import_modifiers_ext) { if (!egl->exts.EXT_image_dma_buf_import_modifiers) {
return 0; return 0;
} }
@ -707,7 +707,7 @@ static char *get_render_name(const char *name) {
} }
int wlr_egl_dup_drm_fd(struct wlr_egl *egl) { int wlr_egl_dup_drm_fd(struct wlr_egl *egl) {
if (egl->device == EGL_NO_DEVICE_EXT || !egl->exts.device_drm_ext) { if (egl->device == EGL_NO_DEVICE_EXT || !egl->exts.EXT_device_drm) {
return -1; return -1;
} }

@ -744,7 +744,7 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
wlr_log(WLR_INFO, "GL renderer: %s", glGetString(GL_RENDERER)); wlr_log(WLR_INFO, "GL renderer: %s", glGetString(GL_RENDERER));
wlr_log(WLR_INFO, "Supported GLES2 extensions: %s", exts_str); wlr_log(WLR_INFO, "Supported GLES2 extensions: %s", exts_str);
if (!renderer->egl->exts.image_dmabuf_import_ext) { if (!renderer->egl->exts.EXT_image_dma_buf_import) {
wlr_log(WLR_ERROR, "EGL_EXT_image_dma_buf_import not supported"); wlr_log(WLR_ERROR, "EGL_EXT_image_dma_buf_import not supported");
free(renderer); free(renderer);
return NULL; return NULL;

Loading…
Cancel
Save