|
Blender V4.3
|
#include <gl_context.hh>
Inherits blender::gpu::Context.
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 *r_total_mem, int *r_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 |
| bool | debug_capture_begin (const char *title) override |
| void | debug_capture_end () override |
| void * | debug_capture_scope_create (const char *name) override |
| bool | debug_capture_scope_begin (void *scope) override |
| void | debug_capture_scope_end (void *scope) override |
| void | debug_unbind_all_ubo () override |
| void | debug_unbind_all_ssbo () override |
Public Member Functions inherited from blender::gpu::Context | |
| 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 Public Member Functions inherited from blender::gpu::Context | |
| static Context * | get () |
Public Attributes | |
| GLuint | default_attr_vbo_ |
| uint16_t | bound_ubo_slots |
| uint16_t | bound_ssbo_slots |
Public Attributes inherited from blender::gpu::Context | |
| Shader * | shader = nullptr |
| FrameBuffer * | active_fb = nullptr |
| GPUMatrixState * | matrix_state = nullptr |
| StateManager * | state_manager = nullptr |
| Immediate * | imm = nullptr |
| ShaderCompiler * | compiler = nullptr |
| FrameBuffer * | back_left = nullptr |
| FrameBuffer * | front_left = nullptr |
| FrameBuffer * | back_right = nullptr |
| FrameBuffer * | front_right = nullptr |
| DebugStack | debug_stack |
| bool | debug_is_capturing = false |
| int | context_id = 0 |
| GPUStorageBuf * | printf_buf = nullptr |
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 | |
Protected Attributes inherited from blender::gpu::Context | |
| pthread_t | thread_ |
| bool | is_active_ |
| void * | ghost_window_ |
Definition at line 39 of file gl_context.hh.
| GLContext::GLContext | ( | void * | ghost_window, |
| GLSharedOrphanLists & | shared_orphan_list ) |
Definition at line 36 of file gl_context.cc.
References blender::gpu::Context::active_fb, blender::gpu::Context::back_left, blender::gpu::Context::back_right, blender::gpu::Context::compiler, default_attr_vbo_, blender::gpu::Context::front_left, blender::gpu::Context::front_right, G, G_DEBUG_GPU, blender::gpu::GLBackend::get(), blender::gpu::GLBackend::get_compiler(), GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetDefaultGPUFramebuffer(), 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 110 of file gl_context.cc.
References blender::gpu::Context::back_left, blender::gpu::Context::back_right, BLI_assert, bound_ssbo_slots, bound_ubo_slots, 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 156 of file gl_context.cc.
|
static |
Definition at line 254 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 150 of file gl_context.cc.
References immDeactivate(), and blender::gpu::Context::is_active_.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 404 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_begin(), and blender::gpu::GLBackend::get().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 424 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_end(), and blender::gpu::GLBackend::get().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 443 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_begin(), G, blender::gpu::GLBackend::get(), and UNUSED_VARS.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 438 of file gl_debug.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 457 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_end(), G, blender::gpu::GLBackend::get(), and UNUSED_VARS.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 384 of file gl_debug.cc.
References G, and G_DEBUG_GPU.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 395 of file gl_debug.cc.
References G, and G_DEBUG_GPU.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 474 of file gl_debug.cc.
References bound_ssbo_slots.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 469 of file gl_debug.cc.
References bound_ubo_slots.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 161 of file gl_context.cc.
| void GLContext::fbo_free | ( | GLuint | fbo_id | ) |
Definition at line 244 of file gl_context.cc.
References get().
Referenced by blender::gpu::GLFrameBuffer::~GLFrameBuffer().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 177 of file gl_context.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 172 of file gl_context.cc.
|
inlinestatic |
Definition at line 110 of file gl_context.hh.
References blender::gpu::Context::get().
Referenced by blender::gpu::GLBatch::bind(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::GLStorageBuf::bind(), blender::gpu::GLUniformBuf::bind(), blender::gpu::GLVertBuf::bind(), blender::gpu::GLIndexBuf::bind_as_ssbo(), blender::gpu::GLUniformBuf::bind_as_ssbo(), blender::gpu::GLVertBuf::bind_as_ssbo(), buf_free(), blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::debug::check_gl_resources(), blender::gpu::GLFrameBuffer::clear(), blender::gpu::GLVaoCache::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::GLStorageBuf::unbind(), 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().
Implements blender::gpu::Context.
Definition at line 308 of file gl_context.cc.
|
inlinestatic |
Definition at line 115 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::init_internal(), blender::gpu::GLTexture::mip_range_set(), blender::gpu::GLTexture::read(), blender::gpu::GLTexture::swizzle_set(), blender::gpu::GLTexture::update_sub(), and blender::gpu::GLTexture::update_sub().
|
static |
Definition at line 266 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 288 of file gl_context.cc.
| void GLContext::vao_cache_unregister | ( | GLVaoCache * | cache | ) |
Definition at line 295 of file gl_context.cc.
Referenced by blender::gpu::GLVaoCache::clear().
| void GLContext::vao_free | ( | GLuint | vao_id | ) |
Definition at line 234 of file gl_context.cc.
References get().
Referenced by blender::gpu::GLVaoCache::clear(), blender::gpu::GLVaoCache::insert(), and blender::gpu::GLVaoCache::remove().
| uint16_t blender::gpu::GLContext::bound_ssbo_slots |
Definition at line 77 of file gl_context.hh.
Referenced by activate(), blender::gpu::GLStorageBuf::bind(), blender::gpu::GLIndexBuf::bind_as_ssbo(), blender::gpu::GLUniformBuf::bind_as_ssbo(), blender::gpu::GLVertBuf::bind_as_ssbo(), debug_unbind_all_ssbo(), and blender::gpu::GLStorageBuf::unbind().
| uint16_t blender::gpu::GLContext::bound_ubo_slots |
Used for debugging purpose. Bitflags of all bound slots.
Definition at line 76 of file gl_context.hh.
Referenced by activate(), blender::gpu::GLUniformBuf::bind(), blender::gpu::debug::check_gl_resources(), debug_unbind_all_ubo(), and blender::gpu::GLUniformBuf::unbind().
|
static |
Extensions.
Definition at line 50 of file gl_context.hh.
Referenced by blender::gpu::GLTexture::clear(), and blender::gpu::detect_workarounds().
|
static |
Definition at line 51 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Workarounds.
Definition at line 67 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
| GLuint blender::gpu::GLContext::default_attr_vbo_ |
VBO for missing vertex attribute binding. Avoid undefined behavior on some implementation.
Definition at line 73 of file gl_context.hh.
Referenced by GLContext(), blender::gpu::GLVertArray::update_bindings(), and ~GLContext().
|
static |
Definition at line 70 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and glsl_patch_default_get().
|
static |
Definition at line 52 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::async_flush_to_host(), blender::gpu::GLStorageBuf::clear(), blender::gpu::GLUniformBuf::clear_to_zero(), blender::gpu::GLStorageBuf::copy_sub(), blender::gpu::detect_workarounds(), blender::gpu::GLTexture::generate_mipmap(), blender::gpu::GLTexture::init_internal(), blender::gpu::GLTexture::init_internal(), blender::gpu::GLTexture::mip_range_set(), blender::gpu::GLTexture::read(), blender::gpu::GLTexture::swizzle_set(), blender::gpu::GLTexture::update_sub(), and blender::gpu::GLStorageBuf::~GLStorageBuf().
|
static |
Definition at line 53 of file gl_context.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), print_resource(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
Definition at line 54 of file gl_context.hh.
Referenced by blender::gpu::GLFrameBuffer::attachment_set_loadstore_op(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::detect_workarounds(), blender::gpu::GLShader::fragment_interface_declare(), glsl_patch_default_get(), and blender::gpu::GLFrameBuffer::subpass_transition_impl().
|
static |
Definition at line 69 of file gl_context.hh.
Referenced by blender::gpu::GLTexture::generate_mipmap().
|
static |
Definition at line 55 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 |
|
static |
Definition at line 46 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::bind().
|
static |
Definition at line 45 of file gl_context.hh.
Referenced by blender::gpu::GLUniformBuf::bind().
|
static |
Definition at line 44 of file gl_context.hh.
Referenced by blender::gpu::GLUniformBuf::GLUniformBuf().
|
static |
Definition at line 58 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 57 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 59 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLDrawList::GLDrawList().
|
static |
Definition at line 56 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 60 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), blender::gpu::GLShaderInterface::GLShaderInterface(), and glsl_patch_default_get().
|
static |
Definition at line 61 of file gl_context.hh.
|
static |
Definition at line 62 of file gl_context.hh.
Referenced by blender::gpu::GLFrameBuffer::attachment_set_loadstore_op(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::detect_workarounds(), and blender::gpu::GLFrameBuffer::subpass_transition_impl().
|
static |
Definition at line 63 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLTexture::samplers_update().
|
static |
Definition at line 68 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().