diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-10-14 20:18:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-10-14 20:26:44 +0300 |
commit | adc02910618c38c956c499e496278768ea0e041f (patch) | |
tree | 548d9276e0cc1275ba8c2313ef3b2caaad30bf54 /source/blender/draw/engines/workbench | |
parent | 57de5686048f1eac07985eb2991f0b6f6c4fee22 (diff) |
Fix T81633 Workbench: TAA never resolve when enabling both X-Ray and cavity
This was caused by a wrong flag equality check when in xray mode because
the xray mode was masking the effect option flags that are not supported
in this mode. This means the never passed and the TAA was reset before
every redraw, leading to infinite rendering.
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_data.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index 310a8b861aa..c566b35cd34 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -179,14 +179,21 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) } if (!v3d || (v3d->shading.type == OB_RENDER && BKE_scene_uses_blender_workbench(scene))) { + short shading_flag = scene->display.shading.flag; + if (XRAY_FLAG_ENABLED((&scene->display))) { + /* Disable shading options that aren't supported in transparency mode. */ + shading_flag &= ~(V3D_SHADING_SHADOW | V3D_SHADING_CAVITY | V3D_SHADING_DEPTH_OF_FIELD); + } + /* 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 && (XRAY_ENABLED(v3d) != XRAY_ENABLED(&scene->display))) || - (scene->display.shading.flag != wpd->shading.flag)) { + if ((XRAY_ENABLED(wpd) != XRAY_ENABLED(&scene->display)) || + (shading_flag != wpd->shading.flag)) { wpd->view_updated = true; } wpd->shading = scene->display.shading; + wpd->shading.flag = shading_flag; if (XRAY_FLAG_ENABLED((&scene->display))) { wpd->shading.xray_alpha = XRAY_ALPHA((&scene->display)); } @@ -206,13 +213,20 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) } } else { + short shading_flag = v3d->shading.flag; + if (XRAY_ENABLED(v3d)) { + /* Disable shading options that aren't supported in transparency mode. */ + shading_flag &= ~(V3D_SHADING_SHADOW | V3D_SHADING_CAVITY | V3D_SHADING_DEPTH_OF_FIELD); + } + /* 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 (XRAY_ENABLED(v3d) != XRAY_ENABLED(wpd) || v3d->shading.flag != wpd->shading.flag) { + if (XRAY_ENABLED(v3d) != XRAY_ENABLED(wpd) || shading_flag != wpd->shading.flag) { wpd->view_updated = true; } wpd->shading = v3d->shading; + wpd->shading.flag = shading_flag; if (wpd->shading.type < OB_SOLID) { wpd->shading.light = V3D_LIGHTING_FLAT; wpd->shading.color_type = V3D_SHADING_OBJECT_COLOR; @@ -220,8 +234,6 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) } else if (XRAY_ENABLED(v3d)) { wpd->shading.xray_alpha = XRAY_ALPHA(v3d); - /* Disable shading options that aren't supported in transparency mode. */ - wpd->shading.flag &= ~(V3D_SHADING_SHADOW | V3D_SHADING_CAVITY | V3D_SHADING_DEPTH_OF_FIELD); } else { wpd->shading.xray_alpha = 1.0f; |