GPU: Metal: Fix background render crash

GHOST_CreateSystemBackground was not being
followed by the now mandatory GPU_backend_ghost_system_set
This commit is contained in:
Clément Foucault
2024-09-30 14:20:03 +02:00
parent 5163af816d
commit d401b36509
3 changed files with 3 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ void ShaderBuilder::init_system()
{
CLG_init();
ghost_system_ = GHOST_CreateSystemBackground();
GPU_backend_ghost_system_set(ghost_system_);
}
bool ShaderBuilder::init_context()

View File

@@ -167,6 +167,7 @@ void GPU_compilation_subprocess_run(const char *subprocess_name)
GHOST_SystemHandle ghost_system = GHOST_CreateSystemBackground();
BLI_assert(ghost_system);
GPU_backend_ghost_system_set(ghost_system);
GHOST_GPUSettings gpu_settings = {0};
gpu_settings.context_type = GHOST_kDrawingContextTypeOpenGL;
GHOST_ContextHandle ghost_context = GHOST_CreateGPUContext(ghost_system, gpu_settings);

View File

@@ -1930,6 +1930,7 @@ void wm_ghost_init_background()
GHOST_SetBacktraceHandler((GHOST_TBacktraceFn)BLI_system_backtrace);
g_system = GHOST_CreateSystemBackground();
GPU_backend_ghost_system_set(g_system);
GHOST_Debug debug = {0};
if (G.debug & G_DEBUG_GHOST) {