diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-11-14 00:09:37 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-11-16 14:52:24 +0300 |
commit | 7db42b8f2a8cdec5067f2fe73082bd5d806a5e42 (patch) | |
tree | 3c514daf4c229491c10ba6f403b0e05d81e5e4ec /source/blender/imbuf | |
parent | ada79b4707edc859a9616390f8dc319c1d2e35c2 (diff) |
Fix T82460: Color Management Curves do not update when Image/UV Editor
is present
Caused by rB4212b6528afb.
'updateGLSLCurveMapping()' compares cacheIDs and in certain scenarios,
these are the same when they should not.
- whenever we had multiple viewports that are colormanaged with
curvemappings this worked right (cacheIDs were different)
- for example, this also worked right when the ImageEditor displays a
Render Result or a Compositor Viewer
- but it worked wrong when the Image Editor displays any other Image (or
no Image at all)
- it also worked right if there were multiple Image Editors [and one of
them displays a Render Result e.g]
Now why is this so?
For comparison, the curve mapping's pointer/address is used.
- update_glsl_display_processor frees the curve_mapping, see
BKE_curvemapping_free(global_glsl_state.curve_mapping)
- similar, update_glsl_display_processor creates a new curvemapping, see
BKE_curvemapping_copy(view_settings->curve_mapping)
- now for the situation that a viewport with curvemapping and a viewport
without curvemapping is present and you make changes to the curvemapping
the following happens:
-- curve_mapping_settings->cache_id is set once [to the memory address
of curvemapping before change]
-- change happens
-- viewport 1 frees curvemapping
-- viewport 2 duplicates using BKE_curvemapping_copy, but this one gets
the same address like before the change
-- this means we have different data on the same address with the same
cacheID...
Solution: to really make the cache ID unique we can combine the pointer
with its 'changed_timestamp' [which increases on every change].
Reviewers: jbakker
Maniphest Tasks: T82460
Differential Revision: https://developer.blender.org/D9559
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 8005049eab2..7847ae83c19 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -4044,7 +4044,7 @@ static void curve_mapping_to_ocio_settings(CurveMapping *curve_mapping, copy_v3_v3(curve_mapping_settings->black, curve_mapping->black); copy_v3_v3(curve_mapping_settings->bwmul, curve_mapping->bwmul); - curve_mapping_settings->cache_id = (size_t)curve_mapping; + curve_mapping_settings->cache_id = (size_t)curve_mapping + curve_mapping->changed_timestamp; } static void update_glsl_display_processor(const ColorManagedViewSettings *view_settings, |