@@ -521,7 +521,7 @@ static void _dev_pixelpipe_synch(dt_dev_pixelpipe_t *pipe,
521
521
if (active && hist -> iop_order == INT_MAX )
522
522
{
523
523
piece -> enabled = FALSE;
524
- dt_print_pipe (DT_DEBUG_PARAMS | DT_DEBUG_PIPE | DT_DEBUG_IOPORDER , "dt_dev_pixelpipe_synch" ,
524
+ dt_print_pipe (DT_DEBUG_PARAMS | DT_DEBUG_PIPE , "dt_dev_pixelpipe_synch" ,
525
525
pipe , piece -> module , DT_DEVICE_NONE , NULL , NULL ,
526
526
"enabled module with iop_order of INT_MAX is disabled" );
527
527
}
@@ -633,34 +633,42 @@ void dt_dev_pixelpipe_synch_top(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev)
633
633
void dt_dev_pixelpipe_change (dt_dev_pixelpipe_t * pipe , dt_develop_t * dev )
634
634
{
635
635
dt_pthread_mutex_lock (& dev -> history_mutex );
636
-
637
- dt_print_pipe (DT_DEBUG_PIPE , "pipe state changing" ,
638
- pipe , NULL , DT_DEVICE_NONE , NULL , NULL , "%s%s%s%s" ,
636
+ dt_print_pipe (DT_DEBUG_PIPE , "dev_pixelpipe_change" ,
637
+ pipe , NULL , DT_DEVICE_NONE , NULL , NULL , "%s%s%s%s%s" ,
639
638
pipe -> changed & DT_DEV_PIPE_ZOOMED ? "zoomed, " : "" ,
640
639
pipe -> changed & DT_DEV_PIPE_TOP_CHANGED ? "top changed, " : "" ,
641
640
pipe -> changed & DT_DEV_PIPE_SYNCH ? "synch all, " : "" ,
642
- pipe -> changed & DT_DEV_PIPE_REMOVE ? "pipe remove" : "" );
643
- // case DT_DEV_PIPE_UNCHANGED: case DT_DEV_PIPE_ZOOMED:
644
- if (pipe -> changed & DT_DEV_PIPE_TOP_CHANGED )
645
- {
646
- // only top history item changed.
647
- dt_dev_pixelpipe_synch_top (pipe , dev );
648
- }
649
- if (pipe -> changed & DT_DEV_PIPE_SYNCH )
650
- {
651
- // pipeline topology remains intact, only change all params.
652
- dt_dev_pixelpipe_synch_all (pipe , dev );
653
- }
654
- if (pipe -> changed & DT_DEV_PIPE_REMOVE )
641
+ pipe -> changed & DT_DEV_PIPE_REMOVE ? "pipe remove" : "" ,
642
+ pipe -> changed == DT_DEV_PIPE_UNCHANGED ? "dimension" : "" );
643
+
644
+ if (pipe -> changed & (DT_DEV_PIPE_TOP_CHANGED | DT_DEV_PIPE_SYNCH | DT_DEV_PIPE_REMOVE ))
655
645
{
656
- // modules have been added in between or removed. need to rebuild
657
- // the whole pipeline.
658
- dt_dev_pixelpipe_cleanup_nodes (pipe );
659
- dt_dev_pixelpipe_create_nodes (pipe , dev );
660
- dt_dev_pixelpipe_synch_all (pipe , dev );
646
+ const gboolean sync_all = pipe -> changed & (DT_DEV_PIPE_SYNCH | DT_DEV_PIPE_REMOVE );
647
+ const gboolean sync_remove = pipe -> changed & DT_DEV_PIPE_REMOVE ;
648
+
649
+ if ((pipe -> changed & DT_DEV_PIPE_TOP_CHANGED ) && !sync_all )
650
+ {
651
+ // only top history item changed. Not required if we synch_all
652
+ dt_dev_pixelpipe_synch_top (pipe , dev );
653
+ }
654
+
655
+ if ((pipe -> changed & DT_DEV_PIPE_SYNCH ) && !sync_remove )
656
+ {
657
+ // pipeline topology remains intact but change all params. Not required if we rebuild all nodes
658
+ dt_dev_pixelpipe_synch_all (pipe , dev );
659
+ }
660
+
661
+ if (pipe -> changed & DT_DEV_PIPE_REMOVE )
662
+ {
663
+ // modules have been added in between or removed. need to rebuild the whole pipeline.
664
+ dt_dev_pixelpipe_cleanup_nodes (pipe );
665
+ dt_dev_pixelpipe_create_nodes (pipe , dev );
666
+ dt_dev_pixelpipe_synch_all (pipe , dev );
667
+ }
661
668
}
662
669
pipe -> changed = DT_DEV_PIPE_UNCHANGED ;
663
670
dt_pthread_mutex_unlock (& dev -> history_mutex );
671
+
664
672
dt_dev_pixelpipe_get_dimensions (pipe , dev ,
665
673
pipe -> iwidth , pipe -> iheight ,
666
674
& pipe -> processed_width ,
@@ -1413,7 +1421,7 @@ static gboolean _dev_pixelpipe_process_rec(dt_dev_pixelpipe_t *pipe,
1413
1421
if (dt_atomic_get_int (& pipe -> shutdown ))
1414
1422
return TRUE;
1415
1423
1416
- const dt_hash_t hash = dt_dev_pixelpipe_cache_hash (pipe -> image .id , roi_out , pipe , module ? module -> iop_order : 0 );
1424
+ dt_hash_t hash = dt_dev_pixelpipe_cache_hash (pipe -> image .id , roi_out , pipe , pos );
1417
1425
1418
1426
// we do not want data from the preview pixelpipe cache
1419
1427
// for gamma so we can compute the final scope
@@ -2256,7 +2264,7 @@ static gboolean _dev_pixelpipe_process_rec(dt_dev_pixelpipe_t *pipe,
2256
2264
*/
2257
2265
important_cl =
2258
2266
(pipe -> mask_display == DT_DEV_PIXELPIPE_DISPLAY_NONE )
2259
- && ( pipe -> type & DT_DEV_PIXELPIPE_BASIC )
2267
+ && pipe -> type & DT_DEV_PIXELPIPE_BASIC
2260
2268
&& dev -> gui_attached
2261
2269
&& ((module == dt_dev_gui_module ())
2262
2270
|| darktable .develop -> history_last_module == module
@@ -2859,7 +2867,7 @@ gboolean dt_dev_pixelpipe_process(dt_dev_pixelpipe_t *pipe,
2859
2867
2860
2868
// terminate
2861
2869
dt_pthread_mutex_lock (& pipe -> backbuf_mutex );
2862
- pipe -> backbuf_hash = dt_dev_pixelpipe_cache_hash (pipe -> image .id , & roi , pipe , INT_MAX );
2870
+ pipe -> backbuf_hash = dt_dev_pixelpipe_cache_hash (pipe -> image .id , & roi , pipe , pos );
2863
2871
2864
2872
//FIXME lock/release cache line instead of copying
2865
2873
if (pipe -> type & DT_DEV_PIXELPIPE_SCREEN )
@@ -2906,6 +2914,8 @@ void dt_dev_pixelpipe_get_dimensions(dt_dev_pixelpipe_t *pipe,
2906
2914
{
2907
2915
dt_pthread_mutex_lock (& pipe -> busy_mutex );
2908
2916
dt_iop_roi_t roi_in = (dt_iop_roi_t ){ 0 , 0 , width_in , height_in , 1.0 };
2917
+ dt_print_pipe (DT_DEBUG_PIPE ,
2918
+ "get dimensions" , pipe , NULL , DT_DEVICE_NONE , & roi_in , NULL , "ID=%i" , pipe -> image .id );
2909
2919
dt_iop_roi_t roi_out ;
2910
2920
GList * modules = pipe -> iop ;
2911
2921
GList * pieces = pipe -> nodes ;
@@ -2922,8 +2932,7 @@ void dt_dev_pixelpipe_get_dimensions(dt_dev_pixelpipe_t *pipe,
2922
2932
module -> modify_roi_out (module , piece , & roi_out , & roi_in );
2923
2933
if ((darktable .unmuted & DT_DEBUG_PIPE ) && memcmp (& roi_out , & roi_in , sizeof (dt_iop_roi_t )))
2924
2934
dt_print_pipe (DT_DEBUG_PIPE ,
2925
- "modify roi OUT" , piece -> pipe , module , DT_DEVICE_NONE , & roi_in , & roi_out , "ID=%i" ,
2926
- pipe -> image .id );
2935
+ "modify roi OUT" , pipe , module , DT_DEVICE_NONE , & roi_in , & roi_out );
2927
2936
}
2928
2937
else
2929
2938
{
@@ -3054,7 +3063,6 @@ float *dt_dev_get_raster_mask(dt_dev_pixelpipe_iop_t *piece,
3054
3063
if (!_skip_piece_on_tags (it_piece ))
3055
3064
{
3056
3065
if (it_piece -> module -> distort_mask
3057
- && it_piece -> enabled
3058
3066
// hack against pipes not using finalscale
3059
3067
&& !(dt_iop_module_is (it_piece -> module -> so , "finalscale" )
3060
3068
&& it_piece -> processed_roi_in .width == 0
0 commit comments