diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-12-05 15:31:53 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-12-05 15:32:04 +0300 |
commit | d21a8dcae295154c71b8c5c6d480d877af5c0b2a (patch) | |
tree | 901fdf566b3cb5955cc29489ef65453e45858c3b | |
parent | c402a4847bab2ad86319f31dcec1ae395517c252 (diff) |
Overlay Engine: Fix crash in select mode with Lock Object Modes off
Fixes T72189: Crash when Lock Object Modes off and switching from Sculpt mode to Object mode
5 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_edit_curve.c b/source/blender/draw/engines/overlay/overlay_edit_curve.c index e4b0c1bcecb..b39dc39fd47 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_curve.c +++ b/source/blender/draw/engines/overlay/overlay_edit_curve.c @@ -121,7 +121,9 @@ void OVERLAY_edit_curve_draw(OVERLAY_Data *vedata) OVERLAY_PassList *psl = vedata->psl; OVERLAY_FramebufferList *fbl = vedata->fbl; - GPU_framebuffer_bind(fbl->overlay_default_fb); + if (DRW_state_is_fbo()) { + GPU_framebuffer_bind(fbl->overlay_default_fb); + } DRW_draw_pass(psl->edit_curve_wire_ps[0]); DRW_draw_pass(psl->edit_curve_wire_ps[1]); diff --git a/source/blender/draw/engines/overlay/overlay_edit_text.c b/source/blender/draw/engines/overlay/overlay_edit_text.c index b4e439b2c41..0975608a300 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_text.c +++ b/source/blender/draw/engines/overlay/overlay_edit_text.c @@ -193,8 +193,10 @@ void OVERLAY_edit_text_draw(OVERLAY_Data *vedata) OVERLAY_PassList *psl = vedata->psl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); - /* Text overlay need final color for color inversion. */ - GPU_framebuffer_bind(dfbl->default_fb); + if (DRW_state_is_fbo()) { + /* Text overlay need final color for color inversion. */ + GPU_framebuffer_bind(dfbl->default_fb); + } DRW_draw_pass(psl->edit_text_wire_ps[0]); DRW_draw_pass(psl->edit_text_wire_ps[1]); diff --git a/source/blender/draw/engines/overlay/overlay_lattice.c b/source/blender/draw/engines/overlay/overlay_lattice.c index 3ccf85b71dc..84d9dcc3e94 100644 --- a/source/blender/draw/engines/overlay/overlay_lattice.c +++ b/source/blender/draw/engines/overlay/overlay_lattice.c @@ -75,7 +75,9 @@ void OVERLAY_edit_lattice_draw(OVERLAY_Data *vedata) OVERLAY_PassList *psl = vedata->psl; OVERLAY_FramebufferList *fbl = vedata->fbl; - GPU_framebuffer_bind(fbl->overlay_default_fb); + if (DRW_state_is_fbo()) { + GPU_framebuffer_bind(fbl->overlay_default_fb); + } DRW_draw_pass(psl->edit_lattice_ps); } diff --git a/source/blender/draw/engines/overlay/overlay_particle.c b/source/blender/draw/engines/overlay/overlay_particle.c index 2983573acb7..3540de35e46 100644 --- a/source/blender/draw/engines/overlay/overlay_particle.c +++ b/source/blender/draw/engines/overlay/overlay_particle.c @@ -122,7 +122,9 @@ void OVERLAY_edit_particle_draw(OVERLAY_Data *vedata) OVERLAY_PassList *psl = vedata->psl; OVERLAY_FramebufferList *fbl = vedata->fbl; - GPU_framebuffer_bind(fbl->overlay_default_fb); + if (DRW_state_is_fbo()) { + GPU_framebuffer_bind(fbl->overlay_default_fb); + } DRW_draw_pass(psl->edit_particle_ps); } diff --git a/source/blender/draw/engines/overlay/overlay_sculpt.c b/source/blender/draw/engines/overlay/overlay_sculpt.c index ab3f87e9736..dc286d36e9e 100644 --- a/source/blender/draw/engines/overlay/overlay_sculpt.c +++ b/source/blender/draw/engines/overlay/overlay_sculpt.c @@ -62,7 +62,9 @@ void OVERLAY_sculpt_draw(OVERLAY_Data *vedata) OVERLAY_PassList *psl = vedata->psl; OVERLAY_FramebufferList *fbl = vedata->fbl; - GPU_framebuffer_bind(fbl->overlay_default_fb); + if (DRW_state_is_fbo()) { + GPU_framebuffer_bind(fbl->overlay_default_fb); + } DRW_draw_pass(psl->sculpt_mask_ps); } |