Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_context.cpp
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| static std::vector<GLuint> orphaned_buffer_ids; | static std::vector<GLuint> orphaned_buffer_ids; | ||||
| static std::vector<GLuint> orphaned_texture_ids; | static std::vector<GLuint> orphaned_texture_ids; | ||||
| static std::mutex orphans_mutex; | static std::mutex orphans_mutex; | ||||
| static std::mutex main_context_mutex; | |||||
| struct GPUContext { | struct GPUContext { | ||||
| GLuint default_vao; | GLuint default_vao; | ||||
| GLuint default_framebuffer; | GLuint default_framebuffer; | ||||
| GPUFrameBuffer *current_fbo; | GPUFrameBuffer *current_fbo; | ||||
| std::unordered_set<GPUBatch *> batches; /* Batches that have VAOs from this context */ | std::unordered_set<GPUBatch *> batches; /* Batches that have VAOs from this context */ | ||||
| #ifdef DEBUG | #ifdef DEBUG | ||||
| std::unordered_set<GPUFrameBuffer *> | std::unordered_set<GPUFrameBuffer *> | ||||
| ▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | GPUFrameBuffer *gpu_context_active_framebuffer_get(GPUContext *ctx) | ||||
| return ctx->current_fbo; | return ctx->current_fbo; | ||||
| } | } | ||||
| struct GPUMatrixState *gpu_context_active_matrix_state_get() | struct GPUMatrixState *gpu_context_active_matrix_state_get() | ||||
| { | { | ||||
| BLI_assert(active_ctx); | BLI_assert(active_ctx); | ||||
| return active_ctx->matrix_state; | return active_ctx->matrix_state; | ||||
| } | } | ||||
| void GPU_context_main_lock(void) | |||||
| { | |||||
| main_context_mutex.lock(); | |||||
| } | |||||
| void GPU_context_main_unlock(void) | |||||
| { | |||||
| main_context_mutex.unlock(); | |||||
| } | |||||