Blender  V2.93
Namespaces | Macros | Functions | Variables
gpu_context.cc File Reference
#include "BLI_assert.h"
#include "BLI_utildefines.h"
#include "GPU_context.h"
#include "GPU_framebuffer.h"
#include "GHOST_C-api.h"
#include "gpu_backend.hh"
#include "gpu_batch_private.hh"
#include "gpu_context_private.hh"
#include "gpu_matrix_private.h"
#include "gl_backend.hh"
#include "gl_context.hh"
#include <mutex>
#include <vector>

Go to the source code of this file.

Namespaces

 blender
 
 blender::gpu
 

Macros

#define WITH_OPENGL_BACKEND   1
 

Functions

GPUContextGPU_context_create (void *ghost_window)
 
void GPU_context_discard (GPUContext *ctx_)
 
void GPU_context_active_set (GPUContext *ctx_)
 
GPUContextGPU_context_active_get (void)
 

Variables

static thread_local Contextactive_ctx = nullptr
 

Main context global mutex

Used to avoid crash on some old drivers.

static std::mutex main_context_mutex
 
void GPU_context_main_lock (void)
 
void GPU_context_main_unlock (void)
 

Backend selection

static GPUBackendg_backend
 
void GPU_backend_init (eGPUBackendType backend_type)
 
void GPU_backend_exit (void)
 

Detailed Description

Manage GL vertex array IDs in a thread-safe way Use these instead of glGenBuffers & its friends

Definition in file gpu_context.cc.

Macro Definition Documentation

◆ WITH_OPENGL_BACKEND

#define WITH_OPENGL_BACKEND   1

Definition at line 32 of file gpu_context.cc.

Function Documentation

◆ GPU_backend_exit()

void GPU_backend_exit ( void  )

Definition at line 183 of file gpu_context.cc.

References g_backend.

Referenced by blender::gpu::GPUTest::TearDown(), and WM_exit_ex().

◆ GPU_backend_init()

void GPU_backend_init ( eGPUBackendType  backend_type)

Definition at line 167 of file gpu_context.cc.

References BLI_assert, g_backend, and GPU_BACKEND_OPENGL.

Referenced by GPU_context_create().

◆ GPU_context_active_get()

GPUContext* GPU_context_active_get ( void  )

◆ GPU_context_active_set()

void GPU_context_active_set ( GPUContext ctx_)

◆ GPU_context_create()

GPUContext* GPU_context_create ( void *  ghost_window)

◆ GPU_context_discard()

void GPU_context_discard ( GPUContext ctx_)

◆ GPU_context_main_lock()

void GPU_context_main_lock ( void  )

◆ GPU_context_main_unlock()

void GPU_context_main_unlock ( void  )

Variable Documentation

◆ active_ctx

thread_local Context* active_ctx = nullptr
static

◆ g_backend

GPUBackend* g_backend
static

◆ main_context_mutex

std::mutex main_context_mutex
static

Definition at line 147 of file gpu_context.cc.

Referenced by GPU_context_main_lock(), and GPU_context_main_unlock().