Page MenuHome

Fix T92608: Image Editor does not display stereo images
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Nov 1 2021, 11:15 AM.

Details

Summary

Caused by own rB5aa3167e48b2: Fix T90772: Image Editor not sampling color from the the currently.
Related commit: rBebaa3fcedd23: Fix T84398: Multiview images show only one view..

For stereo renders, BKE_image_is_multilayer is true, however we seem
to get to down to space_image_gpu_texture_get [where this is called]
from IMAGE_cache_init with a NULL Image->RenderResult.

So what then happens is that BKE_image_multilayer_index is called and
even though it has an appropriate codepath for stereo, it earlies out
and does not set multi_index correctly.

Still a bit puzzled why RenderResult is NULL for a render, but since
other places also check for a valid RenderResult before going down the
_multilayer_ route (and doing _multiview_ instead), now do the same
thing, BKE_image_multiview_index is now called in these cases (and seems
to behave correctly, checked with layers and passes and all seems to
display correctly, either in stereo or choosing individual eyes).

Since this is somewhat a stab in the dark regarding the NULL
RenderResult, I would appreciate an extra careful eye.

Diff Detail

Repository
rB Blender
Branch
T92608 (branched from master)
Build Status
Buildable 18360
Build 18360: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Nov 1 2021, 11:15 AM
Philipp Oeser (lichtwerk) created this revision.

I come to the same conclusion. BKE_image_multilayer_index does nothing when rr == NULL Iand should not be treated as multilayer.
Also not 100% sure due to the unclear/undocumented API.

This revision is now accepted and ready to land.Nov 1 2021, 12:59 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/draw/engines/image/image_engine.c
110–113

Use only if (image->rr != NULL) {. It's functionally the same, as image->rr is only ever created for multilayer images.

The reason to leave it out is that none of the other places calling BKE_image_multilayer_index check for BKE_image_is_multilayer, which makes it seems like there is some specific reason it's needed here.