120thread_local DRWContext *DRWContext::g_context =
nullptr;
144 if (this->v3d !=
nullptr && this->region !=
nullptr) {
226 if (space_data !=
nullptr) {
370 if (cage_mesh ==
nullptr) {
392 for (
int i = 0; i < 2; i++) {
422 for (
int i = 0; i < 2; i++) {
430 MEM_delete(drw_data);
438 if (
data ==
nullptr) {
475 if (this->
rv3d !=
nullptr) {
481 rctf region_space = {0.0f, 1.0f, 0.0f, 1.0f};
487 winmat[0][0] = winmat[1][1] = 2.0f;
488 winmat[3][0] = winmat[3][1] = -1.0f;
514 if (this->
data !=
nullptr && this->
viewport ==
nullptr) {
517 this->
data =
nullptr;
524 pass_name, [&]() {
return std::make_unique<draw::TextureFromPool>(pass_name); });
555 ID *ob_data =
nullptr;
557 DupliKey() =
default;
565 friend bool operator==(
const DupliKey &a,
const DupliKey &
b)
567 return a.ob ==
b.ob && a.ob_data ==
b.ob_data;
573 DupliKey last_key_ = {};
588 if (last_key_ == ob_ref.dupli_object_) {
593 last_key_ = ob_ref.dupli_object_;
595 if (dupli_set_ ==
nullptr) {
596 dupli_set_ = MEM_new<Set<DupliKey>>(
"DupliCacheManager::dupli_set_");
599 if (dupli_set_->add(last_key_)) {
616 if (dupli_set_ ==
nullptr) {
626 Iter
begin = dupli_set_->begin();
627 Iter end = dupli_set_->end();
628 for (Iter iter =
begin; iter != end; ++iter) {
629 const DupliKey &key = *iter;
632 if (key.ob_data != ob->
data) {
636 tmp_object.
runtime = &tmp_runtime;
649 MEM_SAFE_DELETE(dupli_set_);
661 : dupli_object_(dupli_object), dupli_parent_(dupli_parent),
object(ob)
666 : dupli_object_(duplis[0]), dupli_parent_(dupli_parent), duplis_(&duplis),
object(&ob)
827enum class DrawFilter {
853bool is_object_instancer(
const Object &ob)
855 return (ob.transflag &
OB_DUPLI) || (ob.runtime->geometry_set_eval !=
nullptr);
876DrawFilter draw_filter_from_viewport_object_impl(
const DRWContext &draw_ctx,
878 const DupliObject *dupli,
880 void *object_filter_user_data,
881 const bool check_select)
883 const View3D &v3d = *draw_ctx.
v3d;
897 if ((dupli ==
nullptr) && (object_filter_fn !=
nullptr)) {
898 if (object_filter_fn(&ob, object_filter_user_data) ==
false) {
899 return DrawFilter::SkipRecursive;
911 const bool use_element_select = ((draw_ctx.
object_pose !=
nullptr) &&
914 if (use_element_select) {
916 return DrawFilter::Skip;
926 return DrawFilter::SkipRecursive;
932 return DrawFilter::Skip;
935 return DrawFilter::Draw;
939DrawFilter draw_filter_from_viewport_object_for_draw(
const DRWContext &draw_ctx,
941 const DupliObject *dupli)
943 return draw_filter_from_viewport_object_impl(draw_ctx, ob, dupli,
nullptr,
nullptr,
false);
947DrawFilter draw_filter_from_viewport_object_for_select(
const DRWContext &draw_ctx,
949 const DupliObject *dupli,
951 void *object_filter_user_data)
953 return draw_filter_from_viewport_object_impl(
954 draw_ctx, ob, dupli, object_filter_fn, object_filter_user_data,
true);
993 Depsgraph *depsgraph = draw_ctx.
depsgraph;
1013 const bool instances_visible = (visibility &
OB_VISIBLE_INSTANCES) && is_object_instancer(*ob);
1016 const bool is_preview_dupli = data_.dupli_parent && data_.dupli_object_current;
1017 const bool process_duplis = instances_visible && !is_preview_dupli;
1021 if (!ob_visible && !process_duplis) {
1026 const DrawFilter parent_filter = should_draw_object_cb(*ob, data_.dupli_object_current);
1028 if (parent_filter == DrawFilter::Draw && ob_visible) {
1031 ObjectRef ob_ref(ob, data_.dupli_parent, data_.dupli_object_current);
1032 draw_object_cb(ob_ref);
1035 if (!process_duplis) {
1039 if (parent_filter == DrawFilter::SkipRecursive) {
1063 if (should_draw_object_cb(*dupli.
ob, &dupli) != DrawFilter::Draw) {
1071 ob, &dupli, eval_mode,
false, &tmp_object, &tmp_runtime) ||
1072 should_draw_object_cb(tmp_object, &dupli) != DrawFilter::Draw)
1084 draw_object_cb(ob_ref);
1103 for (
const auto &[key, instances] : dupli_map.
items()) {
1106 ob, first_dupli, eval_mode,
false, &tmp_object, &tmp_runtime) ||
1107 should_draw_object_cb(tmp_object, first_dupli) != DrawFilter::Draw)
1125 draw_object_cb(ob_ref);
1145 static int lasttime = 0;
1148 if (
U.vbotimeout == 0 || (ctime - lasttime) <
U.vbocollectrate || ctime == lasttime) {
1154 for (scene = bmain->
scenes.first(); scene; scene =
static_cast<Scene *
>(scene->
id.
next)) {
1157 if (depsgraph ==
nullptr) {
1169 deg_iter_settings.
depsgraph = depsgraph;
1217 iter_callback(dupli_handler, extraction);
1223 this->delayed_extraction.clear();
1240 sync(iter_callback);
1266 bool uses_render_border =
false;
1269 if (!uses_render_border) {
1273 rctf border, unrolled_border;
1286 float roll_angle = rv3d->
camroll;
1288 roll_angle = -roll_angle;
1294 const float2 corner[4] = {
1295 pivot + roll * (
float2(unrolled_border.
xmin, unrolled_border.
ymin) - pivot),
1296 pivot + roll * (
float2(unrolled_border.
xmax, unrolled_border.
ymin) - pivot),
1297 pivot + roll * (
float2(unrolled_border.
xmax, unrolled_border.
ymax) - pivot),
1298 pivot + roll * (
float2(unrolled_border.
xmin, unrolled_border.
ymax) - pivot),
1322 const rcti viewport_rect = {0, int(ctx.
size.x), 0, int(ctx.
size.y)};
1335 const float extend = 2.0f * (ctx.
size.x + ctx.
size.y);
1337 const float far_z = -1.0f;
1341 const float2 v0 = corner[i];
1342 const float2 v1 = corner[(i + 1) % 4];
1346 v0 - tangent * extend,
1347 v1 + tangent * extend,
1348 v1 + tangent * extend + normal * extend,
1349 v0 - tangent * extend + normal * extend,
1351 for (
const int j : {0, 1, 2, 0, 2, 3}) {
1376 bool render_border_masked =
false;
1389 render_border_masked =
true;
1416 if (instance.
info[0] !=
'\0') {
1417 const char *buf_step =
IFACE_(instance.
info);
1419 const char *buf = buf_step;
1421 const int buf_len = buf_step - buf;
1422 *yoffset -= line_height;
1424 }
while (*buf_step ? ((
void)buf_step++,
true) :
false);
1501 if ((drawtype >=
OB_SOLID) || !use_xray) {
1509#ifdef WITH_DRAW_DEBUG
1510 if (
G.debug_value == 31) {
1511 view_data.edit_select_debug.set_used(
true);
1542#ifdef WITH_XR_OPENXR
1543static void drw_callbacks_xr(
DRWContext &draw_ctx,
const int cb_type)
1568 if (draw_ctx.
evil_C ==
nullptr) {
1585#ifdef WITH_XR_OPENXR
1591#ifdef WITH_XR_OPENXR
1605 Depsgraph *depsgraph = draw_ctx.
depsgraph;
1621 if (do_annotations) {
1636#ifdef WITH_XR_OPENXR
1674#ifdef WITH_XR_OPENXR
1675static void drw_callbacks_post_scene_xr_surface(
DRWContext &draw_ctx)
1677 Depsgraph *depsgraph = draw_ctx.
depsgraph;
1723#ifdef WITH_XR_OPENXR
1726 drw_callbacks_post_scene_xr_surface(draw_ctx);
1765 if (do_annotations) {
1780 if (do_annotations) {
1787 if (do_draw_gizmos) {
1820 Depsgraph *depsgraph = draw_ctx.
depsgraph;
1828 const bool do_populate_loop = internal_engine || overlays_on || !draw_type_render ||
1829 gpencil_engine_needed;
1831 auto should_draw_object = [&](
Object &ob,
const DupliObject *dupli) -> DrawFilter {
1832 return draw_filter_from_viewport_object_for_draw(draw_ctx, ob, dupli);
1839 if (do_populate_loop) {
1867 Depsgraph *depsgraph = draw_ctx.
depsgraph;
1878 if (do_populate_loop) {
1880 deg_iter_settings.
depsgraph = depsgraph;
1943 const bool is_image_render,
1944 const bool draw_background,
1945 const bool do_color_management,
1953 if (viewport ==
nullptr) {
1964 BLI_assert(is_xr_surface == !is_image_render);
1968 DRWContext draw_ctx(mode, depsgraph, render_viewport, context, region, v3d);
1970 draw_ctx.
options.draw_background = draw_background;
1976 if (draw_background) {
1996 if (draw_background) {
2002 if (viewport ==
nullptr) {
2008 Depsgraph *depsgraph,
const bool skip_grease_pencil_objects)
2017 if (id_eval->id_type() ==
ID_OB) {
2018 const Object *ob =
reinterpret_cast<const Object *
>(id_eval);
2023 const bool contains_grease_pencil_geometry =
2026 if (is_self_visible && contains_grease_pencil_geometry) {
2060 if (render_layer ==
nullptr) {
2080 for (
RenderView *render_view = render_result->
views.first(); render_view !=
nullptr;
2081 render_view = render_view->next)
2103 Depsgraph *depsgraph,
2146 for (
RenderView *render_view = render_result->
views.first(); render_view !=
nullptr;
2147 render_view = render_view->next)
2150 render_view_cb(engine, render_layer, render_rect);
2170 Depsgraph *depsgraph,
2178 auto should_draw_object_all = [](
Object & ,
const DupliObject * ) -> DrawFilter {
2179 return DrawFilter::Draw;
2181 auto should_draw_object_viewport = [&](
Object &ob,
const DupliObject *dupli) -> DrawFilter {
2182 return draw_filter_from_viewport_object_for_draw(draw_ctx, ob, dupli);
2185 should_draw_object_viewport;
2186 if (draw_ctx.
v3d ==
nullptr) {
2187 should_draw_object = should_draw_object_all;
2198 callback(ob_ref, engine, depsgraph);
2269 "select_depth", size[0], size[1], 1, gpu::TextureFormat::SFLOAT_32_DEPTH, usage,
nullptr);
2283 const bool do_material_sub_selection,
2286 void *select_pass_user_data,
2288 void *object_filter_user_data)
2298 DRWContext draw_ctx(mode, depsgraph, viewport_size,
nullptr, region, v3d);
2303 auto should_draw_object = [&](
Object &ob,
const DupliObject *dupli) -> DrawFilter {
2304 return draw_filter_from_viewport_object_for_select(
2305 draw_ctx, ob, dupli, object_filter_fn, object_filter_user_data);
2348 const bool use_gpencil,
2349 const bool use_only_selected,
2350 const bool use_only_active_object)
2363 auto should_draw_object = [&](
Object &ob,
const DupliObject *dupli) -> DrawFilter {
2364 if (
const DrawFilter
filter = draw_filter_from_viewport_object_for_draw(draw_ctx, ob, dupli);
2365 filter != DrawFilter::Draw)
2370 return DrawFilter::Skip;
2372 return DrawFilter::Draw;
2375 if (use_only_active_object) {
2433 auto should_draw_object = [&](
Object &ob,
const DupliObject *dupli) -> DrawFilter {
2434 if (
const DrawFilter
filter = draw_filter_from_viewport_object_for_draw(
2435 draw_ctx, ob, dupli);
2436 filter != DrawFilter::Draw)
2443 return DrawFilter::Skip;
2447 return DrawFilter::Skip;
2449 return DrawFilter::Draw;
2481 if (this->
evil_C !=
nullptr) {
2505 if (!this->v3d || !this->rv3d) {
2533#ifdef WITH_DRAW_DEBUG
2534 draw::edit_select_debug::Engine::free_static();
Camera data-block and utility functions.
Low-level operations for curves that cannot be defined in the C++ header yet.
Low-level operations for grease pencil that cannot be defined in the C++ header yet.
General operations, lookup, etc. for blender objects.
General operations for point clouds.
Platform independent time functions.
#define DEG_OBJECT_ITER_BEGIN(settings_, instance_)
#define DEG_OBJECT_ITER_END
#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS
#define OB_MODE_ALL_WEIGHT_PAINT
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
#define XRAY_ENABLED(v3d)
#define RETOPOLOGY_ENABLED(v3d)
#define GPU_FRAMEBUFFER_FREE_SAFE(fb)
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_NONE
#define GPU_framebuffer_ensure_config(_fb,...)
#define GPU_TEXTURE_FREE_SAFE(texture)
#define BLI_assert_unreachable()
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLI_assert_msg(a, msg)
constexpr IndexRange()=default
Value & lookup_or_add_default(const Key &key)
ItemIterator items() const &
constexpr const char * c_str() const
void begin_sync(Object *object_active=nullptr)
ObjectRef(Object *ob, Object *dupli_parent=nullptr, DupliObject *dupli_object=nullptr)
static void default_set(const float4x4 &view_mat, const float4x4 &win_mat)
virtual void reset(bool force_free=false)=0
static TexturePool & get()
float2x2 invert(float2x2 mat)
bool is_viewport_compositor_enabled(const View3D &view_3d, const RegionView3D ®ion_view_3d)
bool is_enabled(const Scene &scene, ExecutionMode mode)
bool operator==(const Error &left, const Error &right)
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
void viewport_color_management_set(GPUViewport &viewport, DRWContext &draw_ctx)
void DRW_curves_module_free(draw::CurvesModule *module)
static void foreach_obref_in_scene(DRWContext &draw_ctx, FunctionRef< DrawFilter(Object &, const DupliObject *dupli)> should_draw_object_cb, FunctionRef< void(ObjectRef &)> draw_object_cb)
static bool supports_handle_ranges(DupliObject *dupli, Object *parent, const DRWContext &draw_ctx)
void DRW_particle_batch_cache_free(ParticleSystem *psys)
void DRW_pointcloud_module_free(draw::PointCloudModule *module)
void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
void DRW_gsplat_module_free(draw::GSplatModule *module)
void DRW_mesh_batch_cache_free(draw::MeshBatchCache *batch_cache)
void DRW_lattice_batch_cache_free(Lattice *lt)
ENUM_OPERATORS(DRWBatchFlag)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grease_pencil)
void drw_batch_cache_generate_requested_evaluated_mesh_or_curve(Object *ob, TaskGraph &task_graph)
void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
void DRW_curves_init(DRWData *drw_data=nullptr)
void drw_batch_cache_validate(Object *ob)
void DRW_subdiv_cache_free(bke::subdiv::Subdiv *subdiv)
void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grease_pencil, int mode)
void DRW_volume_batch_cache_free(Volume *volume)
void DRW_curves_update(draw::Manager &manager)
void DRW_gsplat_init(DRWData *drw_data=nullptr)
void DRW_volume_init(DRWData *drw_data=nullptr)
void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode)
void DRW_curve_batch_cache_free(Curve *cu)
void DRW_curves_begin_sync(DRWData *drw_data)
void drw_batch_cache_generate_requested(Object *ob, TaskGraph &task_graph)
void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode)
void DRW_pointcloud_init(DRWData *drw_data=nullptr)
void DRW_cache_free_old_subdiv()
void DRW_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
void DRW_gsplat_batch_cache_free(PointCloud *pointcloud)
void DRW_pointcloud_batch_cache_free(PointCloud *pointcloud)
void DRW_batch_cache_free_old(Object *ob, int ctime)
void DRW_gsplat_begin_sync()
void DRW_volume_module_free(draw::VolumeModule *module)
void DRW_curves_batch_cache_free(Curves *curves)
void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode)
void DRW_gsplat_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
bool DEG_iterator_temp_object_from_dupli(const Object *dupli_parent, const DupliObject *dupli, eEvaluationMode eval_mode, bool do_matrix_setup, Object *r_temp_object, bke::ObjectRuntime *r_temp_runtime)
void DEG_iterator_temp_object_free_properties(const DupliObject *dupli, Object *temp_object)
AngleRadianBase< float > AngleRadian
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
MatT from_rotation(const RotationT &rotation)
void theme_set(int spacetype, int regionid)
struct TaskGraph * BLI_task_graph_create()
void RE_SetActiveRenderView(Render *re, const char *viewname)
void GPU_framebuffer_bind(gpu::FrameBuffer *fb)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void DRW_render_to_image(RenderEngine *engine, Depsgraph *depsgraph, std::function< void(RenderEngine *, RenderLayer *, const rcti)> render_view_cb, std::function< void(RenderResult *)> store_metadata_cb)
void DRW_custom_pipeline_end(DRWContext &draw_ctx)
void DRW_draw_select_loop(Depsgraph *depsgraph, ARegion *region, View3D *v3d, 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)
gpu::Texture * GPU_viewport_color_texture(GPUViewport *viewport, int view)
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
void GPU_scissor_test(bool enable)
unsigned __int64 uint64_t
gpu::FrameBuffer * GPU_framebuffer_active_get()
void ED_region_surface_draw_cb_draw(const bContext *C, ARegionType *art, int type)
void DRW_draw_view(const bContext *C)
void DRW_render_context_enable(Render *render)
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
static void drw_render_border_mask(const DRWContext &ctx)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
bool GPU_type_matches_ex(GPUDeviceType device, GPUOSType os, GPUDriverType driver, GPUBackendType backend)
DRWData * DRW_viewport_data_create()
bool DEG_iterator_object_is_visible(eEvaluationMode eval_mode, const Object *ob)
draw::TextureFromPool & DRW_viewport_pass_texture_get(const char *pass_name)
RenderEngineType DRW_engine_viewport_workbench_type
void GPU_framebuffer_restore()
void DRW_render_context_disable(Render *render)
bool DEG_is_fully_evaluated(const Depsgraph *depsgraph)
void GPU_clear_color(float red, float green, float blue, float alpha)
Depsgraph * BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
bool GPU_framebuffer_check_valid(gpu::FrameBuffer *fb, char err_out[256])
bool BKE_subsurf_modifier_has_gpu_subdiv(const Mesh *mesh)
void GPU_framebuffer_free(gpu::FrameBuffer *fb)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
void(*) BKE_grease_pencil_batch_cache_dirty_tag_cb(GreasePencil *grease_pencil, int mode)
DRWTextStore * DRW_text_cache_ensure()
@ BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
void GPU_matrix_identity_set()
void GPU_viewport_tag_update(GPUViewport *viewport)
bool(*)(Object *ob, void *user_data) DRW_ObjectFilterFn
void GPU_framebuffer_clear_depth_stencil(gpu::FrameBuffer *fb, float clear_depth, uint clear_stencil)
GPUVertFormat * immVertexFormat()
bool DRW_object_is_renderable(const Object *ob)
void ED_annotation_draw_view3d(Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
bool BKE_camera_view_render_border(const struct Scene *scene, const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, int winx, int winy, rctf *r_border, rctf *r_unrolled_border)
void(*) BKE_curves_batch_cache_free_cb(struct Curves *curves)
RenderLayer * RE_GetRenderLayer(RenderResult *rr, const char *name)
GPUBackendType GPU_backend_get_type()
void DRW_draw_gizmo_2d(const bContext *C, ARegion *region)
MatBase< float, 2, 2 > float2x2
void BLI_task_graph_free(struct TaskGraph *task_graph)
void immBegin(GPUPrimType, uint vertex_len)
void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, GPUOffScreen *ofs, bool is_xr_surface)
bool(*)(eDRWSelectStage stage, void *user_data) DRW_SelectPassFn
void GPU_depth_mask(bool depth)
ID * DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id)
bool is_negative_m4(const float mat[4][4])
RenderEngineType * ED_view3d_engine_type(const Scene *scene, int drawtype)
void GPU_matrix_identity_projection_set()
void DRW_draw_region_info(const bContext *C, ARegion *region)
void DRW_view_data_default_lists_from_viewport(DRWViewData *view_data, GPUViewport *viewport)
void(*) BKE_pointcloud_batch_cache_dirty_tag_cb(PointCloud *pointcloud, int mode)
MatBase< float, 4, 4 > float4x4
void(*) BKE_lattice_batch_cache_dirty_tag_cb(Lattice *lt, int mode)
@ V3D_SHADING_SCENE_WORLD
@ V3D_SHADING_SCENE_WORLD_RENDER
void(*) BKE_curve_batch_cache_free_cb(Curve *cu)
int DRW_object_visibility_in_active_context(const Object *ob)
void DRW_render_object_iter(RenderEngine *engine, Depsgraph *depsgraph, std::function< void(draw::ObjectRef &, RenderEngine *, Depsgraph *)> callback)
@ V3D_XR_SHOW_CONTROLLERS
@ V3D_XR_SHOW_CUSTOM_OVERLAYS
void DRW_cache_free_old_batches(Main *bmain)
RenderResult * RE_engine_get_result(RenderEngine *engine)
void DRW_viewport_data_free(DRWData *drw_data)
RenderEngineType DRW_engine_viewport_eevee_type
void DRW_render_set_time(RenderEngine *engine, Depsgraph *depsgraph, int frame, float subframe)
void BLI_task_graph_work_and_wait(struct TaskGraph *task_graph)
void DEG_foreach_ID(const Depsgraph *depsgraph, DEGForeachIDCallback callback)
@ GPU_BLEND_ALPHA_PREMULT
bool BKE_object_is_visible_in_viewport_ex(const View3D *v3d, const Object *ob, ObjectType ob_type)
DRWData ** GPU_viewport_data_get(GPUViewport *viewport)
void wmOrtho2(float x1, float x2, float y1, float y2)
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys)
void(*) BKE_particle_batch_cache_dirty_tag_cb(struct ParticleSystem *psys, int mode)
void DRW_draw_gizmo_3d(const bContext *C, ARegion *region)
void(*) BKE_particle_batch_cache_free_cb(struct ParticleSystem *psys)
bool DEG_id_type_any_exists(const Depsgraph *depsgraph, short id_type)
static bool draw_show_annotation()
void RE_engine_end_result(RenderEngine *engine, RenderResult *result, bool cancel, bool highlight, bool merge_results)
void(*) BKE_lattice_batch_cache_free_cb(Lattice *lt)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void(*) BKE_pointcloud_batch_cache_free_cb(PointCloud *pointcloud)
bool DRW_draw_in_progress()
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void(*) BKE_curves_batch_cache_dirty_tag_cb(struct Curves *curves, int mode)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
void RE_engines_register(RenderEngineType *render_type)
static void drw_callbacks_pre_scene_2D(DRWContext &draw_ctx)
static void draw_select_framebuffer_depth_only_setup(const int size[2])
Main * DEG_get_bmain(const Depsgraph *graph)
BMesh const char void * data
void(*) BKE_volume_batch_cache_free_cb(Volume *volume)
Object * BKE_object_pose_armature_get(Object *ob)
static void drw_callbacks_post_scene_view3d(DRWContext &draw_ctx)
void object_duplilist(Depsgraph *depsgraph, Object *ob, Set< const Object * > *include_objects, DupliList &r_duplilist)
@ GPU_SHADER_3D_UNIFORM_COLOR
int BKE_object_visibility(const Object *ob, int dag_eval_mode)
wmWindowManager * CTX_wm_manager(const bContext *C)
gpu::FrameBuffer * GPU_framebuffer_back_get()
void(*) BKE_volume_batch_cache_dirty_tag_cb(Volume *volume, int mode)
void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d)
void(*) BKE_grease_pencil_batch_cache_free_cb(GreasePencil *grease_pencil)
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)
bool DRW_engine_external_acquire_for_image_editor(const DRWContext *draw_ctx)
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)
static bool gpencil_object_is_excluded(View3D *v3d)
void GPU_color_mask(bool r, bool g, bool b, bool a)
static void drw_draw_render_loop_3d(DRWContext &draw_ctx, RenderEngineType *engine_type)
@ DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET
@ DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY
int GPU_texture_width(const gpu::Texture *texture)
void GPU_framebuffer_viewport_reset(gpu::FrameBuffer *fb)
void DRW_draw_render_loop_offscreen(Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, bContext *context, bool is_image_render, bool draw_background, bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
bool DRW_object_use_hide_faces(const Object *ob)
void immUniformColor4f(float r, float g, float b, float a)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
VectorList< DupliObject > DupliList
void DRW_view_data_reset(DRWViewData *view_data)
static bool gpencil_any_exists(Depsgraph *depsgraph)
void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height)
static DRWData * drw_viewport_data_ensure(GPUViewport *viewport)
ARegionType * WM_xr_surface_controller_region_type_get()
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
static void drw_draw_render_loop_2d(DRWContext &draw_ctx)
ARegionType * BKE_regiontype_from_id(const SpaceType *st, int regionid)
void DRW_custom_pipeline_begin(DRWContext &draw_ctx, Depsgraph *)
SpaceType * BKE_spacetype_from_id(int spaceid)
static void drw_callbacks_post_scene(DRWContext &draw_ctx)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void DRW_submission_end()
bool BLI_rcti_is_empty(const struct rcti *rect)
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
void(*) BKE_subsurf_modifier_free_gpu_cache_cb(bke::subdiv::Subdiv *subdiv)
const DRWContext * DRW_context_get()
void GPU_matrix_projection_set(const float m[4][4])
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, bool use_render_params)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
bool DRW_render_check_grease_pencil(Depsgraph *depsgraph, View3D *v3d=nullptr)
gpu::FrameBuffer * GPU_framebuffer_create(const char *name)
void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe)
void GPU_framebuffer_clear_depth(gpu::FrameBuffer *fb, float clear_depth)
int BKE_object_obdata_to_type(const ID *id) ATTR_NONNULL(1)
static void drw_callbacks_post_scene_2D(DRWContext &draw_ctx, View2D &v2d)
void GPU_debug_group_end()
static void drw_engines_cache_populate(draw::ObjectRef &ref, DupliCacheManager &dupli_cache, ExtractionGraph &extraction)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
bool BKE_object_is_in_editmode(const Object *ob)
static struct blender::DRWSelectBuffer g_select_buffer
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
SpaceLink * CTX_wm_space_data(const bContext *C)
ModifierData * BKE_modifiers_findby_type(const Object *ob, ModifierType type)
void GPU_scissor(int x, int y, int width, int height)
bool DEG_iterator_dupli_is_visible(const DupliObject *dupli, eEvaluationMode eval_mode)
void GPU_viewport_free(GPUViewport *viewport)
void DRW_smoke_exit(DRWData *drw_data)
void ED_region_pixelspace(const ARegion *region)
void GPU_framebuffer_texture_attach(gpu::FrameBuffer *fb, gpu::Texture *texture, int slot, int mip)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
void DRW_render_gpencil(RenderEngine *engine, Depsgraph *depsgraph)
void BKE_object_replace_data_on_shallow_copy(Object *ob, ID *new_data)
bToolRef * WM_toolsystem_ref_from_context(const bContext *C)
gpu::Texture * GPU_viewport_depth_texture(GPUViewport *viewport)
void GPU_matrix_pop_projection()
int GPU_texture_height(const gpu::Texture *texture)
void GPU_texture_free(gpu::Texture *texture)
static bool depsgraph_contains_visible_grease_pencil_geometry(Depsgraph *depsgraph, const bool skip_grease_pencil_objects)
void GPU_viewport(int x, int y, int width, int height)
void(*) BKE_curve_batch_cache_dirty_tag_cb(Curve *cu, int mode)
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
Scene * DEG_get_input_scene(const Depsgraph *graph)
void GPU_matrix_ortho_set(float left, float right, float bottom, float top, float near, float far)
void DRW_submission_start()
draw::Manager * DRW_manager_get()
const Mesh * DRW_object_get_editmesh_cage_for_drawing(const Object &object)
double BLI_time_now_seconds()
DRWTextStore * DRW_text_cache_create()
void(*) BKE_gsplat_batch_cache_free_cb(PointCloud *pointcloud)
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
void immVertex3f(uint attr_id, float x, float y, float z)
void GPU_blend(GPUBlend blend)
void DRW_view_data_free_unused(DRWViewData *view_data)
SELECTID_Context * DRW_select_engine_context_get()
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
void(*) BKE_mesh_batch_cache_free_cb(draw::MeshBatchCache *batch_cache)
bool DRW_object_is_in_edit_mode(const Object *ob)
bool DRW_viewport_pass_texture_exists(const char *pass_name)
void GPU_matrix_push_projection()
GPUViewport * WM_draw_region_get_viewport(ARegion *region)
void DRW_engines_register()
void GPU_depth_test(GPUDepthTest test)
GPUViewport * WM_draw_region_get_bound_viewport(ARegion *region)
Mesh * BKE_mesh_wrapper_ensure_subdivision(Mesh *mesh)
int GPU_viewport_active_view_get(GPUViewport *viewport)
constexpr uint64_t get_default_hash(const T &v, const Args &...args)
ARegion * CTX_wm_region(const bContext *C)
void GPU_matrix_set(const float m[4][4])
void(*) BKE_gsplat_batch_cache_dirty_tag_cb(PointCloud *pointcloud, int mode)
void DRW_viewport_request_redraw()
View3D * CTX_wm_view3d(const bContext *C)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
GPUContext * GPU_context_active_get()
void DRW_smoke_begin_sync(DRWData *drw_data)
static void drw_callbacks_pre_scene(DRWContext &draw_ctx)
void GPU_debug_group_begin(const char *name)
GPUViewport * GPU_viewport_create()
void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport, GPUOffScreen *ofs, bool display_colorspace, bool do_overlay_merge)
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(*) BKE_mesh_batch_cache_dirty_tag_cb(Mesh *mesh, eMeshBatchDirtyMode mode)
RenderResult * RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h, const char *layername, const char *viewname)
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const ViewerPath * viewer_path
Set< const Object * > * included_objects
bool is_transforming() const
void sync(iter_callback_t iter_callback)
DefaultTextureList * viewport_texture_list_get() const
gpu::FrameBuffer * default_framebuffer()
Set< Object * > delayed_extraction
struct blender::DRWContext::@231153257105305272346150064304121064225151163351 options
bool is_navigating() const
void engines_data_validate()
DRWContext(Mode mode, Depsgraph *depsgraph, GPUViewport *viewport, const bContext *C=nullptr, ARegion *region=nullptr, View3D *v3d=nullptr)
void engines_init_and_sync(iter_callback_t iter_callback)
DRWTextStore ** text_store_p
::std::function< void(struct DupliCacheManager &, struct ExtractionGraph &)> iter_callback_t
bool is_image_render() const
void engines_draw_scene()
float last_submission_time() const
float last_sync_time() const
DefaultFramebufferList * viewport_framebuffer_list_get() const
bool is_viewport_compositor_used() const
enum blender::DRWContext::Mode mode
void enable_engines(bool gpencil_engine_needed=false, RenderEngineType *render_engine_type=nullptr)
bool is_scene_render() const
DRWViewData * view_data_active
draw::CurvesModule * curves_module
draw::View * default_view
DRWViewData * view_data[2]
draw::GSplatModule * gsplat_module
void modules_begin_sync()
draw::PointCloudModule * pointcloud_module
draw::VolumeModule * volume_module
gpu::FrameBuffer * framebuffer_depth_only
gpu::Texture * texture_depth
DefaultFramebufferList dfbl
workbench::Engine workbench
void texture_list_size_validate(const int2 &size)
draw::compositor_engine::Engine compositor
Map< std::string, std::unique_ptr< draw::TextureFromPool > > viewport_compositor_passes
draw::external::Engine external
draw::select::Engine object_select
draw::overlay::Engine overlay
void foreach_enabled_engine(CallbackT callback)
image_engine::Engine image
draw::gpencil::Engine grease_pencil
draw::edit_select::Engine edit_select
gpu::FrameBuffer * default_fb
gpu::FrameBuffer * overlay_fb
virtual void object_sync(draw::ObjectRef &ob_ref, draw::Manager &manager)=0
virtual StringRefNull name_get()=0
virtual bool uses_render_border() const
virtual void draw(draw::Manager &manager)=0
virtual void end_sync()=0
virtual void begin_sync()=0
void try_add(draw::ObjectRef &ob_ref)
void extract_all(ExtractionGraph &extraction)
int preview_instance_index
const bke::GeometrySet * preview_base_geometry
ListBaseT< Scene > scenes
const c_style_mat & ptr() const
static MatBase identity()
bke::ObjectRuntime * runtime
LightLinking * light_linking
ListBaseT< struct ParticleSystem > particlesystem
eObject_TransFlag transflag
eParticleChildType childtype
eParticleSystem_Flag flag
struct PointCache * pointcache
eRegionView3D_Persp persp
ListBaseT< RenderView > views
ListBaseT< RenderLayer > layers
Vector< Object * > objects
ListBaseT< ViewLayer > view_layers
struct ToolSettings * toolsettings
float last_submission_time
int object_type_exclude_select
eView3D_GizmoFlag gizmo_flag
int object_type_exclude_viewport
uint16_t contained_geometry_types
char is_draw_dupli_reference_tmp_object
bool operator==(const InstancesKey &k) const
int preview_instance_index
InstancesKey(Object *object, ID *ob_data, InstancesFlags flags, const bke::GeometrySet *preview_base_geometry, int preview_instance_index)
const bke::GeometrySet * preview_base_geometry
static void set(DRWState state=DRW_STATE_DEFAULT)
static void free_static()
static void free_static()
static void render_to_image(RenderEngine *engine, RenderLayer *render_layer, const rcti rect)
static void free_static()
static void free_static()
static void free_static()
static void free_static()