GPU: Extract GPU Base Test case

The draw manager test case initialized ghost, gpu and draw manager. This
change splits the base test case to GPU specific and draw manager
specific test case.

The GPU test base test case will be used for low level GPU tests.
This commit is contained in:
2020-09-08 11:31:47 +02:00
parent 0d68f55789
commit ab6f59ff3b
5 changed files with 80 additions and 25 deletions

View File

@@ -0,0 +1,31 @@
/* Apache License, Version 2.0 */
#include "testing/testing.h"
#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};
ghost_system = GHOST_CreateSystem();
ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings);
context = GPU_context_create(NULL);
GPU_init();
}
void GPUTest::TearDown()
{
GPU_exit();
GPU_backend_exit();
GPU_context_discard(context);
GHOST_DisposeOpenGLContext(ghost_system, ghost_context);
GHOST_DisposeSystem(ghost_system);
}
} // namespace blender::gpu