Blender  V3.3
Static Public Member Functions | Public Attributes | List of all members
blender::gpu::GLContext Class Reference

#include <gl_context.hh>

Inheritance diagram for blender::gpu::GLContext:
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 *total_mem, int *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
 
- 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 GLContextget ()
 
static GLStateManagerstate_manager_active_get ()
 
- Static Public Member Functions inherited from blender::gpu::Context
static Contextget ()
 

Public Attributes

GLuint default_attr_vbo_
 
uint16_t bound_ubo_slots
 
- Public Attributes inherited from blender::gpu::Context
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
 

Static Public Attributes

Capabilities
static GLint max_cubemap_size = 0
 
static GLint max_texture_3d_size = 0
 
static GLint max_ubo_size = 0
 
static GLint max_ubo_binds = 0
 
static GLint max_ssbo_size = 0
 
static GLint max_ssbo_binds = 0
 
static bool base_instance_support = false
 
static bool clear_texture_support = false
 
static bool copy_image_support = false
 
static bool debug_layer_support = false
 
static bool direct_state_access_support = false
 
static bool explicit_location_support = false
 
static bool geometry_shader_invocations = false
 
static bool fixed_restart_index_support = false
 
static bool layered_rendering_support = false
 
static bool native_barycentric_support = false
 
static bool multi_bind_support = false
 
static bool multi_draw_indirect_support = false
 
static bool shader_draw_parameters_support = false
 
static bool stencil_texturing_support = false
 
static bool texture_cube_map_array_support = false
 
static bool texture_filter_anisotropic_support = false
 
static bool texture_gather_support = false
 
static bool texture_storage_support = false
 
static bool vertex_attrib_binding_support = false
 
static bool debug_layer_workaround = false
 
static bool unused_fb_slot_workaround = false
 
static bool generate_mipmap_workaround = false
 
static float derivative_signs [2] = {1.0f, 1.0f}
 

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_
 
voidghost_window_
 

Detailed Description

Definition at line 40 of file gl_context.hh.

Constructor & Destructor Documentation

◆ GLContext()

GLContext::GLContext ( void ghost_window,
GLSharedOrphanLists shared_orphan_list 
)

◆ ~GLContext()

GLContext::~GLContext ( )

Member Function Documentation

◆ activate()

void GLContext::activate ( )
overridevirtual

◆ begin_frame()

void GLContext::begin_frame ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 152 of file gl_context.cc.

◆ buf_free()

void GLContext::buf_free ( GLuint  buf_id)
static

◆ check_error()

static void blender::gpu::GLContext::check_error ( const char *  info)
static

◆ deactivate()

void GLContext::deactivate ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 146 of file gl_context.cc.

References immDeactivate(), and blender::gpu::Context::is_active_.

◆ debug_group_begin()

void blender::gpu::GLContext::debug_group_begin ( const char *  name,
int  index 
)
overridevirtual

Reimplemented from blender::gpu::Context.

Definition at line 366 of file gl_debug.cc.

References G, and G_DEBUG_GPU.

◆ debug_group_end()

void blender::gpu::GLContext::debug_group_end ( )
overridevirtual

Reimplemented from blender::gpu::Context.

Definition at line 375 of file gl_debug.cc.

References G, and G_DEBUG_GPU.

◆ end_frame()

void GLContext::end_frame ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 157 of file gl_context.cc.

◆ fbo_free()

void GLContext::fbo_free ( GLuint  fbo_id)

Definition at line 240 of file gl_context.cc.

References get().

Referenced by blender::gpu::GLFrameBuffer::~GLFrameBuffer().

◆ finish()

void GLContext::finish ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 173 of file gl_context.cc.

◆ flush()

void GLContext::flush ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 168 of file gl_context.cc.

◆ get()

static GLContext* blender::gpu::GLContext::get ( )
inlinestatic

◆ memory_statistics_get()

void GLContext::memory_statistics_get ( int *  total_mem,
int *  free_mem 
)
overridevirtual

Implements blender::gpu::Context.

Definition at line 304 of file gl_context.cc.

◆ state_manager_active_get()

static GLStateManager* blender::gpu::GLContext::state_manager_active_get ( )
inlinestatic

◆ tex_free()

void GLContext::tex_free ( GLuint  tex_id)
static

◆ vao_cache_register()

void GLContext::vao_cache_register ( GLVaoCache cache)

Definition at line 284 of file gl_context.cc.

◆ vao_cache_unregister()

void GLContext::vao_cache_unregister ( GLVaoCache cache)

Definition at line 291 of file gl_context.cc.

Referenced by blender::gpu::GLVaoCache::clear().

◆ vao_free()

void GLContext::vao_free ( GLuint  vao_id)

Member Data Documentation

◆ base_instance_support

bool blender::gpu::GLContext::base_instance_support = false
static

◆ bound_ubo_slots

uint16_t blender::gpu::GLContext::bound_ubo_slots

