| 17 | namespace gpu |
| 18 | { |
| 19 | void ProgramManager::Init(ref_ptr<dp::GraphicsContext> context) |
| 20 | { |
| 21 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 22 | auto const apiVersion = context->GetApiVersion(); |
| 23 | if (apiVersion == dp::ApiVersion::OpenGLES3) |
| 24 | { |
| 25 | InitForOpenGL(context); |
| 26 | } |
| 27 | else if (apiVersion == dp::ApiVersion::Metal) |
| 28 | { |
| 29 | #if defined(OMIM_METAL_AVAILABLE) |
| 30 | InitForMetal(context); |
| 31 | #endif |
| 32 | } |
| 33 | else if (apiVersion == dp::ApiVersion::Vulkan) |
| 34 | { |
| 35 | InitForVulkan(context); |
| 36 | } |
| 37 | else |
| 38 | { |
| 39 | CHECK(false, ("Unsupported API version.")); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | void ProgramManager::Destroy(ref_ptr<dp::GraphicsContext> context) |
| 44 | { |
nothing calls this directly
no test coverage detected