diff options
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.h | 1 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index a86b8e9d508..c7256dd986f 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -662,6 +662,7 @@ static void drw_viewport_var_init(void) } DST.view_active = DST.view_default; + DST.view_previous = NULL; } else { zero_v3(DST.screenvecs[0]); @@ -670,6 +671,7 @@ static void drw_viewport_var_init(void) DST.pixsize = 1.0f; DST.view_default = NULL; DST.view_active = NULL; + DST.view_previous = NULL; } /* fclem: Is this still needed ? */ diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 0ccffceb37a..665cc6e2c7d 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -323,6 +323,7 @@ typedef struct DRWManager { DRWView *view_default; DRWView *view_active; + DRWView *view_previous; uint primary_view_ct; /** TODO(fclem) Remove this. Only here to support * shaders without common_view_lib.glsl */ diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 2687d0ea094..addd45093a8 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -981,7 +981,11 @@ static void drw_draw_pass_ex(DRWPass *pass, BLI_assert(DST.buffer_finish_called && "DRW_render_instance_buffer_finish had not been called before drawing"); - drw_update_view(); + if (DST.view_previous != DST.view_active || DST.view_active->is_dirty) { + drw_update_view(); + DST.view_active->is_dirty = false; + DST.view_previous = DST.view_active; + } /* GPU_framebuffer_clear calls can change the state outside the DRW module. * Force reset the affected states to avoid problems later. */ |