Blender
V3.3
|
#include <gl_context.hh>
Public Member Functions | |
Constructor / Destructor | |
GLContext (void *ghost_window, GLSharedOrphanLists &shared_orphan_list) | |
~GLContext () | |
Activate / Deactivate context | |
void | activate () override |
void | deactivate () override |
void | begin_frame () override |
void | end_frame () override |
Flush, Finish & sync | |
void | flush () override |
void | finish () override |
Memory statistics | |
void | memory_statistics_get (int *total_mem, int *free_mem) override |
Linked object deletion | |
These objects contain data that are stored per context. We need to do some cleanup if they are used across context or if context is discarded. | |
void | vao_cache_register (GLVaoCache *cache) |
void | vao_cache_unregister (GLVaoCache *cache) |
Debug Groups | |
Useful for debugging through render-doc. This makes all the API calls grouped into "passes". | |
void | debug_group_begin (const char *name, int index) override |
void | debug_group_end () override |
![]() | |
Context () | |
virtual | ~Context () |
bool | is_active_on_thread () |
Static Public Member Functions | |
static void | check_error (const char *info) |
static GLContext * | get () |
static GLStateManager * | state_manager_active_get () |
![]() | |
static Context * | get () |
Public Attributes | |
GLuint | default_attr_vbo_ |
uint16_t | bound_ubo_slots |
![]() | |
Shader * | shader = nullptr |
FrameBuffer * | active_fb = nullptr |
GPUMatrixState * | matrix_state = nullptr |
StateManager * | state_manager = nullptr |
Immediate * | imm = nullptr |
FrameBuffer * | back_left = nullptr |
FrameBuffer * | front_left = nullptr |
FrameBuffer * | back_right = nullptr |
FrameBuffer * | front_right = nullptr |
DebugStack | debug_stack |
Safe object deletion | |
GPU objects can be freed when the context is not bound. In this case we delay the deletion until the context is bound again. | |
void | vao_free (GLuint vao_id) |
void | fbo_free (GLuint fbo_id) |
static void | buf_free (GLuint buf_id) |
static void | tex_free (GLuint tex_id) |
Additional Inherited Members | |
![]() | |
pthread_t | thread_ |
bool | is_active_ |
void * | ghost_window_ |
Definition at line 40 of file gl_context.hh.
GLContext::GLContext | ( | void * | ghost_window, |
GLSharedOrphanLists & | shared_orphan_list | ||
) |
Definition at line 35 of file gl_context.cc.
References blender::gpu::Context::active_fb, blender::gpu::Context::back_left, blender::gpu::Context::back_right, bounds(), data, default_attr_vbo_, blender::gpu::Context::front_left, blender::gpu::Context::front_right, G, G_DEBUG_GPU, GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetDefaultOpenGLFramebuffer(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), blender::gpu::Context::ghost_window_, blender::gpu::Context::imm, blender::gpu::debug::init_gl_callbacks(), blender::gpu::Context::state_manager, and w().
GLContext::~GLContext | ( | ) |
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 107 of file gl_context.cc.
References blender::gpu::Context::back_left, blender::gpu::Context::back_right, BLI_assert, bound_ubo_slots, bounds(), blender::gpu::Context::front_left, blender::gpu::Context::front_right, GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), blender::gpu::Context::ghost_window_, immActivate(), blender::gpu::Context::is_active_, blender::gpu::FrameBuffer::size_set(), blender::gpu::Context::thread_, and w().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 152 of file gl_context.cc.
|
static |
Definition at line 250 of file gl_context.cc.
References blender::gpu::GLSharedOrphanLists::buffers, blender::gpu::GLBackend::get(), get(), blender::gpu::GLSharedOrphanLists::lists_mutex, and blender::gpu::GLBackend::shared_orphan_list_get().
Referenced by blender::gpu::GLVertBuf::release_data(), blender::gpu::GLDrawList::~GLDrawList(), blender::gpu::GLIndexBuf::~GLIndexBuf(), blender::gpu::GLStorageBuf::~GLStorageBuf(), and blender::gpu::GLUniformBuf::~GLUniformBuf().
|
static |
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 146 of file gl_context.cc.
References immDeactivate(), and blender::gpu::Context::is_active_.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 366 of file gl_debug.cc.
References G, and G_DEBUG_GPU.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 375 of file gl_debug.cc.
References G, and G_DEBUG_GPU.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 157 of file gl_context.cc.
void GLContext::fbo_free | ( | GLuint | fbo_id | ) |
Definition at line 240 of file gl_context.cc.
References get().
Referenced by blender::gpu::GLFrameBuffer::~GLFrameBuffer().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 173 of file gl_context.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 168 of file gl_context.cc.
|
inlinestatic |
Definition at line 117 of file gl_context.hh.
References blender::gpu::Context::get().
Referenced by blender::gpu::GLVaoCache::base_instance_vao_get(), blender::gpu::GLVertBuf::bind(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::GLBatch::bind(), blender::gpu::GLUniformBuf::bind(), buf_free(), blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::debug::check_gl_resources(), blender::gpu::GLVaoCache::clear(), blender::gpu::GLFrameBuffer::clear(), blender::gpu::GLFrameBuffer::clear_attachment(), blender::gpu::GLBackend::compute_dispatch(), blender::gpu::GLBackend::compute_dispatch_indirect(), blender::gpu::GLVertBuf::duplicate_data(), blender::gpu::GLImmediate::end(), fbo_free(), blender::gpu::GLShader::GLShader(), blender::gpu::GLTexture::GLTexture(), blender::gpu::GLSharedOrphanLists::orphans_clear(), state_manager_active_get(), blender::gpu::GLDrawList::submit(), tex_free(), blender::gpu::GLUniformBuf::unbind(), blender::gpu::GLVertArray::update_bindings(), vao_free(), blender::gpu::GLVaoCache::vao_get(), blender::gpu::GLShader::~GLShader(), and blender::gpu::GLTexture::~GLTexture().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 304 of file gl_context.cc.
|
inlinestatic |
Definition at line 122 of file gl_context.hh.
References get(), and blender::gpu::Context::state_manager.
Referenced by blender::gpu::GLBackend::compute_dispatch(), blender::gpu::GLBackend::compute_dispatch_indirect(), blender::gpu::GLTexture::generate_mipmap(), blender::gpu::GLTexture::init_internal(), blender::gpu::GLTexture::mip_range_set(), blender::gpu::GLTexture::read(), blender::gpu::GLTexture::stencil_texture_mode_set(), blender::gpu::GLTexture::swizzle_set(), and blender::gpu::GLTexture::update_sub().
|
static |
Definition at line 262 of file gl_context.cc.
References blender::gpu::GLBackend::get(), get(), blender::gpu::GLSharedOrphanLists::lists_mutex, blender::gpu::GLBackend::shared_orphan_list_get(), and blender::gpu::GLSharedOrphanLists::textures.
Referenced by blender::gpu::GLTexture::~GLTexture().
void GLContext::vao_cache_register | ( | GLVaoCache * | cache | ) |
Definition at line 284 of file gl_context.cc.
void GLContext::vao_cache_unregister | ( | GLVaoCache * | cache | ) |
Definition at line 291 of file gl_context.cc.
Referenced by blender::gpu::GLVaoCache::clear().
void GLContext::vao_free | ( | GLuint | vao_id | ) |
Definition at line 230 of file gl_context.cc.
References get().
Referenced by blender::gpu::GLVaoCache::clear(), blender::gpu::GLVaoCache::insert(), and blender::gpu::GLVaoCache::remove().
|
static |
Extensions.
Definition at line 53 of file gl_context.hh.
Referenced by blender::gpu::GLBatch::bind(), blender::gpu::detect_workarounds(), and blender::gpu::GLBatch::draw().
uint16_t blender::gpu::GLContext::bound_ubo_slots |
Used for debugging purpose. Bitflags of all bound slots.
Definition at line 84 of file gl_context.hh.
Referenced by activate(), blender::gpu::GLUniformBuf::bind(), blender::gpu::debug::check_gl_resources(), and blender::gpu::GLUniformBuf::unbind().
|
static |
Definition at line 54 of file gl_context.hh.
Referenced by blender::gpu::GLTexture::clear(), and blender::gpu::detect_workarounds().
|
static |
Definition at line 55 of file gl_context.hh.
Referenced by blender::gpu::GLTexture::copy_to(), and blender::gpu::detect_workarounds().
|
static |
Definition at line 56 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Workarounds.
Definition at line 75 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
GLuint blender::gpu::GLContext::default_attr_vbo_ |
VBO for missing vertex attrib binding. Avoid undefined behavior on some implementation.
Definition at line 81 of file gl_context.hh.
Referenced by GLContext(), blender::gpu::GLVertArray::update_bindings(), and ~GLContext().
|
static |
Definition at line 78 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and glsl_patch_default_get().
|
static |
Definition at line 57 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::clear(), blender::gpu::GLStorageBuf::copy_sub(), blender::gpu::detect_workarounds(), blender::gpu::GLTexture::generate_mipmap(), blender::gpu::GLTexture::init_internal(), blender::gpu::GLTexture::mip_range_set(), blender::gpu::GLTexture::read(), blender::gpu::GLTexture::stencil_texture_mode_set(), blender::gpu::GLTexture::swizzle_set(), and blender::gpu::GLTexture::update_sub().
|
static |
Definition at line 58 of file gl_context.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), print_resource(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
Definition at line 60 of file gl_context.hh.
Referenced by blender::gpu::GLBatch::bind(), blender::gpu::detect_workarounds(), and blender::gpu::GLStateManager::GLStateManager().
|
static |
Definition at line 77 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLTexture::generate_mipmap().
|
static |
Definition at line 59 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), blender::gpu::GLShader::geometry_layout_declare(), and glsl_patch_default_get().
|
static |
Definition at line 61 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), glsl_patch_default_get(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
|
static |
Definition at line 49 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::bind().
|
static |
Definition at line 48 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::GLStorageBuf().
|
static |
Definition at line 45 of file gl_context.hh.
|
static |
Definition at line 47 of file gl_context.hh.
Referenced by blender::gpu::GLUniformBuf::bind().
|
static |
Definition at line 46 of file gl_context.hh.
Referenced by blender::gpu::GLUniformBuf::GLUniformBuf().
|
static |
Definition at line 63 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 64 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLDrawList::GLDrawList().
|
static |
Definition at line 62 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), blender::gpu::GLShader::fragment_interface_declare(), glsl_patch_default_get(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
Definition at line 65 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), blender::gpu::GLShaderInterface::GLShaderInterface(), and glsl_patch_default_get().
|
static |
Definition at line 66 of file gl_context.hh.
Referenced by blender::gpu::GLTexture::stencil_texture_mode_set().
|
static |
Definition at line 67 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), glsl_patch_default_get(), and blender::gpu::GLTexture::init_internal().
|
static |
Definition at line 68 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLTexture::samplers_update().
|
static |
Definition at line 69 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and glsl_patch_default_get().
|
static |
Definition at line 70 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLTexture::init_internal().
|
static |
Definition at line 76 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 71 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLVertArray::update_bindings().