2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: Apache-2.0 */
|
2020-09-08 11:31:47 +02:00
|
|
|
|
|
|
|
|
#include "testing/testing.h"
|
|
|
|
|
|
2021-05-10 07:59:10 +02:00
|
|
|
#include "CLG_log.h"
|
|
|
|
|
|
2020-09-08 11:31:47 +02:00
|
|
|
#include "GPU_context.h"
|
|
|
|
|
#include "GPU_init_exit.h"
|
|
|
|
|
#include "gpu_testing.hh"
|
|
|
|
|
|
|
|
|
|
#include "GHOST_C-api.h"
|
|
|
|
|
|
|
|
|
|
namespace blender::gpu {
|
|
|
|
|
|
|
|
|
|
void GPUTest::SetUp()
|
|
|
|
|
{
|
|
|
|
|
GHOST_GLSettings glSettings = {0};
|
2021-05-10 07:59:10 +02:00
|
|
|
CLG_init();
|
2020-09-08 11:31:47 +02:00
|
|
|
ghost_system = GHOST_CreateSystem();
|
|
|
|
|
ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings);
|
2021-11-08 15:49:51 +01:00
|
|
|
GHOST_ActivateOpenGLContext(ghost_context);
|
2021-04-09 13:09:15 +02:00
|
|
|
context = GPU_context_create(nullptr);
|
2020-09-08 11:31:47 +02:00
|
|
|
GPU_init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GPUTest::TearDown()
|
|
|
|
|
{
|
|
|
|
|
GPU_exit();
|
|
|
|
|
GPU_context_discard(context);
|
|
|
|
|
GHOST_DisposeOpenGLContext(ghost_system, ghost_context);
|
|
|
|
|
GHOST_DisposeSystem(ghost_system);
|
2021-05-10 07:59:10 +02:00
|
|
|
CLG_exit();
|
2020-09-08 11:31:47 +02:00
|
|
|
}
|
|
|
|
|
|
2020-10-02 09:48:41 +10:00
|
|
|
} // namespace blender::gpu
|