render/gles2: add wlr_gles2_renderer_check_ext

This commit is contained in:
Simon Ser 2020-04-21 14:52:47 +02:00 committed by Drew DeVault
parent 01d4506253
commit 5dc3a9c754
3 changed files with 11 additions and 0 deletions

View file

@ -44,6 +44,7 @@ struct wlr_gles2_renderer {
struct wlr_egl *egl; struct wlr_egl *egl;
const char *exts_str;
struct { struct {
bool read_format_bgra_ext; bool read_format_bgra_ext;
bool debug_khr; bool debug_khr;

View file

@ -18,6 +18,8 @@ struct wlr_egl;
struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl); struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl);
struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer); struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer);
bool wlr_gles2_renderer_check_ext(struct wlr_renderer *renderer,
const char *ext);
struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl, struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl,
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height, enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height,

View file

@ -575,6 +575,8 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
return NULL; return NULL;
} }
renderer->exts_str = exts_str;
wlr_log(WLR_INFO, "Using %s", glGetString(GL_VERSION)); wlr_log(WLR_INFO, "Using %s", glGetString(GL_VERSION));
wlr_log(WLR_INFO, "GL vendor: %s", glGetString(GL_VENDOR)); wlr_log(WLR_INFO, "GL vendor: %s", glGetString(GL_VENDOR));
wlr_log(WLR_INFO, "GL renderer: %s", glGetString(GL_RENDERER)); wlr_log(WLR_INFO, "GL renderer: %s", glGetString(GL_RENDERER));
@ -687,3 +689,9 @@ error:
free(renderer); free(renderer);
return NULL; return NULL;
} }
bool wlr_gles2_renderer_check_ext(struct wlr_renderer *wlr_renderer,
const char *ext) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
return check_gl_ext(renderer->exts_str, ext);
}