| 286 | } |
| 287 | |
| 288 | ref_ptr<HWTextureAllocator> GetDefaultAllocator(ref_ptr<dp::GraphicsContext> context) |
| 289 | { |
| 290 | CHECK(context != nullptr, ()); |
| 291 | auto const apiVersion = context->GetApiVersion(); |
| 292 | if (apiVersion == dp::ApiVersion::Metal) |
| 293 | { |
| 294 | #if defined(OMIM_METAL_AVAILABLE) |
| 295 | return GetDefaultMetalAllocator(); |
| 296 | #endif |
| 297 | CHECK(false, ("Metal rendering is supported now only on iOS.")); |
| 298 | return nullptr; |
| 299 | } |
| 300 | |
| 301 | if (apiVersion == dp::ApiVersion::Vulkan) |
| 302 | return GetDefaultVulkanAllocator(); |
| 303 | |
| 304 | static OpenGLHWTextureAllocator s_allocator; |
| 305 | return make_ref<HWTextureAllocator>(&s_allocator); |
| 306 | } |
| 307 | } // namespace dp |