From 85a2ee6d30e7a039b4eaba0c97bdb08d54e57f80 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 6 Nov 2019 21:28:43 +1300 Subject: 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. --- include/render/gles2.h | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'include/render') 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( -- cgit v1.2.3