Used for debugging purpose. Bitflags of all bound slots.

Definition at line 84 of file gl_context.hh.

Referenced by activate(), blender::gpu::GLUniformBuf::bind(), blender::gpu::debug::check_gl_resources(), and blender::gpu::GLUniformBuf::unbind().

◆ clear_texture_support

bool blender::gpu::GLContext::clear_texture_support = false
static

◆ copy_image_support

bool blender::gpu::GLContext::copy_image_support = false
static

◆ debug_layer_support

bool blender::gpu::GLContext::debug_layer_support = false
static

Definition at line 56 of file gl_context.hh.

Referenced by blender::gpu::detect_workarounds().

◆ debug_layer_workaround

bool blender::gpu::GLContext::debug_layer_workaround = false
static

Workarounds.

Definition at line 75 of file gl_context.hh.

Referenced by blender::gpu::detect_workarounds().

◆ default_attr_vbo_

GLuint blender::gpu::GLContext::default_attr_vbo_

VBO for missing vertex attrib binding. Avoid undefined behavior on some implementation.

Definition at line 81 of file gl_context.hh.

Referenced by GLContext(), blender::gpu::GLVertArray::update_bindings(), and ~GLContext().

◆ derivative_signs

float blender::gpu::GLContext::derivative_signs = {1.0f, 1.0f}
static

Definition at line 78 of file gl_context.hh.

Referenced by blender::gpu::detect_workarounds(), and glsl_patch_default_get().

◆ direct_state_access_support

bool blender::gpu::GLContext::direct_state_access_support = false
static

◆ explicit_location_support

bool blender::gpu::GLContext::explicit_location_support = false
static

◆ fixed_restart_index_support

bool blender::gpu::GLContext::fixed_restart_index_support = false
static

◆ generate_mipmap_workaround

bool blender::gpu::GLContext::generate_mipmap_workaround = false
static

◆ geometry_shader_invocations

bool blender::gpu::GLContext::geometry_shader_invocations = false
static

◆ layered_rendering_support

bool blender::gpu::GLContext::layered_rendering_support = false
static

◆ max_cubemap_size

GLint blender::gpu::GLContext::max_cubemap_size = 0
static

Capabilities.

Internal capabilities.

Definition at line 44 of file gl_context.hh.

◆ max_ssbo_binds

GLint blender::gpu::GLContext::max_ssbo_binds = 0
static

Definition at line 49 of file gl_context.hh.

Referenced by blender::gpu::GLStorageBuf::bind().

◆ max_ssbo_size

GLint blender::gpu::GLContext::max_ssbo_size = 0
static

Definition at line 48 of file gl_context.hh.

Referenced by blender::gpu::GLStorageBuf::GLStorageBuf().

◆ max_texture_3d_size

GLint blender::gpu::GLContext::max_texture_3d_size = 0
static

Definition at line 45 of file gl_context.hh.

◆ max_ubo_binds

GLint blender::gpu::GLContext::max_ubo_binds = 0
static

Definition at line 47 of file gl_context.hh.

Referenced by blender::gpu::GLUniformBuf::bind().

◆ max_ubo_size

GLint blender::gpu::GLContext::max_ubo_size = 0
static

Definition at line 46 of file gl_context.hh.

Referenced by blender::gpu::GLUniformBuf::GLUniformBuf().

◆ multi_bind_support

bool blender::gpu::GLContext::multi_bind_support = false
static

Definition at line 63 of file gl_context.hh.

Referenced by blender::gpu::detect_workarounds().

◆ multi_draw_indirect_support

bool blender::gpu::GLContext::multi_draw_indirect_support = false
static

◆ native_barycentric_support

bool blender::gpu::GLContext::native_barycentric_support = false
static

◆ shader_draw_parameters_support

bool blender::gpu::GLContext::shader_draw_parameters_support = false
static

◆ stencil_texturing_support

bool blender::gpu::GLContext::stencil_texturing_support = false
static

Definition at line 66 of file gl_context.hh.

Referenced by blender::gpu::GLTexture::stencil_texture_mode_set().

◆ texture_cube_map_array_support

bool blender::gpu::GLContext::texture_cube_map_array_support = false
static

◆ texture_filter_anisotropic_support

bool blender::gpu::GLContext::texture_filter_anisotropic_support = false
static

◆ texture_gather_support

bool blender::gpu::GLContext::texture_gather_support = false
static

Definition at line 69 of file gl_context.hh.

Referenced by blender::gpu::detect_workarounds(), and glsl_patch_default_get().

◆ texture_storage_support

bool blender::gpu::GLContext::texture_storage_support = false
static

◆ unused_fb_slot_workaround

bool blender::gpu::GLContext::unused_fb_slot_workaround = false
static

Definition at line 76 of file gl_context.hh.

Referenced by blender::gpu::detect_workarounds().

◆ vertex_attrib_binding_support

bool blender::gpu::GLContext::vertex_attrib_binding_support = false
static

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