aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/render/gles2.h9
-rw-r--r--render/gles2/texture.c2
2 files changed, 3 insertions, 8 deletions
diff --git a/include/render/gles2.h b/include/render/gles2.h
index 58972675..60bf4d17 100644
--- a/include/render/gles2.h
+++ b/include/render/gles2.h
@@ -118,19 +118,14 @@ struct wlr_gles2_texture {
struct wlr_gles2_renderer *renderer;
struct wl_list link; // wlr_gles2_renderer.textures
- // Basically:
- // GL_TEXTURE_2D == mutable
- // GL_TEXTURE_EXTERNAL_OES == immutable
GLenum target;
bool owns_tex;
GLuint tex;
bool has_alpha;
- // Only affects target == GL_TEXTURE_2D
- uint32_t drm_format; // used to interpret upload data
- // If imported from a wlr_buffer
- struct wlr_gles2_buffer *buffer;
+ uint32_t drm_format; // for mutable textures only, used to interpret upload data
+ struct wlr_gles2_buffer *buffer; // for DMA-BUF imports only
};
struct wlr_gles2_render_pass {
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index 51c6290d..3c9720c1 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -32,7 +32,7 @@ static bool gles2_texture_update_from_buffer(struct wlr_texture *wlr_texture,
struct wlr_buffer *buffer, const pixman_region32_t *damage) {
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
- if (texture->target != GL_TEXTURE_2D || texture->buffer) {
+ if (texture->drm_format == DRM_FORMAT_INVALID) {
return false;
}