diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-14 02:06:49 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-14 02:10:25 +0300 |
commit | ecfbc5fb55d5035a5ac5f100801559d57ef156e3 (patch) | |
tree | 82f37cca66db05e2046eed08d025d1a4a8ed54a6 /source/blender/draw/intern/draw_manager_data.c | |
parent | ab7608af1bd40548cb79a0312f318a32d2fe8596 (diff) |
Fix T80603 Workbench: Inverted alpha when rendering
This was caused by a left over DRWPass->state modification
that made the subsequent samples redraw without Blending enabled.
This led to incorrect blending.
The fix is to use the new API for pass instancing.
Diffstat (limited to 'source/blender/draw/intern/draw_manager_data.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 81842f5d2ec..ca5d5170262 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -1962,6 +1962,8 @@ DRWPass *DRW_pass_create(const char *name, DRWState state) return pass; } +/* Create an instance of the original pass that will execute the same drawcalls but with its own + * DRWState. */ DRWPass *DRW_pass_create_instance(const char *name, DRWPass *original, DRWState state) { DRWPass *pass = DRW_pass_create(name, state); @@ -1980,6 +1982,10 @@ void DRW_pass_link(DRWPass *first, DRWPass *second) bool DRW_pass_is_empty(DRWPass *pass) { + if (pass->original) { + return DRW_pass_is_empty(pass->original); + } + LISTBASE_FOREACH (DRWShadingGroup *, shgroup, &pass->shgroups) { if (!DRW_shgroup_is_empty(shgroup)) { return false; |