diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-04-06 11:21:29 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-04-06 11:28:31 +0300 |
commit | 480ff89bf7cfb1f9ffd5ce66fbd5c65288ef04c0 (patch) | |
tree | 0c7424fb974acdd0c71141b47286f763eeceb309 /source | |
parent | 999134b7ca6d3ad7b9c01141cc99d91a7ce8f98a (diff) |
Fix T75311, T75310: Edit Weight Paint Overlay Render Artifacts
During recent refactoring of the edit weight overlay we moved a
assignment before it was valid. Making everything one frame off what
resulted in a flashing frame during TAA, not drawing the overlay until a
second action happened, making overlays too bright.
The reason whas that the painting overlay wasn't initialized in the
first sample, but the draw passes and groups were filled. Resulting in
rendering the overlay twice or not at all.
This change moves the assignment to where it is valid.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_engine.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c index 19b0fa5e12b..207637fa131 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.c +++ b/source/blender/draw/engines/overlay/overlay_engine.c @@ -106,11 +106,12 @@ static void OVERLAY_cache_init(void *vedata) OVERLAY_Data *data = vedata; OVERLAY_StorageList *stl = data->stl; OVERLAY_PrivateData *pd = stl->pd; - const bool draw_edit_weights = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_WEIGHT); switch (pd->ctx_mode) { case CTX_MODE_EDIT_MESH: OVERLAY_edit_mesh_cache_init(vedata); + /* `pd->edit_mesh.flag` is valid after calling `OVERLAY_edit_mesh_cache_init`. */ + const bool draw_edit_weights = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_WEIGHT); if (draw_edit_weights) { OVERLAY_paint_cache_init(vedata); } |