|
Blender V5.0
|
#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) |
| 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 |
| 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 | explicit_location_support = false |
| static bool | framebuffer_fetch_support = false |
| static bool | layered_rendering_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 | debug_layer_workaround = false |
| static bool | unused_fb_slot_workaround = false |
| static bool | generate_mipmap_workaround = false |
| Static Public Attributes inherited from blender::gpu::Context | |
| static 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_ |
| void * | ghost_window_ |
Definition at line 50 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, data, default_attr_vbo_, blender::gpu::Context::front_left, blender::gpu::Context::front_right, G, G_DEBUG_GPU, GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetDefaultGPUFramebuffer(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), blender::gpu::Context::ghost_window_, blender::gpu::Context::imm, blender::gpu::Context::state_manager, and w().
Referenced by get(), and state_manager_active_get().
| GLContext::~GLContext | ( | ) |
Definition at line 88 of file gl_context.cc.
References BLI_assert, default_attr_vbo_, finish(), blender::gpu::Context::free_resources(), and G.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 113 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::Context::thread_, and w().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 159 of file gl_context.cc.
|
static |
Definition at line 274 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 |
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 153 of file gl_context.cc.
References immDeactivate(), and blender::gpu::Context::is_active_.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 478 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 498 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 517 of file gl_debug.cc.
References blender::gpu::GLBackend::debug_capture_begin(), G, blender::gpu::GLBackend::get(), and UNUSED_VARS.
|
overridevirtual |
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 531 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 369 of file gl_debug.cc.
References G, G_DEBUG_GPU, and name.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 398 of file gl_debug.cc.
References CLOG_ERROR, G, G_DEBUG_GPU, i, blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::gpu::LOG, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 548 of file gl_debug.cc.
References bound_ssbo_slots.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 543 of file gl_debug.cc.
References bound_ubo_slots.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 164 of file gl_context.cc.
| void GLContext::fbo_free | ( | GLuint | fbo_id | ) |
Definition at line 264 of file gl_context.cc.
References get().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 180 of file gl_context.cc.
Referenced by ~GLContext().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 175 of file gl_context.cc.
|
inlinestatic |
Definition at line 135 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 352 of file gl_context.cc.
|
static |
Definition at line 310 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 298 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 140 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::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 286 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 GLContext::vao_cache_register | ( | GLVaoCache * | cache | ) |
Definition at line 332 of file gl_context.cc.
| void GLContext::vao_cache_unregister | ( | GLVaoCache * | cache | ) |
Definition at line 339 of file gl_context.cc.
| void GLContext::vao_free | ( | GLuint | vao_id | ) |
Definition at line 254 of file gl_context.cc.
References get().
| uint16_t blender::gpu::GLContext::bound_ssbo_slots |
Definition at line 83 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 82 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 60 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Workarounds.
Definition at line 74 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 79 of file gl_context.hh.
Referenced by GLContext(), blender::gpu::GLVertArray::update_bindings(), and ~GLContext().
|
static |
Definition at line 61 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::GLStorageBuf::read(), blender::gpu::GLTexture::read(), blender::gpu::GLTexture::swizzle_set(), blender::gpu::GLTexture::update_sub(), and blender::gpu::GLStorageBuf::~GLStorageBuf().
|
static |
Definition at line 62 of file gl_context.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), print_resource(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
Definition at line 63 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_fragment_get(), and blender::gpu::GLFrameBuffer::subpass_transition_impl().
|
static |
Definition at line 76 of file gl_context.hh.
Referenced by blender::gpu::GLTexture::generate_mipmap().
|
static |
Definition at line 64 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), glsl_patch_fragment_get(), glsl_patch_geometry_get(), and glsl_patch_vertex_get().
|
static |
|
static |
Definition at line 56 of file gl_context.hh.
Referenced by blender::gpu::GLStorageBuf::bind().
|
static |
Definition at line 55 of file gl_context.hh.
Referenced by blender::gpu::GLUniformBuf::bind().
|
static |
Definition at line 67 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 66 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().
|
static |
Definition at line 65 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), blender::gpu::GLShader::fragment_interface_declare(), glsl_patch_fragment_get(), glsl_patch_geometry_get(), glsl_patch_vertex_get(), and blender::gpu::GLShader::vertex_interface_declare().
|
static |
Definition at line 68 of file gl_context.hh.
|
static |
Definition at line 69 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 70 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds(), and blender::gpu::GLTexture::samplers_update().
|
static |
Definition at line 75 of file gl_context.hh.
Referenced by blender::gpu::detect_workarounds().