Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-04-15 18:01:46 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-04-15 18:09:30 +0300
commitcc6db8921bdc497d75c495c843b913109adb9d4a (patch)
treef44c52e8d272eb9f351e649d448325d1857c7dda /source/blender/draw/intern
parent47d961a4b1c14b0cee2817de226ee356e711e146 (diff)
GPU: Make viewport not acquireable during rendering
This is a partial fix to the fact that rendering with EEVEE or other GL render engines is currently blocking the whole UI when asking to redraw a viewport. This patch just bypasses the viewport bind (containing the Draw Context lock) and the following drawing. There is an update tagging to not loose a viewport update if there was one asked. Other queries other than view redraw (such as selection depth drawing or offscreen drawing) will still block the whole UI as they need immediate data feedback. Ping @Severin for the change in `WM_draw_region_viewport_bind()`. I'm assuming this is not an issue because it's highly unlikely to bring up this operator during rendering. But in this case, it would just lock as usual. The bypassing in `DRW_notify_view_update` might be a bit overparanoid.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_manager.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index ec3a5b3a7b1..88d05fcd928 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1286,6 +1286,10 @@ void DRW_notify_view_update(const DRWUpdateContext *update_ctx)
const bool gpencil_engine_needed = drw_gpencil_engine_needed(depsgraph, v3d);
+ if (G.is_rendering) {
+ return;
+ }
+
/* XXX Really nasty locking. But else this could
* be executed by the material previews thread
* while rendering a viewport. */