Blender  V3.3
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
blender::gpu::Context Class Referenceabstract

#include <gpu_context_private.hh>

Inheritance diagram for blender::gpu::Context:
blender::gpu::GLContext blender::gpu::MTLContext

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 *total_mem, int *free_mem)=0
 
virtual void debug_group_begin (const char *, int)
 
virtual void debug_group_end ()
 
bool is_active_on_thread ()
 

Static Public Member Functions

static Contextget ()
 

Public Attributes

Shadershader = nullptr
 
FrameBufferactive_fb = nullptr
 
GPUMatrixStatematrix_state = nullptr
 
StateManagerstate_manager = nullptr
 
Immediateimm = nullptr
 
FrameBufferback_left = nullptr
 
FrameBufferfront_left = nullptr
 
FrameBufferback_right = nullptr
 
FrameBufferfront_right = nullptr
 
DebugStack debug_stack
 

Protected Attributes

pthread_t thread_
 
bool is_active_
 
voidghost_window_
 

Detailed Description

Definition at line 28 of file gpu_context_private.hh.

Constructor & Destructor Documentation

◆ Context()

blender::gpu::Context::Context ( )

Definition at line 59 of file gpu_context.cc.

References GPU_matrix_state_create(), is_active_, matrix_state, and thread_.

◆ ~Context()

blender::gpu::Context::~Context ( )
virtual

Member Function Documentation

◆ activate()

virtual void blender::gpu::Context::activate ( )
pure virtual

◆ begin_frame()

virtual void blender::gpu::Context::begin_frame ( )
pure virtual

◆ deactivate()

virtual void blender::gpu::Context::deactivate ( )
pure virtual

◆ debug_group_begin()

virtual void blender::gpu::Context::debug_group_begin ( const char *  ,
int   
)
inlinevirtual

Reimplemented in blender::gpu::GLContext, and blender::gpu::MTLContext.

Definition at line 76 of file gpu_context_private.hh.

Referenced by GPU_debug_group_begin().

◆ debug_group_end()

virtual void blender::gpu::Context::debug_group_end ( )
inlinevirtual

Reimplemented in blender::gpu::GLContext, and blender::gpu::MTLContext.

Definition at line 77 of file gpu_context_private.hh.

Referenced by GPU_debug_group_end().

◆ end_frame()

virtual void blender::gpu::Context::end_frame ( )
pure virtual

◆ finish()

virtual void blender::gpu::Context::finish ( )
pure virtual

Implemented in blender::gpu::GLContext, and blender::gpu::MTLContext.

Referenced by GPU_finish().

◆ flush()

virtual void blender::gpu::Context::flush ( )
pure virtual

Implemented in blender::gpu::GLContext, and blender::gpu::MTLContext.

Referenced by GPU_flush().

◆ get()

Context * blender::gpu::Context::get ( )
static

Definition at line 82 of file gpu_context.cc.

References active_ctx.

Referenced by blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::MTLContext::get(), blender::gpu::GLContext::get(), GPU_apply_state(), GPU_backbuffer_bind(), GPU_batch_draw_advanced(), GPU_bgl_end(), GPU_bgl_get(), GPU_bgl_start(), GPU_blend_get(), GPU_clear_color(), GPU_clear_depth(), GPU_color_mask(), 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_pixels(), 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_bind(), GPU_shader_unbind(), GPU_state_set(), GPU_stencil_mask_get(), GPU_stencil_test_get(), GPU_stereo_quadbuffer_support(), 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_viewport(), GPU_viewport_size_get_f(), GPU_viewport_size_get_i(), GPU_write_mask_get(), immActivate(), and blender::gpu::GLFrameBuffer::~GLFrameBuffer().

◆ is_active_on_thread()

bool blender::gpu::Context::is_active_on_thread ( )

Definition at line 77 of file gpu_context.cc.

References active_ctx, and thread_.

◆ memory_statistics_get()

virtual void blender::gpu::Context::memory_statistics_get ( int *  total_mem,
int *  free_mem 
)
pure virtual

Member Data Documentation

◆ active_fb

FrameBuffer* blender::gpu::Context::active_fb = nullptr

◆ back_left

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 44 of file gpu_context_private.hh.

Referenced by blender::gpu::GLContext::activate(), 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(), ~Context(), blender::gpu::GLFrameBuffer::~GLFrameBuffer(), and blender::gpu::MTLFrameBuffer::~MTLFrameBuffer().

◆ back_right

FrameBuffer* blender::gpu::Context::back_right = nullptr

◆ debug_stack

DebugStack blender::gpu::Context::debug_stack

◆ front_left

FrameBuffer* blender::gpu::Context::front_left = nullptr

◆ front_right

FrameBuffer* blender::gpu::Context::front_right = nullptr

◆ ghost_window_

void* blender::gpu::Context::ghost_window_
protected

Avoid including GHOST headers. Can be nullptr for off-screen contexts.

Definition at line 56 of file gpu_context_private.hh.

Referenced by blender::gpu::GLContext::activate(), and blender::gpu::GLContext::GLContext().

◆ imm

Immediate* blender::gpu::Context::imm = nullptr

◆ is_active_

bool blender::gpu::Context::is_active_
protected

◆ matrix_state

GPUMatrixState* blender::gpu::Context::matrix_state = nullptr

◆ shader

Shader* blender::gpu::Context::shader = nullptr

◆ state_manager

StateManager* blender::gpu::Context::state_manager = nullptr

◆ thread_

pthread_t blender::gpu::Context::thread_
protected

Thread on which this context is active.

Definition at line 53 of file gpu_context_private.hh.

Referenced by blender::gpu::GLContext::activate(), Context(), and is_active_on_thread().


The documentation for this class was generated from the following files: