backend: gl: inherit image's inner properties in the gl_image_decouple function

Image decouple should keep all the image properies from the source
image, so shader must be copied. And there are also some internal
properties what should be inherited but wasn't.

In particular this prevents images from losing their shaders when
alpha is applied.

Fixes #1174
This commit is contained in:
Maxim Solovyov 2024-02-02 23:55:29 +03:00 committed by Yuxuan Shui
parent bbc657e4bc
commit eb39426b08
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 3 additions and 1 deletions

View File

@ -1013,9 +1013,11 @@ static inline void gl_image_decouple(backend_t *base, struct backend_image *img)
auto new_tex = ccalloc(1, struct gl_texture);
new_tex->texture = gl_new_texture(GL_TEXTURE_2D);
new_tex->y_inverted = true;
new_tex->y_inverted = inner->y_inverted;
new_tex->has_alpha = inner->has_alpha;
new_tex->height = inner->height;
new_tex->width = inner->width;
new_tex->shader = inner->shader;
new_tex->refcount = 1;
new_tex->user_data = gd->decouple_texture_user_data(base, inner->user_data);