37#ifdef WITH_VULKAN_BACKEND
40#ifdef WITH_OPENGL_BACKEND
44#ifdef WITH_METAL_BACKEND
356 g_ghost_system =
reinterpret_cast<GHOST_SystemHandle
>(ghost_system_handle);
406#if defined(WITH_OPENGL_BACKEND)
408#elif defined(WITH_METAL_BACKEND)
412#if defined(WITH_VULKAN_BACKEND)
432#ifdef WITH_OPENGL_BACKEND
438#ifdef WITH_VULKAN_BACKEND
444#ifdef WITH_METAL_BACKEND
471#ifdef WITH_OPENGL_BACKEND
473 g_backend = MEM_new<GLBackend>(__func__);
476#ifdef WITH_VULKAN_BACKEND
478 g_backend = MEM_new<VKBackend>(__func__);
481#ifdef WITH_METAL_BACKEND
483 g_backend = MEM_new<MTLBackend>(__func__);
487 g_backend = MEM_new<DummyBackend>(__func__);
517#ifdef WITH_OPENGL_BACKEND
523#ifdef WITH_METAL_BACKEND
529#ifdef WITH_VULKAN_BACKEND
570#ifdef WITH_OPENGL_BACKEND
572 return GHOST_kDrawingContextTypeOpenGL;
574#ifdef WITH_VULKAN_BACKEND
576 return GHOST_kDrawingContextTypeVulkan;
578#ifdef WITH_METAL_BACKEND
580 return GHOST_kDrawingContextTypeMetal;
607 GHOST_SystemHandle
ghost_system =
reinterpret_cast<GHOST_SystemHandle
>(
624 reinterpret_cast<GHOST_ContextHandle
>(ghost_context_));
643 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 gpu_settings)
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_backend_vsync_set_override(int vsync)
bool GPU_backend_vsync_is_overridden()
int GPU_backend_vsync_get()
void GPU_render_step(bool force_resource_release=false)
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
void GPU_context_main_lock()
bool GPU_backend_supported()
void * GPU_backend_ghost_system_get()
const char * GPU_backend_get_name()
void GPU_context_begin_frame(GPUContext *ctx)
bool GPU_backend_type_selection_is_overridden()
GPUContext * GPU_context_active_get()
void GPU_backend_type_selection_set(const GPUBackendType backend)
void GPU_backend_type_selection_set_override(GPUBackendType backend_type)
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 *)
GPUBackendType GPU_backend_get_type()
void GPU_backend_ghost_system_set(void *ghost_system_handle)
GPUBackendType GPU_backend_type_selection_get()
void GPU_pass_cache_update()
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &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 std::optional< GPUBackendType > g_backend_type_override
static GPUBackendType g_backend_type
static std::optional< int > g_vsync_override
static int num_backend_users
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 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