Skip to content

Commit

Permalink
Fix T95809: Check color space changes to refresh image engine.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeroenbakker-atmind committed Feb 18, 2022
1 parent 400e57b commit fe26d18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/blender/draw/engines/image/image_instance_data.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion source/blender/draw/engines/image/image_usage.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe26d18

Please sign in to comment.