Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_context.cc
| Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Backend selection | /** \name Backend selection | ||||
| * \{ */ | * \{ */ | ||||
| /* NOTE: To enable Metal API, we need to temporarily change this to `GPU_BACKEND_METAL`. | /* NOTE: To enable Metal API, we need to temporarily change this to `GPU_BACKEND_METAL`. | ||||
| * Until a global switch is added, Metal also needs to be enabled in GHOST_ContextCGL: | * Until a global switch is added, Metal also needs to be enabled in GHOST_ContextCGL: | ||||
| * `m_useMetalForRendering = true`. */ | * `m_useMetalForRendering = true`. */ | ||||
| static const eGPUBackendType g_backend_type = GPU_BACKEND_OPENGL; | static eGPUBackendType g_backend_type = GPU_BACKEND_OPENGL; | ||||
| static GPUBackend *g_backend = nullptr; | static GPUBackend *g_backend = nullptr; | ||||
| void GPU_backend_type_selection_set(const eGPUBackendType backend) | |||||
| { | |||||
| g_backend_type = backend; | |||||
| } | |||||
| eGPUBackendType GPU_backend_type_selection_get() | |||||
| { | |||||
| return g_backend_type; | |||||
| } | |||||
| bool GPU_backend_supported(void) | bool GPU_backend_supported(void) | ||||
| { | { | ||||
| switch (g_backend_type) { | switch (g_backend_type) { | ||||
| case GPU_BACKEND_OPENGL: | case GPU_BACKEND_OPENGL: | ||||
| #ifdef WITH_OPENGL_BACKEND | #ifdef WITH_OPENGL_BACKEND | ||||
| return true; | return true; | ||||
| #else | #else | ||||
| return false; | return false; | ||||
| ▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines | |||||