136 if (
DST.draw_ctx.space_data ==
nullptr) {
142 switch (
DST.draw_ctx.space_data->spacetype) {
174 DST.delayed_extraction =
nullptr;
178 DST.task_graph =
nullptr;
270 return DST.dupli_parent;
275 return DST.dupli_source;
288 DST.inv_size[0] = 1.0f /
size[0];
289 DST.inv_size[1] = 1.0f /
size[1];
310 if (
DST.draw_ctx.obact) {
319 DST.draw_ctx.object_edit =
DST.draw_ctx.obact;
322 DST.draw_ctx.object_edit =
nullptr;
327 DST.draw_ctx.object_pose =
DST.draw_ctx.obact;
333 DST.draw_ctx.object_pose =
nullptr;
402 for (
int i = 0; i < 2; i++) {
426 if (++attr->users > 10) {
481 for (
int i = 0; i < 2; i++) {
485 for (
int i = 0; i < drw_data->
ubo_len; i++) {
500 DRWData *vmempool = *vmempool_p;
502 if (vmempool ==
nullptr) {
550 bool do_validation =
true;
551 if (
size ==
nullptr && viewport ==
nullptr) {
556 else if (
size ==
nullptr) {
567 do_validation =
false;
586 if (rv3d !=
nullptr) {
603 rctf region_space = {0.0f, 1.0f, 0.0f, 1.0f};
609 winmat[3][0] = -1.0f;
610 winmat[3][1] = -1.0f;
628 if (
G_draw.view_ubo ==
nullptr) {
632 if (
G_draw.clipping_ubo ==
nullptr) {
634 sizeof(
float4) * 6,
nullptr,
"G_draw.clipping_ubo");
696 return dupli_key1->
ob != dupli_key2->
ob || dupli_key1->
ob_data != dupli_key2->
ob_data;
702 if (dupli ==
nullptr) {
706 if (
DST.dupli_origin != dupli->
ob || (
DST.dupli_origin_data != dupli->
ob_data)) {
707 DST.dupli_origin = dupli->
ob;
715 if (
DST.dupli_ghash ==
nullptr) {
734 DST.dupli_datas = *(
void ***)value;
739 void **dupli_datas =
static_cast<void **
>(val);
753 Object temp_object = blender::dna::shallow_copy(*dupli_key->
ob);
755 temp_object.
runtime = &runtime;
766 if (
DST.dupli_ghash !=
nullptr) {
768 DST.dupli_ghash =
nullptr;
774 if (
DST.dupli_source ==
nullptr) {
779 return &
DST.dupli_datas[engine_type->
index];
791 if (sled->engine_type == engine_type) {
792 return sled->storage;
800 void (*callback)(
void *storage))
813 sled->
free = callback;
820 void (*callback)(
void *storage))
891 if (drawdata ==
nullptr) {
896 if (dd->engine_type == engine_type) {
924 const size_t t =
sizeof(
float) - 1;
928 if (
DST.object_instance_data[fsize] ==
nullptr) {
940 if (init_cb !=
nullptr) {
952 if (drawdata ==
nullptr) {
957 if (dd->free !=
nullptr) {
971 if (drawdata ==
nullptr) {
989 static int lasttime = 0;
992 if (
U.vbotimeout == 0 || (ctime - lasttime) <
U.vbocollectrate || ctime == lasttime) {
1032 memset(
data->psl->passes, 0,
sizeof(*
data->psl->passes) * data_size->
psl_len);
1034 if (engine->engine_init) {
1035 engine->engine_init(
data);
1047 if (
data->text_draw_cache) {
1049 data->text_draw_cache =
nullptr;
1051 if (
DST.text_store_p ==
nullptr) {
1052 DST.text_store_p = &
data->text_draw_cache;
1055 if (engine->cache_init) {
1056 engine->cache_init(
data);
1063 if (scene->
world ==
nullptr) {
1068 if (engine->id_update) {
1085 if (!
DST.dupli_source) {
1090 if (engine->id_update) {
1091 engine->id_update(
data, &ob->
id);
1094 if (engine->cache_populate) {
1095 engine->cache_populate(
data, ob);
1101 if (!
DST.dupli_source) {
1113 if (engine->cache_finish) {
1114 engine->cache_finish(
data);
1125 if (engine->draw_scene) {
1127 engine->draw_scene(
data);
1145 if (
data->text_draw_cache) {
1156 if (
data->info[0] !=
'\0') {
1159 const char *buf = buf_step;
1161 const int buf_len = buf_step - buf;
1162 *yoffset -= line_height;
1164 }
while (*buf_step ? ((
void)buf_step++,
true) :
false);
1245 if (!
DST.draw_ctx.v3d) {
1257 if (!
DST.draw_ctx.scene->use_nodes) {
1261 if (!
DST.draw_ctx.scene->nodetree) {
1265 if (!
DST.draw_ctx.rv3d) {
1280 bool gpencil_engine_needed)
1287 if (gpencil_engine_needed && ((drawtype >=
OB_SOLID) || !use_xray)) {
1297#ifdef WITH_DRAW_DEBUG
1298 if (
G.debug_value == 31) {
1318 const bool exclude_gpencil_rendering =
1364 DST.draw_ctx.region = region;
1365 DST.draw_ctx.rv3d = rv3d;
1366 DST.draw_ctx.v3d = v3d;
1367 DST.draw_ctx.scene = scene;
1368 DST.draw_ctx.view_layer = view_layer;
1370 DST.draw_ctx.engine_type = engine_type;
1375 DST.viewport = viewport;
1381 DST.view_data_active =
DST.vmempool->view_data[
view];
1417 DST.draw_ctx.region = region;
1418 DST.draw_ctx.rv3d = rv3d;
1419 DST.draw_ctx.v3d = v3d;
1420 DST.draw_ctx.scene = scene;
1421 DST.draw_ctx.view_layer = view_layer;
1423 DST.draw_ctx.engine_type = engine_type;
1427 DST.viewport = viewport;
1433 DST.view_data_active =
DST.vmempool->view_data[
view];
1460 if (
DST.draw_ctx.evil_C) {
1477 if (
DST.draw_ctx.evil_C) {
1489 if (do_annotations) {
1504#ifdef WITH_XR_OPENXR
1555 if (
G.debug_value > 20 &&
G.debug_value < 30) {
1572#ifdef WITH_XR_OPENXR
1618 if (*
DST.text_store_p ==
nullptr) {
1621 return *
DST.text_store_p;
1671 DST.draw_ctx.region = region;
1672 DST.draw_ctx.rv3d = rv3d;
1673 DST.draw_ctx.v3d = v3d;
1674 DST.draw_ctx.scene = scene;
1675 DST.draw_ctx.view_layer = view_layer;
1677 DST.draw_ctx.engine_type = engine_type;
1681 DST.draw_ctx.evil_C = evil_C;
1695 const bool do_populate_loop = internal_engine || overlays_on || !draw_type_render ||
1696 gpencil_engine_needed;
1724 if (do_populate_loop) {
1725 DST.dupli_origin =
nullptr;
1726 DST.dupli_origin_data =
nullptr;
1734 if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
1740 DST.dupli_parent = data_.dupli_parent;
1741 DST.dupli_source = data_.dupli_object_current;
1820 const bool is_image_render,
1822 const bool do_color_management,
1830 if (viewport ==
nullptr) {
1844 DST.options.is_image_render = is_image_render;
1874 if (viewport ==
nullptr) {
1922 if (render_layer ==
nullptr) {
1933 DST.options.is_image_render =
true;
1934 DST.options.is_scene_render =
true;
1936 DST.buffer_finish_called =
true;
1939 DST.draw_ctx.scene = scene;
1940 DST.draw_ctx.view_layer = view_layer;
1941 DST.draw_ctx.engine_type = engine_type;
1960 render_view !=
nullptr;
1961 render_view = render_view->
next)
1965 DST.buffer_finish_called =
false;
1980 DST.buffer_finish_called =
false;
1998 DST.options.is_image_render =
true;
1999 DST.options.is_scene_render =
true;
2002 DST.draw_ctx.scene = scene;
2003 DST.draw_ctx.view_layer = view_layer;
2004 DST.draw_ctx.engine_type = engine_type;
2044 render_view !=
nullptr;
2045 render_view = render_view->
next)
2050 DST.buffer_finish_called =
false;
2088 const int object_type_exclude_viewport = draw_ctx->
v3d ?
2091 DST.dupli_origin =
nullptr;
2092 DST.dupli_origin_data =
nullptr;
2097 if ((object_type_exclude_viewport & (1 << ob->
type)) == 0) {
2098 DST.dupli_parent = data_.dupli_parent;
2099 DST.dupli_source = data_.dupli_object_current;
2103 if (!
DST.dupli_source) {
2106 callback(vedata, ob, engine,
depsgraph);
2107 if (!
DST.dupli_source) {
2126 DST.options.is_image_render =
true;
2127 DST.options.is_scene_render =
true;
2128 DST.options.draw_background =
false;
2131 DST.draw_ctx.scene = scene;
2132 DST.draw_ctx.view_layer = view_layer;
2133 DST.draw_ctx.engine_type =
nullptr;
2151 DST.buffer_finish_called =
false;
2171 void (*callback)(
void *vedata,
void *user_data),
2179 callback(
data, user_data);
2191 DST.buffer_finish_called =
false;
2209 DST.draw_ctx.region = region;
2210 DST.draw_ctx.scene = scene;
2211 DST.draw_ctx.view_layer = view_layer;
2217 DST.draw_ctx.evil_C = evil_C;
2225 const bool do_populate_loop = (
DST.draw_ctx.space_data->spacetype ==
SPACE_IMAGE);
2227 const bool do_draw_gizmos = (
DST.draw_ctx.space_data->spacetype !=
SPACE_IMAGE);
2253 if (do_populate_loop) {
2281 if (
DST.draw_ctx.evil_C) {
2292 if (
DST.draw_ctx.evil_C) {
2302 if (do_annotations) {
2315 if (do_annotations) {
2324 if (do_draw_gizmos) {
2331 if (
G.debug_value > 20 &&
G.debug_value < 30) {
2388 BLI_assert_msg(!
DST.buffer_finish_called,
"DRW_render_instance_buffer_finish called twice!");
2389 DST.buffer_finish_called =
true;
2404 bool use_obedit_skip,
2407 const bool do_material_sub_selection,
2410 void *select_pass_user_data,
2412 void *object_filter_user_data)
2422#ifndef USE_GPU_SELECT
2423 UNUSED_VARS(scene, view_layer, v3d, region, rect);
2430 bool use_obedit =
false;
2435 int object_type = 0;
2436 if (obedit !=
nullptr) {
2437 object_type = obedit->
type;
2452 if (obpose ==
nullptr) {
2458 obpose = ob_armature;
2465 object_type = obpose->
type;
2474 DST.draw_ctx.region = region;
2475 DST.draw_ctx.rv3d = rv3d;
2476 DST.draw_ctx.v3d = v3d;
2477 DST.draw_ctx.scene = scene;
2478 DST.draw_ctx.view_layer = view_layer;
2479 DST.draw_ctx.obact = obact;
2480 DST.draw_ctx.engine_type = engine_type;
2488 DST.options.is_select =
true;
2489 DST.options.is_material_select = do_material_sub_selection;
2492 if (
U.experimental.enable_overlay_next) {
2495 else if (use_obedit) {
2498 else if (!draw_surface) {
2541 const bool use_pose_exception = (
DST.draw_ctx.object_pose !=
nullptr);
2545 bool filter_exclude =
false;
2546 DST.dupli_origin =
nullptr;
2547 DST.dupli_origin_data =
nullptr;
2570 if ((object_type_exclude_select & (1 << ob->type)) == 0) {
2571 if (object_filter_fn !=
nullptr) {
2576 filter_exclude = (object_filter_fn(ob, object_filter_user_data) ==
false);
2578 if (filter_exclude) {
2584 DST.dupli_parent = data_.dupli_parent;
2585 DST.dupli_source = data_.dupli_object_current;
2619 if (!
U.experimental.enable_overlay_next) {
2625 if (!
U.experimental.enable_overlay_next) {
2653 const bool use_gpencil,
2654 const bool use_basic,
2655 const bool use_overlay,
2656 const bool use_only_selected)
2667 DST.options.is_depth =
true;
2672 DST.draw_ctx.region = region;
2673 DST.draw_ctx.rv3d = rv3d;
2674 DST.draw_ctx.v3d = v3d;
2675 DST.draw_ctx.scene = scene;
2676 DST.draw_ctx.view_layer = view_layer;
2678 DST.draw_ctx.engine_type = engine_type;
2699 GPUFrameBuffer *depth_fb =
nullptr;
2724 DST.dupli_origin =
nullptr;
2725 DST.dupli_origin_data =
nullptr;
2733 if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
2739 if (use_only_selected && !(ob->base_flag &
BASE_SELECTED)) {
2742 DST.dupli_parent = data_.dupli_parent;
2743 DST.dupli_source = data_.dupli_object_current;
2798 DST.draw_ctx.region = region;
2799 DST.draw_ctx.rv3d = rv3d;
2800 DST.draw_ctx.v3d = v3d;
2801 DST.draw_ctx.scene = scene;
2802 DST.draw_ctx.view_layer = view_layer;
2853 DST.buffer_finish_called =
true;
2882 GPUFrameBuffer *depth_fb =
nullptr;
2895 if (use_clipping_planes) {
2898 for (
int i = 0; i < 6; i++) {
2906 switch (object->
type) {
2908 blender::gpu::Batch *
batch;
2910 Mesh &mesh = *
static_cast<Mesh *
>(
object->data);
2927 GPUUniformBuf *ubo =
nullptr;
2928 if (use_clipping_planes) {
2955 return DST.in_progress;
2966 return ((
DST.default_framebuffer !=
nullptr) ||
DST.options.is_image_render) &&
2972 return DST.options.is_select;
2977 return DST.options.is_material_select;
2982 return DST.options.is_depth;
2987 return DST.options.is_image_render;
2992 BLI_assert(
DST.options.is_scene_render ?
DST.options.is_image_render :
true);
2993 return DST.options.is_scene_render;
2998 return DST.options.is_image_render && !
DST.options.is_scene_render;
3003 if (
DST.draw_ctx.evil_C !=
nullptr) {
3024 return (
DST.options.is_select) == 0 && (
DST.options.is_depth) == 0 &&
3025 (
DST.options.is_scene_render) == 0 && (
DST.options.draw_text) == 0;
3037 return DST.options.draw_background;
3048 return &
DST.draw_ctx;
3088#ifdef WITH_DRAW_DEBUG
3139 if (type->draw_engine->engine_free) {
3140 type->draw_engine->engine_free();
3154 if (
DST.system_gpu_context ==
nullptr) {
3175 DST.debug =
nullptr;
3183 if (
DST.draw_list) {
3192 if (
G.background &&
DST.system_gpu_context ==
nullptr) {
3207 if (re_system_gpu_context !=
nullptr) {
3229 if (re_system_gpu_context !=
nullptr) {
3267 if (
DST.system_gpu_context !=
nullptr) {
3279 if (
DST.system_gpu_context !=
nullptr) {
3292 if (
DST.system_gpu_context !=
nullptr) {
3313 if (
G.background &&
DST.system_gpu_context ==
nullptr) {
3357#ifdef WITH_XR_OPENXR
3359void *DRW_system_gpu_context_get()
3370 return DST.system_gpu_context;
3373void *DRW_xr_blender_gpu_context_get()
3377 return DST.blender_gpu_context;
3380void DRW_xr_drawing_begin()
3387void DRW_xr_drawing_end()
3402#ifdef WITH_GPU_DRAW_TESTS
3406 DST.draw_ctx.sh_cfg = sh_cfg;
Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
SpaceLink * CTX_wm_space_data(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
void(* BKE_curve_batch_cache_free_cb)(Curve *cu)
void(* BKE_curve_batch_cache_dirty_tag_cb)(Curve *cu, int mode)
Low-level operations for curves that cannot be defined in the C++ header yet.
void(* BKE_curves_batch_cache_dirty_tag_cb)(struct Curves *curves, int mode)
void(* BKE_curves_batch_cache_free_cb)(struct Curves *curves)
void(* BKE_gpencil_batch_cache_dirty_tag_cb)(struct bGPdata *gpd)
void(* BKE_gpencil_batch_cache_free_cb)(struct bGPdata *gpd)
Low-level operations for grease pencil that cannot be defined in the C++ header yet.
void(* BKE_grease_pencil_batch_cache_dirty_tag_cb)(GreasePencil *grease_pencil, int mode)
void(* BKE_grease_pencil_batch_cache_free_cb)(GreasePencil *grease_pencil)
void(* BKE_lattice_batch_cache_dirty_tag_cb)(Lattice *lt, int mode)
void(* BKE_lattice_batch_cache_free_cb)(Lattice *lt)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
#define FOREACH_OBJECT_IN_MODE_END
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
bool BKE_object_is_visible_in_viewport(const View3D *v3d, const Object *ob)
#define FOREACH_OBJECT_IN_MODE_BEGIN(_scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
void(* BKE_mesh_batch_cache_free_cb)(void *batch_cache)
void(* BKE_mesh_batch_cache_dirty_tag_cb)(Mesh *mesh, eMeshBatchDirtyMode mode)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
General operations, lookup, etc. for blender objects.
bool BKE_object_is_in_editmode(const Object *ob)
void BKE_object_replace_data_on_shallow_copy(Object *ob, ID *new_data)
Object * BKE_object_pose_armature_get(Object *ob)
int BKE_object_visibility(const Object *ob, int dag_eval_mode)
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, bool use_render_params)
void(* BKE_particle_batch_cache_dirty_tag_cb)(struct ParticleSystem *psys, int mode)
bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys)
void(* BKE_particle_batch_cache_free_cb)(struct ParticleSystem *psys)
General operations for point clouds.
void(* BKE_pointcloud_batch_cache_free_cb)(PointCloud *pointcloud)
void(* BKE_pointcloud_batch_cache_dirty_tag_cb)(PointCloud *pointcloud, int mode)
Depsgraph * BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
SpaceType * BKE_spacetype_from_id(int spaceid)
ARegionType * BKE_regiontype_from_id(const SpaceType *st, int regionid)
void(* BKE_subsurf_modifier_free_gpu_cache_cb)(blender::bke::subdiv::Subdiv *subdiv)
void(* BKE_volume_batch_cache_dirty_tag_cb)(Volume *volume, int mode)
void(* BKE_volume_batch_cache_free_cb)(Volume *volume)
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
GSet * BLI_gset_ptr_new(const char *info)
unsigned int BLI_ghashutil_ptrhash(const void *key)
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghashutil_inthash_p_simple(const void *ptr)
bool BLI_ghashutil_intcmp(const void *a, const void *b)
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void unit_m4(float m[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_fl(float r[3], float f)
void BLI_memblock_destroy(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1)
void * BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_memblock_create(elem_size)
BLI_memblock * BLI_memblock_create_ex(uint elem_size, uint chunk_size) ATTR_WARN_UNUSED_RESULT
void BLI_memblock_iternew(BLI_memblock *mblk, BLI_memblock_iter *iter) ATTR_NONNULL()
void BLI_memblock_clear(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1)
void * BLI_memblock_iterstep(BLI_memblock_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
bool BLI_rcti_is_empty(const struct rcti *rect)
char char size_t char const char * BLI_strchr_or_end(const char *str, char ch) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
void BLI_task_graph_free(struct TaskGraph *task_graph)
struct TaskGraph * BLI_task_graph_create(void)
void BLI_task_graph_work_and_wait(struct TaskGraph *task_graph)
TicketMutex * BLI_ticket_mutex_alloc(void)
void BLI_ticket_mutex_unlock(TicketMutex *ticket)
bool BLI_ticket_mutex_lock_check_recursive(TicketMutex *ticket)
void BLI_ticket_mutex_lock(TicketMutex *ticket)
void BLI_ticket_mutex_free(TicketMutex *ticket)
int BLI_thread_is_main(void)
double BLI_time_now_seconds(void)
#define POINTER_FROM_UINT(i)
#define CLOG_ERROR(clg_ref,...)
#define DEG_OBJECT_ITER_BEGIN(settings_, instance_)
#define DEG_OBJECT_ITER_END
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS
Scene * DEG_get_input_scene(const Depsgraph *graph)
bool DEG_id_type_any_exists(const Depsgraph *depsgraph, short id_type)
void(* DrawDataFreeCb)(struct DrawData *engine_data)
void(* DrawDataInitCb)(struct DrawData *engine_data)
@ BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
#define OB_MODE_ALL_WEIGHT_PAINT
#define OBPOSE_FROM_OBACT(ob)
#define BASE_SELECTED(v3d, base)
#define OBEDIT_FROM_OBACT(ob)
#define OBWEIGHTPAINT_FROM_OBACT(ob)
#define BASE_SELECTABLE(v3d, base)
@ V3D_SHADING_USE_COMPOSITOR_CAMERA
@ V3D_SHADING_USE_COMPOSITOR_DISABLED
#define RV3D_LOCK_FLAGS(rv3d)
@ V3D_SHADING_SCENE_WORLD_RENDER
@ V3D_SHADING_SCENE_WORLD
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
@ V3D_OVERLAY_BONE_SELECT
@ V3D_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_XR_SHOW_CONTROLLERS
void DRW_instance_data_list_free(DRWInstanceDataList *idatalist)
DRWInstanceDataList * DRW_instance_data_list_create()
bool(*)(Object *ob, void *user_data) DRW_ObjectFilterFn
bool(*)(eDRWSelectStage stage, void *user_data) DRW_SelectPassFn
void DRW_uniform_attrs_pool_free(GHash *table)
#define DRW_UBO_FREE_SAFE(ubo)
#define DRW_TEXTURE_FREE_SAFE(tex)
const rcti * ED_region_visible_rect(ARegion *region)
void ED_region_pixelspace(const ARegion *region)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
#define REGION_DRAW_POST_VIEW
void ED_region_surface_draw_cb_draw(ARegionType *art, int type)
#define REGION_DRAW_PRE_VIEW
#define XRAY_ENABLED(v3d)
#define RETOPOLOGY_ENABLED(v3d)
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4])
RenderEngineType * ED_view3d_engine_type(const Scene *scene, int drawtype)
#define GPU_batch_uniformbuf_bind(batch, name, ubo)
void GPU_batch_draw(blender::gpu::Batch *batch)
void GPU_batch_program_set_builtin_with_config(blender::gpu::Batch *batch, eGPUBuiltinShader shader_id, eGPUShaderConfig sh_cfg)
bool GPU_use_main_context_workaround()
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
void GPU_context_main_lock()
GPUContext * GPU_context_active_get()
void GPU_context_main_unlock()
void GPU_context_discard(GPUContext *)
void GPU_context_active_set(GPUContext *)
eGPUBackendType GPU_backend_get_type()
GPUDrawList * GPU_draw_list_create(int list_length)
void GPU_draw_list_discard(GPUDrawList *list)
bool GPU_framebuffer_check_valid(GPUFrameBuffer *framebuffer, char err_out[256])
GPUFrameBuffer * GPU_framebuffer_create(const char *name)
#define GPU_FRAMEBUFFER_FREE_SAFE(fb)
#define GPU_ATTACHMENT_TEXTURE(_texture)
GPUFrameBuffer * GPU_framebuffer_active_get()
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_framebuffer_restore()
void GPU_framebuffer_clear_depth_stencil(GPUFrameBuffer *fb, float clear_depth, uint clear_stencil)
#define GPU_ATTACHMENT_NONE
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
#define GPU_framebuffer_ensure_config(_fb,...)
void GPU_framebuffer_clear_depth(GPUFrameBuffer *fb, float clear_depth)
void GPU_framebuffer_free(GPUFrameBuffer *framebuffer)
GPUFrameBuffer * GPU_framebuffer_back_get()
void GPU_framebuffer_texture_attach(GPUFrameBuffer *framebuffer, GPUTexture *texture, int slot, int mip)
void GPU_matrix_identity_projection_set()
void GPU_matrix_identity_set()
#define GPU_matrix_set(x)
void GPU_matrix_push_projection()
#define GPU_matrix_mul(x)
void GPU_matrix_pop_projection()
#define GPU_matrix_projection_set(x)
@ GPU_SHADER_3D_DEPTH_ONLY
@ GPU_BLEND_ALPHA_PREMULT
void GPU_blend(eGPUBlend blend)
void GPU_viewport(int x, int y, int width, int height)
void GPU_depth_test(eGPUDepthTest test)
void GPU_clip_distances(int distances_enabled)
int GPU_texture_height(const GPUTexture *texture)
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_free(GPUTexture *texture)
int GPU_texture_width(const GPUTexture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
GPUTexture * GPU_viewport_color_texture(GPUViewport *viewport, int view)
void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport, GPUOffScreen *ofs, bool display_colorspace, bool do_overlay_merge)
GPUViewport * GPU_viewport_create()
void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, GPUOffScreen *ofs, bool is_xr_surface)
bool GPU_viewport_is_stereo_get(GPUViewport *viewport)
bool GPU_viewport_do_update(GPUViewport *viewport)
int GPU_viewport_active_view_get(GPUViewport *viewport)
void GPU_viewport_free(GPUViewport *viewport)
GPUTexture * GPU_viewport_depth_texture(GPUViewport *viewport)
void GPU_viewport_tag_update(GPUViewport *viewport)
DRWData ** GPU_viewport_data_get(GPUViewport *viewport)
void UI_SetTheme(int spacetype, int regionid)
void ED_annotation_draw_view3d(Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
DrawEngineType draw_engine_basic_type
struct GPUContext GPUContext
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
DrawEngineType draw_engine_compositor_type
void drw_batch_cache_generate_requested_evaluated_mesh_or_curve(Object *ob)
void DRW_shape_cache_free()
void drw_batch_cache_generate_requested(Object *ob)
void drw_batch_cache_validate(Object *ob)
void DRW_viewport_colormanagement_set(GPUViewport *viewport)
void DRW_globals_update()
void DRW_volume_ubos_pool_free(void *pool)
void DRW_volume_init(DRWData *drw_data)
void DRW_smoke_exit(DRWData *drw_data)
void DRW_smoke_init(DRWData *drw_data)
void drw_debug_module_free(DRWDebugModule *module)
void DRW_instance_data_list_free_unused(DRWInstanceDataList *idatalist)
void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist)
void DRW_uniform_attrs_pool_clear_all(GHash *table)
void * DRW_instance_data_next(DRWInstanceData *idata)
GHash * DRW_uniform_attrs_pool_new()
void DRW_instance_data_list_reset(DRWInstanceDataList *idatalist)
DRWInstanceData * DRW_instance_data_request(DRWInstanceDataList *idatalist, uint attr_size)
void DRW_instance_data_list_resize(DRWInstanceDataList *idatalist)
#define MAX_INSTANCE_DATA_SIZE
Object * DRW_object_get_dupli_parent(const Object *)
void DRW_drawdata_free(ID *id)
void DRW_gpu_context_destroy()
DrawData * DRW_drawdata_get(ID *id, DrawEngineType *engine_type)
static void drw_notify_view_update_offscreen(Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, GPUViewport *viewport)
static void drw_engines_cache_finish()
const float * DRW_viewport_invert_size_get()
static void drw_duplidata_load(Object *ob)
void DRW_draw_render_loop_ex(Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, GPUViewport *viewport, const bContext *evil_C)
const float * DRW_viewport_pixelsize_get()
bool DRW_state_show_text()
static struct @240002152062234236166251222023357333301223256174 g_registered_engines
bool DRW_render_check_grease_pencil(Depsgraph *depsgraph)
DRWData * DRW_viewport_data_create()
static void drw_engines_world_update(Scene *scene)
static bool drw_draw_show_annotation()
void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height)
bool DRW_draw_in_progress()
bool DRW_state_draw_background()
void DRW_draw_view(const bContext *C)
static void draw_unit_state_create()
void * DRW_view_layer_engine_data_get(DrawEngineType *engine_type)
static void drw_manager_exit(DRWManager *dst)
void DRW_draw_render_loop(Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport)
bool DRW_state_is_viewport_image_render()
bool DRW_engine_render_support(DrawEngineType *draw_engine_type)
static void drw_manager_init(DRWManager *dst, GPUViewport *viewport, const int size[2])
DefaultFramebufferList * DRW_viewport_framebuffer_list_get()
void DRW_notify_view_update(const DRWUpdateContext *update_ctx)
static void drw_engines_init()
bool DRW_object_is_in_edit_mode(const Object *ob)
bool DRW_state_is_material_select()
blender::draw::TextureFromPool & DRW_viewport_pass_texture_get(const char *pass_name)
void DRW_render_viewport_size_set(const int size[2])
void ** DRW_view_layer_engine_data_ensure_ex(ViewLayer *view_layer, DrawEngineType *engine_type, void(*callback)(void *storage))
void DRW_gpu_context_disable()
static void duplidata_value_free(void *val)
const float * DRW_viewport_size_get()
static DRWData * drw_viewport_data_ensure(GPUViewport *viewport)
static void use_drw_engine(DrawEngineType *engine)
void DRW_gpu_context_disable_ex(bool restore)
bool DRW_object_use_hide_faces(const Object *ob)
static void drw_state_prepare_clean_for_draw(DRWManager *dst)
void DRW_draw_callbacks_pre_scene()
static void draw_prune_vlattrs(DRWData *drw_data)
static void drw_context_state_init()
bool DRW_object_is_renderable(const Object *ob)
DRWTextStore * DRW_text_cache_ensure()
static void drw_engines_enable_editors()
DrawData * DRW_drawdata_ensure(ID *id, DrawEngineType *engine_type, size_t size, DrawDataInitCb init_cb, DrawDataFreeCb free_cb)
void DRW_cache_free_old_batches(Main *bmain)
void DRW_gpu_context_enable_ex(bool)
void DRW_draw_depth_loop(Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport, const bool use_gpencil, const bool use_basic, const bool use_overlay, const bool use_only_selected)
void DRW_system_gpu_render_context_enable(void *re_system_gpu_context)
void DRW_gpu_context_enable()
void DRW_render_instance_buffer_finish()
void DRW_gpu_context_create()
void DRW_draw_depth_object(Scene *scene, ARegion *region, View3D *v3d, GPUViewport *viewport, Object *object)
static void drw_task_graph_deinit()
void DRW_custom_pipeline(DrawEngineType *draw_engine_type, Depsgraph *depsgraph, void(*callback)(void *vedata, void *user_data), void *user_data)
int DRW_object_visibility_in_active_context(const Object *ob)
static uint dupli_key_hash(const void *key)
void DRW_gpu_context_activate(bool drw_state)
bool DRW_state_is_image_render()
bool DRW_state_is_painting()
void DRW_render_context_disable(Render *render)
static void drw_engines_cache_init()
void DRW_blender_gpu_render_context_disable(void *)
bool DRW_state_is_scene_render()
static void drw_engines_data_validate()
static void drw_engines_cache_populate(Object *ob)
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)
void DRW_draw_select_loop(Depsgraph *depsgraph, ARegion *region, View3D *v3d, bool use_obedit_skip, bool draw_surface, bool, const 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_viewport_data_free(DRWData *drw_data)
void DRW_draw_render_loop_offscreen(Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, const bool is_image_render, const bool draw_background, const bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
DefaultTextureList * DRW_viewport_texture_list_get()
static void drw_engines_enable_from_engine(const RenderEngineType *engine_type, eDrawType drawtype)
void DRW_render_to_image(RenderEngine *engine, Depsgraph *depsgraph)
static void drw_registered_engines_free()
static void drw_engines_enable_overlays()
void ** DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void(*callback)(void *storage))
void DRW_system_gpu_render_context_disable(void *re_system_gpu_context)
static void duplidata_key_free(void *key)
DrawDataList * DRW_drawdatalist_from_id(ID *id)
static bool drw_gpencil_engine_needed(Depsgraph *depsgraph, View3D *v3d)
void DRW_engine_register(DrawEngineType *draw_engine_type)
void ** DRW_duplidata_get(void *vedata)
static void drw_task_graph_init()
void DRW_draw_render_loop_2d_ex(Depsgraph *depsgraph, ARegion *region, GPUViewport *viewport, const bContext *evil_C)
static struct DRWSelectBuffer g_select_buffer
void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d)
void DRW_render_set_time(RenderEngine *engine, Depsgraph *depsgraph, int frame, float subframe)
const DRWContextState * DRW_context_state_get()
bool DRW_state_draw_support()
void DRW_render_gpencil(RenderEngine *engine, Depsgraph *depsgraph)
void DRW_draw_callbacks_post_scene()
static void DRW_render_gpencil_to_image(RenderEngine *engine, RenderLayer *render_layer, const rcti *rect)
bool DRW_gpu_context_release()
void DRW_engines_register()
DupliObject * DRW_object_get_dupli(const Object *)
bool DRW_is_viewport_compositor_enabled()
void DRW_viewport_request_redraw()
void DRW_custom_pipeline_end()
static bool id_can_have_drawdata(const ID *id)
void DRW_render_object_iter(void *vedata, RenderEngine *engine, Depsgraph *depsgraph, void(*callback)(void *vedata, Object *ob, RenderEngine *engine, Depsgraph *depsgraph))
static bool dupli_key_cmp(const void *key1, const void *key2)
void DRW_render_context_enable(Render *render)
bool DRW_state_is_select()
static void drw_duplidata_free()
static void drw_engines_disable()
static void draw_select_framebuffer_depth_only_setup(const int size[2])
static void drw_engines_draw_text()
static void drw_state_ensure_not_reused(DRWManager *dst)
static void drw_viewport_data_reset(DRWData *drw_data)
static void draw_texture_release(DRWData *drw_data)
bool DRW_state_is_navigating()
static void drw_engines_enable_basic()
bool DRW_state_is_playback()
static void drw_engines_draw_scene()
void DRW_custom_pipeline_begin(DrawEngineType *draw_engine_type, Depsgraph *depsgraph)
bool DRW_state_is_depth()
static void drw_engines_enable(ViewLayer *, RenderEngineType *engine_type, bool gpencil_engine_needed)
static void drw_drawdata_unlink_dupli(ID *id)
void DRW_blender_gpu_render_context_enable(void *re_gpu_context)
static void drw_engine_enable_image_editor()
static bool id_type_can_have_drawdata(const short id_type)
void drw_resource_buffer_finish(DRWData *vmempool)
void DRW_manager_end_sync()
#define PROFILE_END_UPDATE(time_update, time_start)
#define PROFILE_START(time_start)
#define DRW_RESOURCE_CHUNK_LEN
BLI_INLINE void DRW_handle_increment(DRWResourceHandle *handle)
void DRW_manager_begin_sync()
void DRW_view_clip_planes_set(DRWView *view, float(*planes)[4], int plane_len)
DRWView * DRW_view_create(const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4], DRWCallVisibilityFn *visibility_fn)
void DRW_state_lock(DRWState state)
void DRW_select_load_id(uint id)
void DRW_stats_group_start(const char *name)
void DRW_stats_group_end()
void DRW_stats_draw(const rcti *rect)
DRWTextStore * DRW_text_cache_create()
void DRW_text_cache_draw(DRWTextStore *dt, ARegion *region, View3D *v3d)
void DRW_text_cache_destroy(DRWTextStore *dt)
#define DRW_STATE_DEPTH_TEST_ENABLED
void DRW_texture_pool_free(DRWTexturePool *pool)
DRWTexturePool * DRW_texture_pool_create()
void DRW_texture_pool_reset(DRWTexturePool *pool)
void DRW_draw_region_info()
void DRW_draw_cursor_2d()
void DRW_view_data_use_engine(DRWViewData *view_data, DrawEngineType *engine_type)
void DRW_view_data_free(DRWViewData *view_data)
void DRW_view_data_default_lists_from_viewport(DRWViewData *view_data, GPUViewport *viewport)
DefaultFramebufferList * DRW_view_data_default_framebuffer_list_get(DRWViewData *view_data)
DefaultTextureList * DRW_view_data_default_texture_list_get(DRWViewData *view_data)
void DRW_view_data_engines_view_update(DRWViewData *view_data)
draw::TextureFromPool & DRW_view_data_pass_texture_get(DRWViewData *view_data, const char *pass_name)
double * DRW_view_data_cache_time_get(DRWViewData *view_data)
DRWViewData * DRW_view_data_create(ListBase *engine_types)
void DRW_view_data_texture_list_size_validate(DRWViewData *view_data, const int size[2])
void DRW_view_data_reset(DRWViewData *view_data)
ViewportEngineData * DRW_view_data_engine_data_get_ensure(DRWViewData *view_data, DrawEngineType *engine_type)
void DRW_view_data_free_unused(DRWViewData *view_data)
#define DRW_ENABLED_ENGINE_ITER(view_data_, engine_, data_)
RenderEngineType DRW_engine_viewport_eevee_next_type
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
RenderEngineType DRW_engine_viewport_external_type
bool DRW_engine_external_acquire_for_image_editor()
DrawEngineType draw_engine_external_type
DrawEngineType draw_engine_gpencil_type
struct @157336070235062372277311340362362342103123126032::@262166344314164341202215145112231240022370055142 batch
DrawEngineType draw_engine_image_type
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe)
RenderResult * RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h, const char *layername, const char *viewname)
RenderResult * RE_engine_get_result(RenderEngine *engine)
void RE_engines_register(RenderEngineType *render_type)
void RE_engine_end_result(RenderEngine *engine, RenderResult *result, bool cancel, bool highlight, bool merge_results)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void DRW_curves_init(DRWData *drw_data)
void DRW_gpencil_batch_cache_dirty_tag(bGPdata *gpd)
void DRW_particle_batch_cache_free(ParticleSystem *psys)
void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
void DRW_lattice_batch_cache_free(Lattice *lt)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface(Mesh &mesh)
void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
void DRW_subdiv_cache_free(bke::subdiv::Subdiv *subdiv)
void DRW_volume_batch_cache_free(Volume *volume)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grase_pencil)
void DRW_mesh_batch_cache_free(void *batch_cache)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_triangles(Mesh &mesh)
void DRW_gpencil_batch_cache_free(bGPdata *gpd)
void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode)
void DRW_curve_batch_cache_free(Curve *cu)
void DRW_pointcloud_init()
void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode)
void DRW_cache_free_old_subdiv()
void DRW_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grase_pencil, int mode)
void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph, Object &ob, Mesh &mesh, const Scene &scene, bool is_paint_mode, bool use_hide)
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
void DRW_pointcloud_batch_cache_free(PointCloud *pointcloud)
void DRW_batch_cache_free_old(Object *ob, int ctime)
void DRW_curves_batch_cache_free(Curves *curves)
void DRW_pointcloud_free()
void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
DrawEngineType draw_engine_overlay_type
DrawEngineType draw_engine_overlay_next_type
DrawEngineType draw_engine_debug_select_type
DrawEngineType draw_engine_select_type
SELECTID_Context * DRW_select_engine_context_get()
DrawEngineType draw_engine_select_next_type
void * RE_blender_gpu_context_ensure(Render *re)
void * RE_system_gpu_context_get(Render *re)
RenderLayer * RE_GetRenderLayer(RenderResult *rr, const char *name)
void RE_SetActiveRenderView(Render *re, const char *viewname)
const ViewerPath * viewer_path
GPUUniformBuf ** obinfos_ubo
BLI_memblock * cullstates
GHash * vlattrs_name_cache
DRWInstanceDataList * idatalist
ListBase vlattrs_name_list
GPUUniformBuf * vlattrs_ubo
BLI_memblock * callbuffers
DRWTexturePool * texture_pool
BLI_memblock * commands_small
LayerAttribute * vlattrs_buf
blender::draw::CurvesUniformBufPool * curves_ubos
GPUUniformBuf ** matrices_ubo
DRWViewData * view_data[2]
DRWResourceHandle pass_handle
DRWResourceHandle resource_handle
DRWInstanceData * object_instance_data[MAX_INSTANCE_DATA_SIZE]
GPUFrameBuffer * default_framebuffer
DRWViewData * view_data_active
DrawEngineType * draw_engine
GPUTexture * texture_depth
GPUFrameBuffer * framebuffer_depth_only
RenderEngineType * engine_type
GPUFrameBuffer * overlay_fb
GPUFrameBuffer * default_fb
struct DrawEngineType * engine_type
void(* render_to_image)(void *vedata, RenderEngine *engine, RenderLayer *layer, const rcti *rect)
void(* store_metadata)(void *vedata, RenderResult *render_result)
ObjectRuntimeHandle * runtime
struct PointCache * pointcache
struct DrawEngineType * draw_engine
blender::Array< Object * > objects
struct ToolSettings * toolsettings
int object_type_exclude_select
int object_type_exclude_viewport
struct DrawEngineType * engine_type
void(* free)(void *storage)
DRWRegisteredDrawEngine * engine_type
const c_style_mat & ptr() const
static void draw_background(const rcti *rect)
GPUViewport * WM_draw_region_get_viewport(ARegion *region)
GPUViewport * WM_draw_region_get_bound_viewport(ARegion *region)
void wmOrtho2(float x1, float x2, float y1, float y2)
void * WM_system_gpu_context_create()
void wm_window_reset_drawable()
void WM_system_gpu_context_dispose(void *context)
void WM_system_gpu_context_activate(void *context)
void WM_system_gpu_context_release(void *context)
ARegionType * WM_xr_surface_controller_region_type_get()
RenderEngineType DRW_engine_viewport_workbench_type