Fix T95809: Check color space changes to refresh image engine.

Previous commit fixed the compositor node, this commit is related to the
shader tree. Also checks if the color space or alpha mode have changed.
This commit is contained in:
Jeroen Bakker 2022-02-18 08:22:18 +01:00
parent 400e57b64a
commit fe26d18889
Notes: blender-bot 2023-02-13 16:12:58 +01:00
Referenced by issue #95865, Update problem with the Half Float Precision checkbox in the sidebar of the Image editor
Referenced by issue #95809, Image editor no longer reflecting changes of the node tree
2 changed files with 8 additions and 2 deletions

View File

@ -113,7 +113,7 @@ struct IMAGE_InstanceData {
void update_image_usage(const ImageUser *image_user)
{
ImageUsage usage(image_user);
ImageUsage usage(image, image_user);
if (last_usage != usage) {
last_usage = usage;
reset_dirty_flag(true);

View File

@ -34,12 +34,18 @@ struct ImageUsage {
/** View of the image that is used. */
short view = 0;
ColorManagedColorspaceSettings colorspace_settings;
/** IMA_ALPHA_* */
char alpha_mode;
ImageUsage() = default;
ImageUsage(const struct ImageUser *image_user)
ImageUsage(const struct Image *image, const struct ImageUser *image_user)
{
pass = image_user ? image_user->pass : 0;
layer = image_user ? image_user->layer : 0;
view = image_user ? image_user->multi_index : 0;
colorspace_settings = image->colorspace_settings;
alpha_mode = image->alpha_mode;
}
bool operator==(const ImageUsage &other) const