From 133bf05b184bfeed3002be28c29199b5716b8f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 27 Apr 2020 21:13:53 +0200 Subject: Fix T75736 Viewport update problem when switching between view layers The problem comes from the fact by no data being modified when switching viewlayers. To follow what the external render engines do, we completely reset the viewport by freeing the GPUViewport to avoid any cached data from being kept. --- source/blender/draw/engines/workbench/workbench_data.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source/blender/draw/engines/workbench') diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index 24d95a13ee8..2e8119fca2f 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -217,8 +217,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) if (!v3d || (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene))) { /* FIXME: This reproduce old behavior when workbench was separated in 2 engines. * But this is a workaround for a missing update tagging from operators. */ - if (scene->display.shading.type != wpd->shading.type || - (v3d && (XRAY_ENABLED(v3d) != XRAY_ENABLED(&scene->display))) || + if ((v3d && (XRAY_ENABLED(v3d) != XRAY_ENABLED(&scene->display))) || (scene->display.shading.flag != wpd->shading.flag)) { wpd->view_updated = true; } @@ -245,8 +244,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) else { /* FIXME: This reproduce old behavior when workbench was separated in 2 engines. * But this is a workaround for a missing update tagging from operators. */ - if (v3d->shading.type != wpd->shading.type || XRAY_ENABLED(v3d) != XRAY_ENABLED(wpd) || - v3d->shading.flag != wpd->shading.flag) { + if (XRAY_ENABLED(v3d) != XRAY_ENABLED(wpd) || v3d->shading.flag != wpd->shading.flag) { wpd->view_updated = true; } -- cgit v1.2.3