Blender V5.0
DRW_engine.hh File Reference
#include "BLI_string_ref.hh"

Go to the source code of this file.

Namespaces

namespace  blender
namespace  blender::bke
namespace  blender::draw

Typedefs

using DRW_SelectPassFn = bool (*)(eDRWSelectStage stage, void *user_data)
using DRW_ObjectFilterFn = bool (*)(Object *ob, void *user_data)

Enumerations

enum  eDRWSelectStage { DRW_SELECT_PASS_PRE = 1 , DRW_SELECT_PASS_POST }

Functions

void DRW_engines_register ()
void DRW_engines_free ()
void DRW_module_init ()
void DRW_module_exit ()
void DRW_engine_external_free (RegionView3D *rv3d)
void DRW_draw_view (const bContext *C)
void DRW_draw_region_engine_info (int xoffset, int *yoffset, int line_height)
void DRW_draw_render_loop_offscreen (Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, bool is_image_render, bool draw_background, bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
void DRW_draw_select_loop (Depsgraph *depsgraph, ARegion *region, View3D *v3d, bool use_obedit_skip, bool draw_surface, bool use_nearest, bool do_material_sub_selection, const rcti *rect, DRW_SelectPassFn select_pass_fn, void *select_pass_user_data, DRW_ObjectFilterFn object_filter_fn, void *object_filter_user_data)
void DRW_draw_depth_loop (Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport, const bool use_gpencil, const bool use_only_selected, const bool use_only_active_object)
void DRW_draw_select_id (Depsgraph *depsgraph, ARegion *region, View3D *v3d)
bool DRW_draw_in_progress ()
bool DRW_render_check_grease_pencil (Depsgraph *depsgraph)
bool DRW_gpencil_engine_needed_viewport (Depsgraph *depsgraph, View3D *v3d)
void DRW_render_gpencil (RenderEngine *engine, Depsgraph *depsgraph)
void DRW_render_context_enable (Render *render)
void DRW_render_context_disable (Render *render)
void DRW_mutexes_init ()
void DRW_mutexes_exit ()
void DRW_lock_start ()
void DRW_lock_end ()
void DRW_submission_start ()
void DRW_submission_end ()
void DRW_gpu_context_create ()
void DRW_gpu_context_destroy ()
void DRW_gpu_context_enable ()
bool DRW_gpu_context_try_enable ()
bool DRW_gpu_context_is_enabled ()
void DRW_gpu_context_disable ()
void DRW_cache_free_old_batches (Main *bmain)
void blender::draw::DRW_cache_free_old_subdiv ()
void DRW_gpu_context_enable_ex (bool restore)
void DRW_gpu_context_disable_ex (bool restore)
void DRW_system_gpu_render_context_enable (void *re_system_gpu_context)
void DRW_system_gpu_render_context_disable (void *re_system_gpu_context)
void DRW_blender_gpu_render_context_enable (void *re_gpu_context)
void DRW_blender_gpu_render_context_disable (void *re_gpu_context)
DRWDataDRW_viewport_data_create ()
void DRW_viewport_data_free (DRWData *drw_data)
bool DRW_gpu_context_release ()
void DRW_gpu_context_activate (bool drw_state)
void blender::draw::DRW_cdlayer_attr_aliases_add (GPUVertFormat *format, const char *base_name, bke::AttrType data_type, blender::StringRef layer_name, bool is_active_render, bool is_active_layer)

Typedef Documentation

◆ DRW_ObjectFilterFn

using DRW_ObjectFilterFn = bool (*)(Object *ob, void *user_data)

Definition at line 51 of file DRW_engine.hh.

◆ DRW_SelectPassFn

using DRW_SelectPassFn = bool (*)(eDRWSelectStage stage, void *user_data)

Definition at line 50 of file DRW_engine.hh.

Enumeration Type Documentation

◆ eDRWSelectStage

Enumerator
DRW_SELECT_PASS_PRE 
DRW_SELECT_PASS_POST 

Definition at line 46 of file DRW_engine.hh.

Function Documentation

◆ DRW_blender_gpu_render_context_disable()

void DRW_blender_gpu_render_context_disable ( void * re_gpu_context)

Definition at line 280 of file draw_gpu_context.cc.

References GPU_context_active_set(), and GPU_flush().

Referenced by DRW_render_context_disable().

◆ DRW_blender_gpu_render_context_enable()

void DRW_blender_gpu_render_context_enable ( void * re_gpu_context)

◆ DRW_cache_free_old_batches()

◆ DRW_draw_depth_loop()

◆ DRW_draw_in_progress()

bool DRW_draw_in_progress ( )

Query that drawing is in progress (use to prevent nested draw calls).

Definition at line 2145 of file draw_context.cc.

References DRWContext::is_active().

Referenced by ED_view3d_draw_offscreen_check_nested().

◆ DRW_draw_region_engine_info()

void DRW_draw_region_engine_info ( int xoffset,
int * yoffset,
int line_height )

◆ DRW_draw_render_loop_offscreen()

◆ DRW_draw_select_id()

◆ DRW_draw_select_loop()

void DRW_draw_select_loop ( Depsgraph * depsgraph,
ARegion * region,
View3D * v3d,
bool use_obedit_skip,
bool draw_surface,
bool use_nearest,
bool do_material_sub_selection,
const rcti * rect,
DRW_SelectPassFn select_pass_fn,
void * select_pass_user_data,
DRW_ObjectFilterFn object_filter_fn,
void * object_filter_user_data )

Object mode select-loop.

Definition at line 1862 of file draw_context.cc.

References DRWContext::acquire_data(), BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT, BASE_FROM_DUPLI, BASE_SELECTABLE, BKE_modifiers_is_deformed_by_armature(), BKE_object_is_visible_in_viewport(), BKE_view_layer_active_object_get(), BLI_assert, BLI_rcti_size_x(), BLI_rcti_size_y(), DEG_get_evaluated_scene(), DEG_get_evaluated_view_layer(), DEG_get_original(), depsgraph, DefaultTextureList::depth, draw_select_framebuffer_depth_only_setup(), drw_callbacks_pre_scene(), DRW_context_get(), drw_engines_cache_populate(), DRW_gpencil_engine_needed_viewport(), DRW_SELECT_PASS_POST, DRW_SELECT_PASS_PRE, DRWContext::enable_engines(), DRWContext::engines_data_validate(), DRWContext::engines_draw_scene(), DRWContext::engines_init_and_sync(), View3DOverlay::flag, View3D::flag2, FOREACH_OBJECT_IN_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, blender::draw::foreach_obref_in_scene(), g_select_buffer, GPU_framebuffer_bind(), GPU_framebuffer_clear_depth(), GPU_framebuffer_restore(), Object::mode, nullptr, OB_ARMATURE, OB_MBALL, OB_MODE_POSE, OBEDIT_FROM_OBACT, ToolSettings::object_flag, DRWContext::object_pose, View3D::object_type_exclude_select, OBPOSE_FROM_OBACT, OBWEIGHTPAINT_FROM_OBACT, View3D::overlay, DRWContext::release_data(), SCE_OBJECT_MODE_LOCK, DRWContext::SELECT_OBJECT, DRWContext::SELECT_OBJECT_MATERIAL, Scene::toolsettings, Object::type, V3D_HIDE_OVERLAYS, V3D_OVERLAY_BONE_SELECT, and DRWContext::viewport_texture_list_get().

Referenced by view3d_gpu_select_ex().

◆ DRW_draw_view()

◆ DRW_engine_external_free()

◆ DRW_engines_free()

◆ DRW_engines_register()

void DRW_engines_register ( )

◆ DRW_gpencil_engine_needed_viewport()

bool DRW_gpencil_engine_needed_viewport ( Depsgraph * depsgraph,
View3D * v3d )

This function only does following things to make quick checks for whether Grease Pencil drawing is needed:

  • Whether Grease Pencil objects are excluded in the viewport.
  • If any Grease Pencil typed ID exists inside the depsgraph. Note: it does not to full check for cases where Grease Pencil strokes are generated within a non-grease-pencil object, to do complete check, use DRW_render_check_grease_pencil.

Definition at line 1173 of file draw_context.cc.

References depsgraph, gpencil_any_exists(), and gpencil_object_is_excluded().

Referenced by drw_draw_render_loop_3d(), and DRW_draw_select_loop().

◆ DRW_gpu_context_activate()

◆ DRW_gpu_context_create()

void DRW_gpu_context_create ( )

Definition at line 166 of file draw_gpu_context.cc.

References BLI_assert, DRW_mutexes_init(), preview_context, and viewport_context.

Referenced by WM_init_gpu().

◆ DRW_gpu_context_destroy()

void DRW_gpu_context_destroy ( )

◆ DRW_gpu_context_disable()

◆ DRW_gpu_context_disable_ex()

void DRW_gpu_context_disable_ex ( bool restore)

◆ DRW_gpu_context_enable()

◆ DRW_gpu_context_enable_ex()

void DRW_gpu_context_enable_ex ( bool restore)

Never use this. Only for closing blender.

Definition at line 196 of file draw_gpu_context.cc.

References viewport_context.

Referenced by DRW_engine_external_free(), DRW_gpu_context_enable(), DRW_gpu_context_try_enable(), and WM_exit_ex().

◆ DRW_gpu_context_is_enabled()

bool DRW_gpu_context_is_enabled ( )

Returns true if the DRW_gpu_context is enabled on the calling thread.

Definition at line 247 of file draw_gpu_context.cc.

References viewport_context.

Referenced by DRW_engine_external_free().

◆ DRW_gpu_context_release()

◆ DRW_gpu_context_try_enable()

bool DRW_gpu_context_try_enable ( )

Tries to bind the draw GPU context to the active thread. Returns true on success, false if the draw GPU context does not exists.

Definition at line 238 of file draw_gpu_context.cc.

References DRW_gpu_context_enable_ex(), and viewport_context.

Referenced by RE_engines_exit().

◆ DRW_lock_end()

void DRW_lock_end ( )

◆ DRW_lock_start()

◆ DRW_module_exit()

void DRW_module_exit ( )

◆ DRW_module_init()

void DRW_module_init ( )

Definition at line 2247 of file draw_context.cc.

References BKE_curve_batch_cache_dirty_tag_cb, BKE_curve_batch_cache_free_cb, BKE_curves_batch_cache_dirty_tag_cb, BKE_curves_batch_cache_free_cb, BKE_grease_pencil_batch_cache_dirty_tag_cb, BKE_grease_pencil_batch_cache_free_cb, BKE_lattice_batch_cache_dirty_tag_cb, BKE_lattice_batch_cache_free_cb, BKE_mesh_batch_cache_dirty_tag_cb, BKE_mesh_batch_cache_free_cb, BKE_particle_batch_cache_dirty_tag_cb, BKE_particle_batch_cache_free_cb, BKE_pointcloud_batch_cache_dirty_tag_cb, BKE_pointcloud_batch_cache_free_cb, BKE_subsurf_modifier_free_gpu_cache_cb, BKE_volume_batch_cache_dirty_tag_cb, BKE_volume_batch_cache_free_cb, blender::draw::DRW_curve_batch_cache_dirty_tag(), blender::draw::DRW_curve_batch_cache_free(), blender::draw::DRW_curves_batch_cache_dirty_tag(), blender::draw::DRW_curves_batch_cache_free(), blender::draw::DRW_grease_pencil_batch_cache_dirty_tag(), blender::draw::DRW_grease_pencil_batch_cache_free(), blender::draw::DRW_lattice_batch_cache_dirty_tag(), blender::draw::DRW_lattice_batch_cache_free(), blender::draw::DRW_mesh_batch_cache_dirty_tag(), blender::draw::DRW_mesh_batch_cache_free(), blender::draw::DRW_particle_batch_cache_dirty_tag(), blender::draw::DRW_particle_batch_cache_free(), blender::draw::DRW_pointcloud_batch_cache_dirty_tag(), blender::draw::DRW_pointcloud_batch_cache_free(), blender::draw::DRW_subdiv_cache_free(), blender::draw::DRW_volume_batch_cache_dirty_tag(), and blender::draw::DRW_volume_batch_cache_free().

Referenced by RE_engines_init().

◆ DRW_mutexes_exit()

void DRW_mutexes_exit ( )

Definition at line 40 of file draw_gpu_context.cc.

References BLI_ticket_mutex_free(), draw_mutex, and submission_mutex.

Referenced by DRW_gpu_context_destroy().

◆ DRW_mutexes_init()

void DRW_mutexes_init ( )

Definition at line 34 of file draw_gpu_context.cc.

References BLI_ticket_mutex_alloc(), draw_mutex, and submission_mutex.

Referenced by DRW_gpu_context_create().

◆ DRW_render_check_grease_pencil()

◆ DRW_render_context_disable()

◆ DRW_render_context_enable()

◆ DRW_render_gpencil()

◆ DRW_submission_end()

◆ DRW_submission_start()

◆ DRW_system_gpu_render_context_disable()

void DRW_system_gpu_render_context_disable ( void * re_system_gpu_context)

Definition at line 266 of file draw_gpu_context.cc.

References DRW_lock_end(), and WM_system_gpu_context_release().

Referenced by DRW_render_context_disable().

◆ DRW_system_gpu_render_context_enable()

void DRW_system_gpu_render_context_enable ( void * re_system_gpu_context)

◆ DRW_viewport_data_create()

DRWData * DRW_viewport_data_create ( )

◆ DRW_viewport_data_free()