diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-22 19:59:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 19:59:15 -0400 |
commit | 77d3be66eaabca4309794536984c54a5e94e9eb5 (patch) | |
tree | 50bde81f0a3b4a9a66f1e029823c391cb7345657 /include/render | |
parent | ef3769851f1b8586951cdf3ae71c3529f95a8fd6 (diff) | |
parent | a854c2f24677595110859373c75eb8ec5e50f91e (diff) |
Merge pull request #738 from emersion/gles2-renderer-redesign
Redesign GLES2 renderer
Diffstat (limited to 'include/render')
-rw-r--r-- | include/render/gles2.h | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/include/render/gles2.h b/include/render/gles2.h index 0a4fb49f..43a8d648 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -17,17 +17,25 @@ extern PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; -struct pixel_format { +struct gles2_pixel_format { uint32_t wl_format; GLint gl_format, gl_type; int depth, bpp; - GLuint *shader; + bool has_alpha; }; struct wlr_gles2_renderer { struct wlr_renderer wlr_renderer; struct wlr_egl *egl; + + struct { + GLuint quad; + GLuint ellipse; + GLuint tex_rgba; + GLuint tex_rgbx; + GLuint tex_ext; + } shaders; }; struct wlr_gles2_texture { @@ -35,37 +43,20 @@ struct wlr_gles2_texture { struct wlr_egl *egl; GLuint tex_id; - const struct pixel_format *pixel_format; + const struct gles2_pixel_format *pixel_format; EGLImageKHR image; GLenum target; }; -struct shaders { - bool initialized; - GLuint rgba, rgbx; - GLuint quad; - GLuint ellipse; - GLuint external; -}; - -extern struct shaders shaders; - -const struct pixel_format *gl_format_for_wl_format(enum wl_shm_format fmt); +const struct gles2_pixel_format *gles2_format_from_wl(enum wl_shm_format fmt); +const enum wl_shm_format *gles2_formats(size_t *len); struct wlr_texture *gles2_texture_create(); +struct wlr_gles2_texture *gles2_get_texture(struct wlr_texture *wlr_texture); -extern const GLchar quad_vertex_src[]; -extern const GLchar quad_fragment_src[]; -extern const GLchar ellipse_fragment_src[]; -extern const GLchar vertex_src[]; -extern const GLchar fragment_src_rgba[]; -extern const GLchar fragment_src_rgbx[]; -extern const GLchar fragment_src_external[]; - -bool _gles2_flush_errors(const char *file, int line); -#define gles2_flush_errors(...) \ - _gles2_flush_errors(wlr_strip_path(__FILE__), __LINE__) - -#define GL_CALL(func) func; gles2_flush_errors() +void gles2_push_marker(const char *file, const char *func); +void gles2_pop_marker(void); +#define GLES2_DEBUG_PUSH gles2_push_marker(wlr_strip_path(__FILE__), __func__) +#define GLES2_DEBUG_POP gles2_pop_marker() #endif |