diff options
author | Scott Anderson <scott@anderso.nz> | 2019-11-06 21:28:43 +1300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-11-06 09:46:01 +0100 |
commit | 85a2ee6d30e7a039b4eaba0c97bdb08d54e57f80 (patch) | |
tree | fa6fb5bd685682108e6315b48a798980bff4b6fc /include/render | |
parent | f2d3b1000f451003c38933c05a742b76da48aeee (diff) |
render/gles: Simplify textures a bit
We don't need our own enum for types. Instead we just use
GL_TEXTURE_{2D,EXTERNAL_OES}, which already describes usage.
Also fixes a situation where we were using GL_TEXTURE_2D in a situation
we should not have. wl_drm buffers are always GL_TEXTURE_EXTERNAL_OES,
no matter if they're RGB or any other format.
Diffstat (limited to 'include/render')
-rw-r--r-- | include/render/gles2.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/include/render/gles2.h b/include/render/gles2.h index 15653cac..7a629d69 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -60,31 +60,24 @@ struct wlr_gles2_renderer { uint32_t viewport_width, viewport_height; }; -enum wlr_gles2_texture_type { - WLR_GLES2_TEXTURE_GLTEX, - WLR_GLES2_TEXTURE_WL_DRM_GL, - WLR_GLES2_TEXTURE_WL_DRM_EXT, - WLR_GLES2_TEXTURE_DMABUF, -}; - struct wlr_gles2_texture { struct wlr_texture wlr_texture; - struct wlr_egl *egl; - enum wlr_gles2_texture_type type; - int width, height; - bool has_alpha; - enum wl_shm_format wl_format; // used to interpret upload data - bool inverted_y; - // Not set if WLR_GLES2_TEXTURE_GLTEX + // Basically: + // GL_TEXTURE_2D == mutable + // GL_TEXTURE_EXTERNAL_OES == immutable + GLenum target; + GLuint tex; + EGLImageKHR image; - GLuint image_tex; - union { - GLuint gl_tex; - struct wl_resource *wl_drm; - }; + int width, height; + bool inverted_y; + bool has_alpha; + + // Only affects target == GL_TEXTURE_2D + enum wl_shm_format wl_format; // used to interpret upload data }; const struct wlr_gles2_pixel_format *get_gles2_format_from_wl( |