|
Blender
V2.93
|
#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 | |
| GPUContext * | GPU_context_create (void *ghost_window) |
| void | GPU_context_discard (GPUContext *ctx_) |
| void | GPU_context_active_set (GPUContext *ctx_) |
| GPUContext * | GPU_context_active_get (void) |
Variables | |
| static thread_local Context * | active_ctx = nullptr |
Main context global mutex | |
| static std::mutex | main_context_mutex |
| void | GPU_context_main_lock (void) |
| void | GPU_context_main_unlock (void) |
Backend selection | |
| static GPUBackend * | g_backend |
| void | GPU_backend_init (eGPUBackendType backend_type) |
| void | GPU_backend_exit (void) |
Manage GL vertex array IDs in a thread-safe way Use these instead of glGenBuffers & its friends
Definition in file gpu_context.cc.
| #define WITH_OPENGL_BACKEND 1 |
Definition at line 32 of file gpu_context.cc.
| 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().
| 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().
| GPUContext* GPU_context_active_get | ( | void | ) |
Definition at line 136 of file gpu_context.cc.
References blender::gpu::wrap().
Referenced by pygpu_framebuffer__tp_new(), pygpu_offscreen__tp_new(), pygpu_texture__tp_new(), and pygpu_uniformbuffer__tp_new().
| void GPU_context_active_set | ( | GPUContext * | ctx_ | ) |
Definition at line 121 of file gpu_context.cc.
References blender::gpu::Context::activate(), active_ctx, blender::gpu::Context::deactivate(), and blender::gpu::unwrap().
Referenced by drw_deferred_shader_add(), drw_deferred_shader_compilation_exec(), drw_deferred_shader_compilation_free(), DRW_gpu_render_context_disable(), DRW_gpu_render_context_enable(), DRW_opengl_context_destroy(), DRW_opengl_context_disable_ex(), DRW_opengl_context_enable_ex(), extrawindow_do_draw(), extrawindow_do_reshape(), GPU_context_create(), loggerwindow_do_draw(), loggerwindow_do_reshape(), mainwindow_do_draw(), mainwindow_do_reshape(), RE_gl_context_destroy(), wm_ghostwindow_destroy(), wm_main_playanim_intern(), wm_surface_clear_drawable(), wm_surface_set_drawable(), WM_window_pixel_sample_read(), WM_window_pixels_read(), and wm_window_set_drawable().
| GPUContext* GPU_context_create | ( | void * | ghost_window | ) |
Definition at line 99 of file gpu_context.cc.
References GPU_backend_init(), GPU_BACKEND_OPENGL, GPU_context_active_set(), and blender::gpu::wrap().
Referenced by drw_deferred_shader_add(), DRW_opengl_context_create(), eevee_lightbake_context_enable(), extrawindow_new(), loggerwindow_new(), mainwindow_new(), RE_gpu_context_get(), blender::gpu::GPUTest::SetUp(), wm_main_playanim_intern(), and wm_window_ghostwindow_add().
| void GPU_context_discard | ( | GPUContext * | ctx_ | ) |
Definition at line 113 of file gpu_context.cc.
References active_ctx, and blender::gpu::unwrap().
Referenced by drw_deferred_shader_compilation_free(), DRW_opengl_context_destroy(), eevee_lightbake_delete_resources(), RE_gl_context_destroy(), blender::gpu::GPUTest::TearDown(), wm_ghostwindow_destroy(), and wm_main_playanim_intern().
| void GPU_context_main_lock | ( | void | ) |
Definition at line 149 of file gpu_context.cc.
References main_context_mutex.
Referenced by drw_deferred_shader_compilation_exec(), DRW_render_context_enable(), eevee_lightbake_context_enable(), and wm_draw_update().
| void GPU_context_main_unlock | ( | void | ) |
Definition at line 154 of file gpu_context.cc.
References main_context_mutex.
Referenced by drw_deferred_shader_compilation_exec(), DRW_render_context_disable(), eevee_lightbake_context_disable(), and wm_draw_update().
|
static |
Definition at line 57 of file gpu_context.cc.
Referenced by blender::gpu::Context::get(), GPU_context_active_set(), GPU_context_discard(), and blender::gpu::Context::is_active_on_thread().
|
static |
Definition at line 165 of file gpu_context.cc.
Referenced by blender::gpu::GPUBackend::get(), GPU_backend_exit(), and GPU_backend_init().
|
static |
Definition at line 147 of file gpu_context.cc.
Referenced by GPU_context_main_lock(), and GPU_context_main_unlock().