|
Blender V5.3
|
#include <gl_context.hh>
Inherits blender::gpu::Context.
Public Member Functions | |
Constructor / Destructor | |
| GLContext (GHOST_IWindow *ghost_window, GHOST_IContext *ghost_context, 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) |
| Public Member Functions inherited from blender::gpu::Context | |
| Context () | |
| virtual | ~Context () |
| bool | is_active_on_thread () |
| VertBuf * | dummy_vbo_get () |
| Batch * | procedural_points_batch_get () |
| Batch * | procedural_lines_batch_get () |
| Batch * | procedural_triangles_batch_get () |
| Batch * | procedural_triangle_strips_batch_get () |
| void | assert_framebuffer_shader_compatibility (Shader *sh) |
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 |
| FrameBuffer * | back_left = nullptr |
| FrameBuffer * | front_left = nullptr |
| FrameBuffer * | back_right = nullptr |
| FrameBuffer * | front_right = nullptr |
| DebugStack | debug_stack |
| bool | debug_is_capturing = false |
| bool | debug_pipeline_creation = false |
| int | context_id = 0 |
| Vector< StorageBuf * > | printf_buf |
| VertBuf * | dummy_vbo = nullptr |
| Batch * | procedural_points_batch = nullptr |
| Batch * | procedural_lines_batch = nullptr |
| Batch * | procedural_triangles_batch = nullptr |
| Batch * | procedural_triangle_strips_batch = nullptr |
| TexturePool * | texture_pool = nullptr |
| int | shader_builtin_srgb_transform = 0 |
| bool | shader_builtin_srgb_is_dirty = false |
Static Public Attributes | |
Capabilities | |
| static GLint | max_cubemap_size = 0 |
| static GLint | max_ubo_binds = 0 |
| static GLint | max_ssbo_binds = 0 |
| static bool | debug_layer_support = false |
| static bool | direct_state_access_support = false |
| static bool | framebuffer_fetch_support = false |
| static bool | layered_rendering_support = false |
| static bool | vertex_shader_viewport_index_support = false |
| static bool | vertex_shader_layer_support = false |
| static bool | native_barycentric_support = false |
| static bool | multi_bind_support = false |
| static bool | multi_bind_image_support = false |
| static bool | stencil_texturing_support = false |
| static bool | texture_barrier_support = false |
| static bool | texture_filter_anisotropic_support = false |
| static bool | derivative_control_support = false |
| static bool | debug_layer_workaround = false |
| static bool | unused_fb_slot_workaround = false |
| Static Public Attributes inherited from blender::gpu::Context | |
| static std::atomic< int > | context_counter = 0 |
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 |
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 | buffer_free (GLuint buf_id) |
| static void | texture_free (GLuint tex_id) |
| static void | shader_free (GLuint shader_id) |
| static void | program_free (GLuint program_id) |
Additional Inherited Members | |
| Protected Member Functions inherited from blender::gpu::Context | |
| void | free_resources () |
| Protected Attributes inherited from blender::gpu::Context | |
| pthread_t | thread_ |
| bool | is_active_ |
| GHOST_IWindow * | ghost_window_ |
Definition at line 49 of file gl_context.hh.
| blender::GLContext::GLContext | ( | GHOST_IWindow * | ghost_window, |
| GHOST_IContext * | ghost_context, | ||
| GLSharedOrphanLists & | shared_orphan_list ) |
Definition at line 35 of file gl_context.cc.
References blender::gpu::Context::active_fb, blender::gpu::GLBackend::add_context_id(), blender::gpu::Context::back_left, blender::gpu::Context::back_right, blender::gpu::Context::context_id, blender::data, default_attr_vbo_, blender::gpu::Context::front_left, blender::gpu::Context::front_right, blender::G, blender::G_DEBUG_GPU, blender::gpu::GLBackend::get(), GHOST_IWindow::getClientBounds(), GHOST_IWindow::getDefaultFramebuffer(), blender::gpu::Context::ghost_window_, blender::gpu::GLFrameBuffer::GLFrameBuffer(), blender::gpu::GLImmediate::GLImmediate(), blender::gpu::GLStateManager::GLStateManager(), blender::gpu::Context::imm, blender::gpu::debug::init_gl_callbacks(), blender::gpu::Context::state_manager, and w().
Referenced by blender::gpu::GLBackend::context_alloc(), get(), and state_manager_active_get().
| blender::GLContext::~GLContext | ( | ) |
Definition at line 93 of file gl_context.cc.
References blender::BLI_assert(), blender::gpu::Context::context_id, default_attr_vbo_, finish(), blender::gpu::Context::free_resources(), blender::G, blender::gpu::GLBackend::get(), and blender::gpu::GLBackend::remove_context_id().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 120 of file gl_context.cc.
References blender::gpu::Context::back_left, blender::gpu::Context::back_right, blender::BLI_assert(), bound_ssbo_slots, bound_ubo_slots, blender::gpu::Context::front_left, blender::gpu::Context::front_right, GHOST_IContext::getActiveDrawingContext(), GHOST_IWindow::getClientBounds(), blender::gpu::Context::ghost_window_, blender::immActivate(), blender::gpu::Context::is_active_, blender::gpu::FrameBuffer::size_set(), blender::gpu::Context::thread_, and w().
Referenced by check_error().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 169 of file gl_context.cc.
Referenced by check_error().
|
static |
Definition at line 284 of file gl_context.cc.
References blender::gpu::GLSharedOrphanLists::buffers, blender::gpu::GLBackend::get(), get(), and blender::gpu::GLBackend::shared_orphan_list_get().
Referenced by blender::gpu::GLVertBuf::release_data(), blender::gpu::GLIndexBuf::~GLIndexBuf(), blender::gpu::GLStorageBuf::~GLStorageBuf(), and blender::gpu::GLUniformBuf::~GLUniformBuf().
|
static |
References activate(), begin_frame(), deactivate(), end_frame(), finish(), flush(), and memory_statistics_get().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 163 of file gl_context.cc.
References blender::immDeactivate(), and blender::gpu::Context::is_active_.
Referenced by check_error().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 480 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 500 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 519 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_begin(), blender::G, blender::gpu::GLBackend::get(), blender::StringRefNull::StringRefNull(), and UNUSED_VARS.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 514 of file gl_debug.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 533 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_end(), blender::G, blender::gpu::GLBackend::get(), blender::StringRefNull::StringRefNull(), and UNUSED_VARS.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 371 of file gl_debug.cc.
References blender::G, and blender::G_DEBUG_GPU.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 400 of file gl_debug.cc.
References CLOG_ERROR, blender::G, blender::G_DEBUG_GPU, blender::LOG, and lexit::Vector< T >::size().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 550 of file gl_debug.cc.
References bound_ssbo_slots.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 545 of file gl_debug.cc.
References bound_ubo_slots.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 174 of file gl_context.cc.
Referenced by check_error().
| void blender::GLContext::fbo_free | ( | GLuint | fbo_id | ) |
Definition at line 274 of file gl_context.cc.
References get().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 190 of file gl_context.cc.
Referenced by check_error(), and ~GLContext().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 185 of file gl_context.cc.
Referenced by check_error().
|
inlinestatic |
Definition at line 143 of file gl_context.hh.
References blender::gpu::Context::get(), and GLContext().
Referenced by blender::gpu::GLImmediate::begin(), 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(), buffer_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::GLImmediate::end(), fbo_free(), blender::gpu::GLShader::GLShader(), blender::gpu::GLTexture::GLTexture(), blender::gpu::GLSharedOrphanLists::orphans_clear(), program_free(), shader_free(), state_manager_active_get(), texture_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().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 362 of file gl_context.cc.
Referenced by check_error().
|
static |
Definition at line 320 of file gl_context.cc.
References blender::gpu::GLBackend::get(), get(), blender::gpu::GLSharedOrphanLists::programs, and blender::gpu::GLBackend::shared_orphan_list_get().
|
static |
Definition at line 308 of file gl_context.cc.
References blender::gpu::GLBackend::get(), get(), blender::gpu::GLSharedOrphanLists::shaders, and blender::gpu::GLBackend::shared_orphan_list_get().
|
inlinestatic |
Definition at line 148 of file gl_context.hh.
References get(), GLContext(), 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::swizzle_set(), blender::gpu::GLTexture::update_sub(), and blender::gpu::GLTexture::update_sub().
|
static |
Definition at line 296 of file gl_context.cc.
References blender::gpu::GLBackend::get(), get(), blender::gpu::GLBackend::shared_orphan_list_get(), and blender::gpu::GLSharedOrphanLists::textures.
Referenced by blender::gpu::GLTexture::~GLTexture().
| void blender::GLContext::vao_cache_register | ( | GLVaoCache * | cache | ) |
Definition at line 342 of file gl_context.cc.
| void blender::GLContext::vao_cache_unregister | ( | GLVaoCache * | cache | ) |
Definition at line 349 of file gl_context.cc.
| void blender::GLContext::vao_free | ( | GLuint | vao_id | ) |
Definition at line 264 of file gl_context.cc.
References get().
| uint16_t blender::gpu::GLContext::bound_ssbo_slots |
Definition at line 87 of file gl_context.hh.
Referenced by activate(), blender::gpu::GLImmediate::begin(), 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(), blender::gpu::GLImmediate::end(), and blender::gpu::GLStorageBuf::unbind().
| uint16_t blender::gpu::GLContext::bound_ubo_slots |
Used for debugging purpose. Bit-flags of all bound slots.
Definition at line 86 of file gl_context.hh.
Referenced by activate(), blender::gpu::GLUniformBuf::bind(), debug_unbind_all_ubo(), and blender::gpu::GLUniformBuf::unbind().
|
static |
Extensions.
Definition at line 59 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Workarounds.
Definition at line 79 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 83 of file gl_context.hh.
Referenced by GLContext(), blender::gpu::GLVertArray::update_bindings(), and ~GLContext().
|
static |
Definition at line 75 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::glsl_patch_fragment_get().
|
static |
Definition at line 60 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::GLIndexBuf::copy_sub(), blender::gpu::GLStorageBuf::copy_sub(), blender::gpu::GLVertBuf::copy_sub(), blender::gpu::detect_workarounds(), blender::gpu::GLTexture::generate_mipmap(), blender::gpu::GLTexture::init_internal(), blender::gpu::GLTexture::init_internal(), blender::gpu::GLStorageBuf::read(), blender::gpu::GLTexture::swizzle_set(), blender::gpu::GLTexture::update_sub(), and blender::gpu::GLStorageBuf::~GLStorageBuf().
|
static |
Definition at line 61 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(), blender::glsl_patch_fragment_get(), and blender::gpu::GLFrameBuffer::subpass_transition_impl().
|
static |
Definition at line 66 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::glsl_patch_vertex_get().
|
static |
|
static |
Definition at line 55 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::bind().
|
static |
Definition at line 54 of file gl_context.hh.
Referenced by blender::gpu::GLUniformBuf::bind().
|
static |
Definition at line 71 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 70 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 69 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), blender::gpu::GLShader::fragment_interface_declare(), blender::glsl_patch_fragment_get(), blender::glsl_patch_geometry_get(), blender::glsl_patch_vertex_get(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
Definition at line 72 of file gl_context.hh.
|
static |
Definition at line 73 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 74 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLTexture::samplers_init().
|
static |
Definition at line 80 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 68 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::glsl_patch_vertex_get().
|
static |
Definition at line 67 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::glsl_patch_vertex_get().