77 dummy_buf.push_update();
86 auto &sub = ps_.sub(
"Mesh");
87 sub.shader_set(depth_mesh.get());
91 auto &sub = ps_.sub(
"Curves");
92 sub.shader_set(depth_curves.get());
96 auto &sub = ps_.sub(
"PointCloud");
97 sub.shader_set(depth_pointcloud.get());
98 pointcloud_ps_ = ⊂
101 auto &sub = ps_.sub(
"GSplat");
102 sub.shader_set(depth_gsplat.get());
128 mesh_ps_->draw(geom, handle);
139 mesh_ps_->draw(batch.batch, handle);
156 if (use_sculpt_pbvh) {
161 gpu::Batch *geom_single =
nullptr;
177 const char *error =
nullptr;
188 if (pass ==
nullptr) {
193 pass->
draw(geom_list[material_id], res_handle);
199 manager.
submit(ps_, view);
209 bool do_prepass =
false;
216 bool uses_render_border()
const final
224 const bool engine_provides_depth =
225 draw_ctx->v3d !=
nullptr &&
228 do_prepass = !engine_provides_depth &&
232 void begin_sync()
final
235 prepass.begin_sync();
242 prepass.object_sync(manager, ob_ref, *draw_ctx);
246 void end_sync()
final {}
251 ARegion *region = draw_ctx->region;
253 draw_ctx->v3d->shading.type);
301 prepass.submit(manager, view);
305 if (render_engine->
text[0] !=
'\0') {
318 void external_image_space_matrix_set(
const RenderEngine *engine)
338 const float width_inv = width ? 1.0f / width : 0.0f;
339 const float height_inv = height ? 1.0f / height : 0.0f;
354 void draw_scene_do_image()
359 if (scene ==
nullptr) {
360 scene = draw_ctx->scene;
388 external_image_space_matrix_set(engine);
396 engine_type->
draw(engine, draw_ctx->evil_C, draw_ctx->
depsgraph);
410 if (draw_ctx->v3d !=
nullptr) {
411 draw_scene_do_v3d(manager, view);
415 if (draw_ctx->space_data ==
nullptr) {
421 draw_scene_do_image();
436 if (draw_ctx->evil_C) {
443 draw_scene_do(manager, view);
492 if (scene ==
nullptr) {
493 scene = draw_ctx->
scene;
497 if (space_data ==
nullptr) {
512 if (
image->render_slot !=
image->last_render_slot) {
constexpr IndexRange index_range() const
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
ResourceHandleRange unique_handle(const ObjectRef &ref)
void submit(PassSimple &pass, View &view)
float4x4 particles_matrix() const
const float4x4 & winmat(int view_id=0) const
static View & default_get()
const float4x4 & viewmat(int view_id=0) const
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceIDRange res_id={}, uint custom_id=0)
detail::PassBase< command::DrawMultiBuf > Sub
void sculpt_sync(Manager &manager, const ObjectRef &ob_ref)
void particle_sync(Manager &manager, const ObjectRef &ob_ref)
void object_sync(Manager &manager, const ObjectRef &ob_ref, const DRWContext &draw_ctx)
void submit(Manager &manager, View &view)
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
detail::Pass< command::DrawMultiBuf > PassMain
gpu::Batch * curves_sub_pass_setup(PassMain::Sub &ps, const Scene *scene, Object *ob, const char *&r_error, GPUMaterial *gpu_material=nullptr)
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
bool pointcloud_is_gsplat(Object *ob)
gpu::Batch * pointcloud_sub_pass_setup(PassMain::Sub &sub_ps, const ObjectRef &ob_ref, const ResourceHandleRange &res_handle, GPUMaterial *gpu_material=nullptr)
gpu::Batch * DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
gpu::Batch * DRW_cache_mesh_surface_get(Object *ob)
void GPU_framebuffer_bind(gpu::FrameBuffer *fb)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
char * STRNCPY(char(&dst)[N], const char *src)
RenderEngine * RE_engine_get(const Render *re)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
@ RE_WRITE_VIEWPORT_DEPTH
void GPU_framebuffer_clear_color(gpu::FrameBuffer *fb, const double4 clear_col)
RenderEngineType DRW_engine_viewport_external_type
void DRW_gpu_context_disable_ex(bool restore)
RenderEngineType * ED_view3d_engine_type(const Scene *scene, int drawtype)
MatBase< float, 4, 4 > float4x4
void DRW_gpu_context_enable_ex(bool restore)
bool DRW_gpu_context_is_enabled()
void ED_area_tag_redraw_regiontype(ScrArea *area, int regiontype)
void GPU_matrix_scale_2f(float x, float y)
void DRW_engine_external_free(RegionView3D *rv3d)
Render * RE_GetSceneRender(const Scene *scene)
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)
@ DRW_STATE_DEPTH_LESS_EQUAL
void DRW_submission_end()
const DRWContext * DRW_context_get()
void GPU_matrix_projection_set(const float m[4][4])
void GPU_matrix_translate_2f(float x, float y)
bool DRW_render_check_grease_pencil(Depsgraph *depsgraph, View3D *v3d=nullptr)
void RE_engine_draw_release(Render *re)
void GPU_framebuffer_clear_depth(gpu::FrameBuffer *fb, float clear_depth)
void GPU_debug_group_end()
bool RE_engine_draw_acquire(Render *re)
void ED_region_pixelspace(const ARegion *region)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
void GPU_matrix_pop_projection()
ViewRender * RE_NewViewRender(RenderEngineType *engine_type)
void DRW_submission_start()
RenderEngine * RE_view_engine_get(const ViewRender *view_render)
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
void GPU_matrix_push_projection()
void GPU_matrix_set(const float m[4][4])
Image * ED_space_image(const SpaceImage *sima)
void RE_FreeViewRender(ViewRender *view_render)
void GPU_debug_group_begin(const char *name)
Scene * ED_render_job_get_current_scene(const bContext *C)
gpu::FrameBuffer * default_fb
const c_style_mat & ptr() const
ListBaseT< struct ParticleSystem > particlesystem
eObject_VisibilityFlag visibility_flag
struct ViewRender * view_render
void(*) view_update(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
void(*) view_draw(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
void(*) draw(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
struct Depsgraph * depsgraph
static void set(DRWState state=DRW_STATE_DEFAULT)
DrawEngine * create_instance() final