Blender  V3.3
gpu_testing.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0 */
2 
3 #include "testing/testing.h"
4 
5 #include "CLG_log.h"
6 
7 #include "GPU_context.h"
8 #include "GPU_init_exit.h"
9 #include "gpu_testing.hh"
10 
11 #include "GHOST_C-api.h"
12 
13 namespace blender::gpu {
14 
16 {
17  GHOST_GLSettings glSettings = {0};
18  CLG_init();
19  ghost_system = GHOST_CreateSystem();
20  ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings);
21  GHOST_ActivateOpenGLContext(ghost_context);
22  context = GPU_context_create(nullptr);
23  GPU_init();
24 }
25 
27 {
28  GPU_exit();
29  GPU_context_discard(context);
30  GHOST_DisposeOpenGLContext(ghost_system, ghost_context);
31  GHOST_DisposeSystem(ghost_system);
32  CLG_exit();
33 }
34 
35 } // namespace blender::gpu
void CLG_exit(void)
Definition: clog.c:703
void CLG_init(void)
Definition: clog.c:696
GHOST C-API function and type declarations.
GHOST_SystemHandle GHOST_CreateSystem(void)
Definition: GHOST_C-api.cpp:25
GHOST_TSuccess GHOST_DisposeOpenGLContext(GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_ActivateOpenGLContext(GHOST_ContextHandle contexthandle)
GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle, GHOST_GLSettings glSettings)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
Definition: GHOST_C-api.cpp:40
void GPU_context_discard(GPUContext *)
Definition: gpu_context.cc:110
GPUContext * GPU_context_create(void *ghost_window)
Definition: gpu_context.cc:93
void GPU_init(void)
Definition: gpu_init_exit.c:24
void GPU_exit(void)
Definition: gpu_init_exit.c:45
void TearDown() override
Definition: gpu_testing.cc:26
void SetUp() override
Definition: gpu_testing.cc:15