Fix #104829: Clip editor has poor performance when Metadata panel is closed
According to the report it is a regression since 3.2, but it is tricky to pin-point which exact commit caused it. The root of the issue is that under certain circumstances frame might be read and processed twice, depending on the order in which panels and the main area is drawn: the footage information panel skips cache, so it it is drawn prior to the main area it leads to 2 frame reads. Opening the Metadata panel triggers code path which forces frame to be put to the cache, solving the double frame read. Solution is simple: do not skip cache when acquiring image buffer for the footage information: the same frame will be needed for the main area as well. Pull Request #104860
This commit is contained in:
@@ -785,7 +785,12 @@ void uiTemplateMovieclipInformation(uiLayout *layout,
|
||||
uiLayout *col = uiLayoutColumn(layout, false);
|
||||
uiLayoutSetAlignment(col, UI_LAYOUT_ALIGN_RIGHT);
|
||||
|
||||
ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, user, clip->flag, MOVIECLIP_CACHE_SKIP);
|
||||
/* NOTE: Put the frame to cache. If the panel is drawn, the display will also be shown, as well
|
||||
* as metadata panel. So if the cache is skipped here it is not really a memory saver, but
|
||||
* skipping the cache could lead to a performance impact depending on the order in which panels
|
||||
* and the main area is drawn. Basically, if it is this template drawn first and then the main
|
||||
* area it will lead to frame read and processing happening twice. */
|
||||
ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, user, clip->flag, 0);
|
||||
|
||||
int width, height;
|
||||
/* Display frame dimensions, channels number and buffer type. */
|
||||
|
||||
Reference in New Issue
Block a user