Fix T63349: image texture garbage collection causing freezes
Images were being freed often because the tagging for when the image was last used was missing. Differential Revision: https://developer.blender.org/D5252
This commit is contained in:
parent
846e5f1dc0
commit
daff18dd28
Notes:
blender-bot
2023-02-14 03:06:24 +01:00
Referenced by issue #63349, Eevee Texture Time Out Causes Freezing
|
@ -797,6 +797,9 @@ void draw_image_main(const bContext *C, ARegion *ar)
|
|||
ima = ED_space_image(sima);
|
||||
ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
|
||||
|
||||
/* Tag image as in active use for garbage collector. */
|
||||
BKE_image_tag_time(ima);
|
||||
|
||||
show_viewer = (ima && ima->source == IMA_SRC_VIEWER) != 0;
|
||||
show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT) != 0;
|
||||
show_paint = (ima && (sima->mode == SI_MODE_PAINT) && (show_viewer == false) &&
|
||||
|
|
|
@ -475,6 +475,9 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int textarget
|
|||
ima->gpuflag &= ~IMA_GPU_REFRESH;
|
||||
}
|
||||
|
||||
/* Tag as in active use for garbage collector. */
|
||||
BKE_image_tag_time(ima);
|
||||
|
||||
/* Test if we already have a texture. */
|
||||
GPUTexture **tex = gpu_get_image_gputexture(ima, textarget);
|
||||
if (*tex) {
|
||||
|
|
Loading…
Reference in New Issue