mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
render/gles2: Don't track image in texture
We can get it from the buffer
This commit is contained in:
parent
cb5f67431b
commit
829e34b305
2 changed files with 3 additions and 6 deletions
|
@ -125,8 +125,6 @@ struct wlr_gles2_texture {
|
||||||
bool owns_tex;
|
bool owns_tex;
|
||||||
GLuint tex;
|
GLuint tex;
|
||||||
|
|
||||||
EGLImageKHR image;
|
|
||||||
|
|
||||||
bool has_alpha;
|
bool has_alpha;
|
||||||
|
|
||||||
// Only affects target == GL_TEXTURE_2D
|
// Only affects target == GL_TEXTURE_2D
|
||||||
|
|
|
@ -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_buffer *buffer, const pixman_region32_t *damage) {
|
||||||
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
||||||
|
|
||||||
if (texture->target != GL_TEXTURE_2D || texture->image != EGL_NO_IMAGE_KHR) {
|
if (texture->target != GL_TEXTURE_2D || texture->buffer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ static bool gles2_texture_update_from_buffer(struct wlr_texture *wlr_texture,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gles2_texture_invalidate(struct wlr_gles2_texture *texture) {
|
static bool gles2_texture_invalidate(struct wlr_gles2_texture *texture) {
|
||||||
if (texture->image == EGL_NO_IMAGE_KHR) {
|
if (!texture->buffer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (texture->target == GL_TEXTURE_EXTERNAL_OES) {
|
if (texture->target == GL_TEXTURE_EXTERNAL_OES) {
|
||||||
|
@ -123,7 +123,7 @@ static bool gles2_texture_invalidate(struct wlr_gles2_texture *texture) {
|
||||||
|
|
||||||
glBindTexture(texture->target, texture->tex);
|
glBindTexture(texture->target, texture->tex);
|
||||||
texture->renderer->procs.glEGLImageTargetTexture2DOES(texture->target,
|
texture->renderer->procs.glEGLImageTargetTexture2DOES(texture->target,
|
||||||
texture->image);
|
texture->buffer->image);
|
||||||
glBindTexture(texture->target, 0);
|
glBindTexture(texture->target, 0);
|
||||||
|
|
||||||
pop_gles2_debug(texture->renderer);
|
pop_gles2_debug(texture->renderer);
|
||||||
|
@ -299,7 +299,6 @@ static struct wlr_texture *gles2_texture_from_dmabuf(
|
||||||
texture->buffer = buffer;
|
texture->buffer = buffer;
|
||||||
texture->drm_format = DRM_FORMAT_INVALID; // texture can't be written anyways
|
texture->drm_format = DRM_FORMAT_INVALID; // texture can't be written anyways
|
||||||
texture->has_alpha = drm_fmt ? drm_fmt->has_alpha : true;
|
texture->has_alpha = drm_fmt ? drm_fmt->has_alpha : true;
|
||||||
texture->image = buffer->image;
|
|
||||||
|
|
||||||
struct wlr_egl_context prev_ctx;
|
struct wlr_egl_context prev_ctx;
|
||||||
wlr_egl_save_context(&prev_ctx);
|
wlr_egl_save_context(&prev_ctx);
|
||||||
|
|
Loading…
Reference in a new issue