Blender  V3.3
gpu_init_exit.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2013 Blender Foundation. All rights reserved. */
3 
8 #include "GPU_init_exit.h" /* interface */
9 #include "BLI_sys_types.h"
10 #include "GPU_batch.h"
11 
12 #include "intern/gpu_codegen.h"
13 #include "intern/gpu_private.h"
16 
22 static bool initialized = false;
23 
24 void GPU_init(void)
25 {
26  /* can't avoid calling this multiple times, see wm_window_ghostwindow_add */
27  if (initialized) {
28  return;
29  }
30 
31  initialized = true;
32 
35 
37 
39 
40 #ifndef GPU_STANDALONE
41  gpu_pbvh_init();
42 #endif
43 }
44 
45 void GPU_exit(void)
46 {
47 #ifndef GPU_STANDALONE
48  gpu_pbvh_exit();
49 #endif
50 
52 
54 
57 
59 
60  initialized = false;
61 }
62 
63 bool GPU_is_init(void)
64 {
65  return initialized;
66 }
void gpu_batch_init(void)
Definition: gpu_batch.cc:303
void gpu_batch_exit(void)
Definition: gpu_batch.cc:308
void gpu_pbvh_exit()
Definition: gpu_buffers.c:141
void gpu_pbvh_init()
Definition: gpu_buffers.c:137
void gpu_codegen_init(void)
Definition: gpu_codegen.cc:808
void gpu_codegen_exit(void)
Definition: gpu_codegen.cc:812
void gpu_backend_delete_resources()
Definition: gpu_context.cc:261
bool GPU_is_init(void)
Definition: gpu_init_exit.c:63
void GPU_init(void)
Definition: gpu_init_exit.c:24
static bool initialized
Definition: gpu_init_exit.c:22
void GPU_exit(void)
Definition: gpu_init_exit.c:45
void gpu_shader_create_info_exit()
void gpu_shader_create_info_init()
void gpu_shader_dependency_init()
void gpu_shader_dependency_exit()