|
Blender V4.3
|
#include <gpu_context_private.hh>
Inherited by blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Public Member Functions | |
| Context () | |
| virtual | ~Context () |
| virtual void | activate ()=0 |
| virtual void | deactivate ()=0 |
| virtual void | begin_frame ()=0 |
| virtual void | end_frame ()=0 |
| virtual void | flush ()=0 |
| virtual void | finish ()=0 |
| virtual void | memory_statistics_get (int *r_total_mem, int *r_free_mem)=0 |
| virtual void | debug_group_begin (const char *, int) |
| virtual void | debug_group_end () |
| virtual bool | debug_capture_begin (const char *title)=0 |
| virtual void | debug_capture_end ()=0 |
| virtual void * | debug_capture_scope_create (const char *name)=0 |
| virtual bool | debug_capture_scope_begin (void *scope)=0 |
| virtual void | debug_capture_scope_end (void *scope)=0 |
| virtual void | debug_unbind_all_ubo ()=0 |
| virtual void | debug_unbind_all_ssbo ()=0 |
| bool | is_active_on_thread () |
Static Public Member Functions | |
| static Context * | get () |
Public Attributes | |
| 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 |
Static Public Attributes | |
| static int | context_counter = 0 |
Protected Attributes | |
| pthread_t | thread_ |
| bool | is_active_ |
| void * | ghost_window_ |
Definition at line 29 of file gpu_context_private.hh.
| blender::gpu::Context::Context | ( | ) |
Definition at line 66 of file gpu_context.cc.
References context_counter, context_id, GPU_matrix_state_create(), is_active_, matrix_state, and thread_.
|
virtual |
Definition at line 76 of file gpu_context.cc.
References back_left, back_right, front_left, front_right, GPU_matrix_state_discard(), imm, matrix_state, and state_manager.
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_context_active_set().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_context_begin_frame().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_context_active_set().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_debug_capture_begin().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_debug_capture_end().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_debug_capture_scope_begin().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_debug_capture_scope_create().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_debug_capture_scope_end().
|
inlinevirtual |
Reimplemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Definition at line 90 of file gpu_context_private.hh.
Referenced by GPU_debug_group_begin().
|
inlinevirtual |
Reimplemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Definition at line 91 of file gpu_context_private.hh.
Referenced by GPU_debug_group_end().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_storagebuf_debug_unbind_all().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_uniformbuf_debug_unbind_all().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_context_end_frame().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_finish().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_flush().
|
static |
Definition at line 92 of file gpu_context.cc.
References active_ctx.
Referenced by blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::GLContext::get(), blender::gpu::MTLContext::get(), blender::gpu::VKContext::get(), GPU_apply_state(), GPU_backbuffer_bind(), GPU_batch_draw_advanced(), GPU_batch_draw_indirect(), GPU_batch_multi_draw_indirect(), GPU_bgl_end(), GPU_bgl_get(), GPU_bgl_start(), GPU_blend_get(), GPU_clear_color(), GPU_clear_depth(), GPU_color_mask(), GPU_context_active_get(), GPU_debug_capture_begin(), GPU_debug_capture_end(), GPU_debug_capture_scope_begin(), GPU_debug_capture_scope_create(), GPU_debug_capture_scope_end(), GPU_debug_get_groups_names(), GPU_debug_group_begin(), GPU_debug_group_end(), GPU_debug_group_match(), GPU_depth_mask(), GPU_depth_mask_get(), GPU_depth_range(), GPU_depth_test_get(), GPU_face_culling_get(), GPU_finish(), GPU_flush(), GPU_framebuffer_active_get(), GPU_framebuffer_back_get(), GPU_framebuffer_blit(), GPU_framebuffer_restore(), GPU_frontbuffer_read_color(), GPU_line_width_get(), GPU_matrix_dirty_get(), GPU_matrix_reset(), GPU_matrix_stack_level_get_model_view(), GPU_matrix_stack_level_get_projection(), gpu_matrix_state_active_set_dirty(), GPU_mem_stats_get(), GPU_memory_barrier(), GPU_offscreen_draw_to_screen(), gpu_offscreen_fb_get(), GPU_point_size(), GPU_program_point_size(), GPU_scissor(), GPU_scissor_get(), GPU_scissor_test(), GPU_shader_batch_create_from_infos(), GPU_shader_batch_finalize(), GPU_shader_batch_is_ready(), GPU_shader_batch_specializations(), GPU_shader_batch_specializations_is_ready(), GPU_shader_bind(), GPU_shader_create_from_info(), GPU_shader_get_bound(), GPU_shader_unbind(), GPU_state_set(), GPU_stencil_mask_get(), GPU_stencil_test_get(), GPU_stereo_quadbuffer_support(), GPU_storagebuf_debug_unbind_all(), GPU_texture_bind(), GPU_texture_bind_ex(), GPU_texture_image_bind(), GPU_texture_image_unbind(), GPU_texture_image_unbind_all(), GPU_texture_unbind(), GPU_texture_unbind_all(), GPU_uniformbuf_debug_unbind_all(), GPU_unpack_row_length_set(), GPU_viewport(), GPU_viewport_size_get_f(), GPU_viewport_size_get_i(), GPU_write_mask_get(), immActivate(), and blender::gpu::GLFrameBuffer::~GLFrameBuffer().
| bool blender::gpu::Context::is_active_on_thread | ( | ) |
Definition at line 87 of file gpu_context.cc.
References active_ctx, and thread_.
Referenced by blender::gpu::MTLContext::deactivate().
|
pure virtual |
Implemented in blender::gpu::DummyContext, blender::gpu::GLContext, blender::gpu::MTLContext, and blender::gpu::VKContext.
Referenced by GPU_mem_stats_get().
| FrameBuffer* blender::gpu::Context::active_fb = nullptr |
Definition at line 33 of file gpu_context_private.hh.
Referenced by blender::gpu::VKContext::activate_framebuffer(), blender::gpu::VKContext::active_framebuffer_get(), blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::MTLStateManager::apply_state(), blender::gpu::GLFrameBuffer::attachment_set_loadstore_op(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::MTLFrameBuffer::bind(), blender::gpu::GLFrameBuffer::blit_to(), blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::GLFrameBuffer::clear(), blender::gpu::MTLFrameBuffer::clear(), blender::gpu::GLFrameBuffer::clear_attachment(), blender::gpu::MTLFrameBuffer::clear_attachment(), blender::gpu::VKContext::deactivate_framebuffer(), blender::gpu::DummyContext::DummyContext(), blender::gpu::MTLContext::ensure_begin_render_pass(), blender::gpu::MTLContext::framebuffer_bind(), blender::gpu::MTLContext::framebuffer_restore(), blender::gpu::MTLContext::get_current_framebuffer(), blender::gpu::GLContext::GLContext(), GPU_clear_color(), GPU_clear_depth(), GPU_framebuffer_active_get(), GPU_framebuffer_blit(), GPU_offscreen_draw_to_screen(), GPU_scissor(), GPU_scissor_get(), GPU_scissor_test(), GPU_viewport(), GPU_viewport_size_get_f(), GPU_viewport_size_get_i(), blender::gpu::MTLContext::MTLContext(), blender::gpu::VKContext::VKContext(), blender::gpu::GLFrameBuffer::~GLFrameBuffer(), and blender::gpu::MTLFrameBuffer::~MTLFrameBuffer().
| FrameBuffer* blender::gpu::Context::back_left = nullptr |
All 4 window frame-buffers. None of them are valid in an off-screen context. Right frame-buffers are only available if using stereo rendering. Front frame-buffers contains (in principle, but not always) the last frame color. Default frame-buffer is back_left.
Definition at line 47 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::DummyContext::DummyContext(), blender::gpu::MTLContext::framebuffer_restore(), blender::gpu::MTLContext::get_default_framebuffer(), blender::gpu::GLContext::GLContext(), GPU_backbuffer_bind(), GPU_framebuffer_back_get(), GPU_framebuffer_restore(), blender::gpu::MTLContext::MTLContext(), blender::gpu::VKContext::sync_backbuffer(), blender::gpu::VKContext::VKContext(), ~Context(), blender::gpu::GLFrameBuffer::~GLFrameBuffer(), blender::gpu::MTLFrameBuffer::~MTLFrameBuffer(), and blender::gpu::VKContext::~VKContext().
| FrameBuffer* blender::gpu::Context::back_right = nullptr |
Definition at line 49 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::GLContext::GLContext(), GPU_backbuffer_bind(), and ~Context().
| ShaderCompiler* blender::gpu::Context::compiler = nullptr |
Definition at line 38 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::GLContext(), GPU_shader_batch_create_from_infos(), GPU_shader_batch_finalize(), GPU_shader_batch_is_ready(), GPU_shader_batch_specializations(), GPU_shader_batch_specializations_is_ready(), blender::gpu::MTLContext::MTLContext(), blender::gpu::VKContext::VKContext(), blender::gpu::MTLContext::~MTLContext(), and blender::gpu::VKContext::~VKContext().
|
static |
Definition at line 60 of file gpu_context_private.hh.
Referenced by Context().
| int blender::gpu::Context::context_id = 0 |
Definition at line 61 of file gpu_context_private.hh.
Referenced by Context().
| bool blender::gpu::Context::debug_is_capturing = false |
Definition at line 53 of file gpu_context_private.hh.
Referenced by GPU_debug_capture_begin(), GPU_debug_capture_end(), GPU_debug_capture_scope_begin(), and GPU_debug_capture_scope_end().
| DebugStack blender::gpu::Context::debug_stack |
Definition at line 52 of file gpu_context_private.hh.
Referenced by GPU_debug_get_groups_names(), GPU_debug_group_begin(), GPU_debug_group_end(), and GPU_debug_group_match().
| FrameBuffer* blender::gpu::Context::front_left = nullptr |
Definition at line 48 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::GLContext::GLContext(), GPU_frontbuffer_read_color(), blender::gpu::MTLContext::MTLContext(), blender::gpu::VKContext::sync_backbuffer(), blender::gpu::VKContext::VKContext(), ~Context(), and blender::gpu::VKContext::~VKContext().
| FrameBuffer* blender::gpu::Context::front_right = nullptr |
Definition at line 50 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::GLContext::GLContext(), GPU_stereo_quadbuffer_support(), and ~Context().
|
protected |
Avoid including GHOST headers. Can be nullptr for off-screen contexts.
Definition at line 70 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::MTLContext::activate(), blender::gpu::GLContext::GLContext(), blender::gpu::MTLContext::MTLContext(), blender::gpu::VKContext::sync_backbuffer(), and blender::gpu::VKContext::VKContext().
| Immediate* blender::gpu::Context::imm = nullptr |
Definition at line 36 of file gpu_context_private.hh.
Referenced by blender::gpu::VKContext::activate(), blender::gpu::VKContext::deactivate(), blender::gpu::GLContext::GLContext(), immActivate(), blender::gpu::MTLContext::MTLContext(), blender::gpu::VKContext::sync_backbuffer(), ~Context(), and blender::gpu::VKContext::~VKContext().
|
protected |
Definition at line 68 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::MTLContext::activate(), blender::gpu::VKContext::activate(), Context(), blender::gpu::GLContext::deactivate(), blender::gpu::MTLContext::deactivate(), blender::gpu::VKContext::deactivate(), and blender::gpu::MTLContext::get_active().
| GPUMatrixState* blender::gpu::Context::matrix_state = nullptr |
Definition at line 34 of file gpu_context_private.hh.
Referenced by Context(), GPU_matrix_dirty_get(), GPU_matrix_reset(), GPU_matrix_stack_level_get_model_view(), GPU_matrix_stack_level_get_projection(), gpu_matrix_state_active_set_dirty(), and ~Context().
| GPUStorageBuf* blender::gpu::Context::printf_buf = nullptr |
Definition at line 63 of file gpu_context_private.hh.
Referenced by GPU_shader_bind(), blender::gpu::printf_begin(), and blender::gpu::printf_end().
| Shader* blender::gpu::Context::shader = nullptr |
State management
Definition at line 32 of file gpu_context_private.hh.
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::debug::check_gl_resources(), GPU_shader_bind(), GPU_shader_get_bound(), GPU_shader_unbind(), and blender::gpu::GLVaoCache::vao_get().
| StateManager* blender::gpu::Context::state_manager = nullptr |
Definition at line 35 of file gpu_context_private.hh.
Referenced by blender::gpu::MTLShader::bake_current_pipeline_state(), blender::gpu::GLBatch::bind(), blender::gpu::GLFrameBuffer::blit_to(), blender::gpu::GLFrameBuffer::clear(), blender::gpu::GLFrameBuffer::clear_attachment(), blender::gpu::GLImmediate::end(), blender::gpu::MTLImmediate::end(), blender::gpu::MTLContext::ensure_render_pipeline_state(), blender::gpu::GLContext::GLContext(), blender::gpu::GLFrameBuffer::GLFrameBuffer(), GPU_apply_state(), GPU_bgl_end(), GPU_bgl_get(), GPU_bgl_start(), GPU_blend_get(), GPU_color_mask(), GPU_depth_mask(), GPU_depth_mask_get(), GPU_depth_range(), GPU_depth_test_get(), GPU_face_culling_get(), GPU_line_width_get(), GPU_memory_barrier(), GPU_point_size(), GPU_program_point_size(), GPU_state_set(), GPU_stencil_mask_get(), GPU_stencil_test_get(), GPU_texture_bind(), GPU_texture_bind_ex(), GPU_texture_image_bind(), GPU_texture_image_unbind(), GPU_texture_image_unbind_all(), GPU_texture_unbind(), GPU_texture_unbind_all(), GPU_unpack_row_length_set(), GPU_write_mask_get(), blender::gpu::MTLContext::MTLContext(), blender::gpu::GLContext::state_manager_active_get(), blender::gpu::VKContext::state_manager_get(), blender::gpu::VKContext::VKContext(), ~Context(), blender::gpu::GLTexture::~GLTexture(), and blender::gpu::MTLTexture::~MTLTexture().
|
protected |
Thread on which this context is active.
Definition at line 67 of file gpu_context_private.hh.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::MTLContext::activate(), Context(), and is_active_on_thread().