Fix #130742 Scene render from VSE is taking twice as long

Regression caused by 5ecb70964e. This is, because renders of individual
strips could no longer be reused when cache is completely disabled
during rendering.

Instead of disabling cache completely, flag cache entries as temporary.
When reading entries also skip disk cache, since in 5ecb70964e goal was
to avoid reading from disk cache.

5ecb70964e also affected visual output of rendered image. This is
reported in #131106. Because of this 1 test must be updated.

Root cause for #131106 is, that byte image was automatically converted
to float, due to processing with other float image. Then the same byte
image was used for processing with another byte image. Before
5ecb70964e this byte converted to float image would be cached, which
caused float code paths to be used. This is correct behavior.
After 5ecb70964e, no image is cached, so float data were not saved, so
byte code path was executed in second processing step.

Pull Request: https://projects.blender.org/blender/blender/pulls/130781
This commit is contained in:
Richard Antalik
2024-12-02 10:07:08 +01:00
committed by Richard Antalik
parent 33fd027dc5
commit 618b7f4a9b
2 changed files with 13 additions and 4 deletions

View File

@@ -1024,6 +1024,9 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
/* flush sculpt and editmode changes */
ED_editors_flush_edits_ex(bmain, true, false);
/* Cleanup VSE cache, since it is not guaranteed that stored images are invalid. */
SEQ_cache_cleanup(scene);
/* store spare
* get view3d layer, local layer, make this nice api call to render
* store spare */

View File

@@ -687,7 +687,7 @@ void seq_cache_cleanup_sequence(Scene *scene,
ImBuf *seq_cache_get(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type)
{
if (context->skip_cache || context->is_proxy_render || context->for_render || !seq) {
if (context->skip_cache || context->is_proxy_render || !seq) {
return nullptr;
}
@@ -723,6 +723,10 @@ ImBuf *seq_cache_get(const SeqRenderData *context, Sequence *seq, float timeline
return ibuf;
}
if (context->for_render) {
return nullptr;
}
/* Try disk cache: */
if (seq_disk_cache_is_enabled(context->bmain)) {
if (cache->disk_cache == nullptr) {
@@ -776,9 +780,7 @@ bool seq_cache_put_if_possible(
void seq_cache_put(
const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *i)
{
if (i == nullptr || context->skip_cache || context->is_proxy_render || context->for_render ||
!seq)
{
if (i == nullptr || context->skip_cache || context->is_proxy_render || !seq) {
return;
}
@@ -808,6 +810,10 @@ void seq_cache_put(
seq_cache_put_ex(scene, key, i);
seq_cache_unlock(scene);
if (context->for_render) {
key->is_temp_cache = true;
}
if (!key->is_temp_cache) {
if (seq_disk_cache_is_enabled(context->bmain)) {
if (cache->disk_cache == nullptr) {