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>2018-04-25 18:43:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-25 18:43:18 +0300
commit46bfdb48a19335d7db2114c697ccca05cb0011af (patch)
tree9ab7beb71732c0c01558f0b2a1101e260b5012b4 /source/blender/gpu/intern/gpu_init_exit.c
parent56fbdd790899301b4baf290ae693ceb9a4d5d467 (diff)
WM: Add GHOST lazy init for background mode.
This allows for background rendering with EEVEE and other opengl render engine. I've only tested it on Linux for the moment so I can't say about other platforms. We do lazy init because we cannot assume we will need Ghost for rendering before having parsed all arguments and we cannot know if a script will trigger rendering. This is also because it currently does not work without any display server (blender will crash).
Diffstat (limited to 'source/blender/gpu/intern/gpu_init_exit.c')
-rw-r--r--source/blender/gpu/intern/gpu_init_exit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_init_exit.c b/source/blender/gpu/intern/gpu_init_exit.c
index 5015d7c2372..c2f14687ff5 100644
--- a/source/blender/gpu/intern/gpu_init_exit.c
+++ b/source/blender/gpu/intern/gpu_init_exit.c
@@ -63,7 +63,9 @@ void GPU_init(void)
gpu_batch_init();
- immInit();
+ if (!G.background) {
+ immInit();
+ }
GPU_pbvh_fix_linking();
}
@@ -72,7 +74,9 @@ void GPU_init(void)
void GPU_exit(void)
{
- immDestroy();
+ if (!G.background) {
+ immDestroy();
+ }
gpu_batch_exit();