37#ifdef WITH_VULKAN_BACKEND
40#ifdef WITH_OPENGL_BACKEND
44#ifdef WITH_METAL_BACKEND
355 g_ghost_system =
reinterpret_cast<GHOST_SystemHandle
>(ghost_system_handle);
390#if defined(WITH_OPENGL_BACKEND)
392#elif defined(WITH_METAL_BACKEND)
396#if defined(WITH_VULKAN_BACKEND)
416#ifdef WITH_OPENGL_BACKEND
422#ifdef WITH_VULKAN_BACKEND
428#ifdef WITH_METAL_BACKEND
455#ifdef WITH_OPENGL_BACKEND
457 g_backend = MEM_new<GLBackend>(__func__);
460#ifdef WITH_VULKAN_BACKEND
462 g_backend = MEM_new<VKBackend>(__func__);
465#ifdef WITH_METAL_BACKEND
467 g_backend = MEM_new<MTLBackend>(__func__);
471 g_backend = MEM_new<DummyBackend>(__func__);
501#ifdef WITH_OPENGL_BACKEND
507#ifdef WITH_METAL_BACKEND
513#ifdef WITH_VULKAN_BACKEND
536#ifdef WITH_OPENGL_BACKEND
538 return GHOST_kDrawingContextTypeOpenGL;
540#ifdef WITH_VULKAN_BACKEND
542 return GHOST_kDrawingContextTypeVulkan;
544#ifdef WITH_METAL_BACKEND
546 return GHOST_kDrawingContextTypeMetal;
573 GHOST_SystemHandle
ghost_system =
reinterpret_cast<GHOST_SystemHandle
>(
587 reinterpret_cast<GHOST_ContextHandle
>(ghost_context_));
606 GHOST_SystemHandle
ghost_system =
reinterpret_cast<GHOST_SystemHandle
>(
@ G_FLAG_GPU_BACKEND_FALLBACK
#define BLI_assert_unreachable()
int BLI_thread_is_main(void)
#define UNUSED_VARS_NDEBUG(...)
GHOST C-API function and type declarations.
GHOST_ContextHandle GHOST_CreateGPUContext(GHOST_SystemHandle systemhandle, GHOST_GPUSettings gpuSettings)
GHOST_TSuccess GHOST_ReleaseGPUContext(GHOST_ContextHandle contexthandle)
GHOST_ContextHandle GHOST_GetActiveGPUContext()
GHOST_TSuccess GHOST_ActivateGPUContext(GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_DisposeGPUContext(GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
static GHOST_SystemCocoa * ghost_system
GHOST_TDrawingContextType
@ GHOST_kDrawingContextTypeNone
#define GPU_batch_create(primitive_type, vertex_buf, index_buf)
#define GPU_BATCH_DISCARD_SAFE(batch)
void GPU_render_step(bool force_resource_release=false)
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
void GPU_context_main_lock()
void GPU_backend_type_selection_set(const eGPUBackendType backend)
bool GPU_backend_supported()
void * GPU_backend_ghost_system_get()
void GPU_context_begin_frame(GPUContext *ctx)
bool GPU_backend_type_selection_is_overridden()
GPUContext * GPU_context_active_get()
eGPUBackendType GPU_backend_type_selection_get()
void GPU_context_main_unlock()
void GPU_context_discard(GPUContext *)
bool GPU_backend_type_selection_detect()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_context_active_set(GPUContext *)
eGPUBackendType GPU_backend_get_type()
void GPU_backend_ghost_system_set(void *ghost_system_handle)
void GPU_backend_type_selection_set_override(eGPUBackendType backend_type)
void GPU_pass_cache_update()
#define GPU_vertbuf_create_with_format(format)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
Batch * procedural_lines_batch
Batch * procedural_triangles_batch
StateManager * state_manager
GPUMatrixState * matrix_state
bool shader_builtin_srgb_is_dirty
bool is_active_on_thread()
Batch * procedural_triangles_batch_get()
TexturePool * texture_pool
static int context_counter
FrameBuffer * front_right
VertBuf * dummy_vbo_get()
Batch * procedural_triangle_strips_batch_get()
Batch * procedural_points_batch
virtual void activate()=0
Batch * procedural_triangle_strips_batch
virtual void end_frame()=0
Batch * procedural_lines_batch_get()
virtual void begin_frame()=0
Batch * procedural_points_batch_get()
virtual void render_end()=0
static GPUBackend * get()
virtual void render_step(bool force_resource_release=false)=0
virtual void render_begin()=0
virtual Context * context_alloc(void *ghost_window, void *ghost_context)=0
static bool metal_is_supported()
static bool is_supported()
Simple API to draw debug shapes and log in the viewport.
static std::optional< bool > g_backend_type_supported
static bool gpu_backend_supported()
static int num_backend_users
static eGPUBackendType g_backend_type
static void gpu_backend_discard()
static blender::Mutex main_context_mutex
void gpu_backend_delete_resources()
void gpu_backend_init_resources()
static blender::Mutex backend_users_mutex
static void gpu_backend_create()
static GHOST_SystemHandle g_ghost_system
static GPUBackend * g_backend
static GHOST_TDrawingContextType ghost_context_type()
static std::optional< eGPUBackendType > g_backend_type_override
static Context * active_ctx
GPUMatrixState * GPU_matrix_state_create()
void GPU_matrix_state_discard(GPUMatrixState *state)
static Context * unwrap(GPUContext *ctx)
static GPUContext * wrap(Context *ctx)
void printf_begin(Context *ctx)
void printf_end(Context *ctx)
GHOST_TDrawingContextType context_type
GHOST_GPUDevice preferred_device