Fix T96163: Image editor doesn't refresh when undo/redo.

Undo would invalidate image owned GPU textures only. Textures
that are owned by the editor were not refreshed. This patch would
invalidate all the GPU textures by marking the whole image dirty.

This can be improved later as we could add partial updates of GPU
textures.

Reviewed By: mont29

Maniphest Tasks: T96163

Differential Revision: https://developer.blender.org/D14259
This commit is contained in:
Jeroen Bakker 2022-03-07 08:43:37 +01:00 committed by Jeroen Bakker
parent 4681987d92
commit 073d2390f0
Notes: blender-bot 2023-02-14 08:39:23 +01:00
Referenced by issue #96163, Regression: Image editor fails to update after undoing stroke
1 changed files with 2 additions and 1 deletions

View File

@ -570,7 +570,8 @@ static void uhandle_restore_list(ListBase *undo_handles, bool use_init)
if (changed) {
BKE_image_mark_dirty(image, ibuf);
BKE_image_free_gputextures(image); /* force OpenGL reload */
/* TODO(jbakker): only mark areas that are actually updated to improve performance. */
BKE_image_partial_update_mark_full_update(image);
if (ibuf->rect_float) {
ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */