Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/tests/gpu_testing.cc
| /* Apache License, Version 2.0 */ | /* Apache License, Version 2.0 */ | ||||
| #include "testing/testing.h" | #include "testing/testing.h" | ||||
| #include "GPU_context.h" | #include "GPU_context.h" | ||||
| #include "GPU_init_exit.h" | #include "GPU_init_exit.h" | ||||
| #include "gpu_testing.hh" | #include "gpu_testing.hh" | ||||
| #include "CLG_log.h" | |||||
| #include "GHOST_C-api.h" | #include "GHOST_C-api.h" | ||||
| namespace blender::gpu { | namespace blender::gpu { | ||||
| void GPUTest::SetUp() | void GPUTest::SetUp() | ||||
| { | { | ||||
| GHOST_GLSettings glSettings = {0}; | GHOST_GLSettings glSettings = {0}; | ||||
| ghost_system = GHOST_CreateSystem(); | ghost_system = GHOST_CreateSystem(); | ||||
| ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings); | ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings); | ||||
| context = GPU_context_create(NULL); | context = GPU_context_create(NULL); | ||||
| CLG_init(); | |||||
| CLG_level_set(3); | |||||
| GPU_init(); | GPU_init(); | ||||
| } | } | ||||
| void GPUTest::TearDown() | void GPUTest::TearDown() | ||||
| { | { | ||||
| GPU_exit(); | GPU_exit(); | ||||
| GPU_backend_exit(); | GPU_backend_exit(); | ||||
| GPU_context_discard(context); | GPU_context_discard(context); | ||||
| CLG_exit(); | |||||
| GHOST_DisposeOpenGLContext(ghost_system, ghost_context); | GHOST_DisposeOpenGLContext(ghost_system, ghost_context); | ||||
| GHOST_DisposeSystem(ghost_system); | GHOST_DisposeSystem(ghost_system); | ||||
| } | } | ||||
| } // namespace blender::gpu | } // namespace blender::gpu | ||||