73 dummy_buf.push_update();
82 auto &sub = ps_.sub(
"Mesh");
83 sub.shader_set(depth_mesh.get());
87 auto &sub = ps_.sub(
"Curves");
88 sub.shader_set(depth_curves.get());
92 auto &sub = ps_.sub(
"PointCloud");
93 sub.shader_set(depth_pointcloud.get());
94 pointcloud_ps_ = ⊂
119 mesh_ps_->draw(geom, handle);
130 mesh_ps_->draw(
batch.batch, handle);
147 if (use_sculpt_pbvh) {
152 gpu::Batch *geom_single =
nullptr;
163 pass = pointcloud_ps_;
166 const char *
error =
nullptr;
177 if (pass ==
nullptr) {
184 pass->
draw(geom_list[material_id], res_handle);
200 bool do_prepass =
false;
216 prepass.begin_sync();
223 prepass.object_sync(manager, ob_ref, *draw_ctx);
232 ARegion *region = draw_ctx->region;
244 draw_ctx->v3d->shading.type);
271 prepass.submit(manager,
view);
275 if (render_engine->
text[0] !=
'\0') {
288 void external_image_space_matrix_set(
const RenderEngine *engine)
308 const float width_inv = width ? 1.0f / width : 0.0f;
309 const float height_inv = height ? 1.0f / height : 0.0f;
324 void draw_scene_do_image()
329 if (scene ==
nullptr) {
330 scene = draw_ctx->scene;
358 external_image_space_matrix_set(engine);
366 engine_type->
draw(engine, draw_ctx->evil_C, draw_ctx->
depsgraph);
380 if (draw_ctx->v3d !=
nullptr) {
381 draw_scene_do_v3d(manager,
view);
385 if (draw_ctx->space_data ==
nullptr) {
391 draw_scene_do_image();
406 if (draw_ctx->evil_C) {
407 const float clear_col[4] = {0, 0, 0, 0};
414 draw_scene_do(manager,
view);
462 if (scene ==
nullptr) {
463 scene = draw_ctx->
scene;
467 if (space_data ==
nullptr) {
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
#define LISTBASE_FOREACH(type, var, list)
char * STRNCPY(char(&dst)[N], const char *src)
void DRW_submission_end()
bool DRW_gpu_context_is_enabled()
bool DRW_gpencil_engine_needed_viewport(Depsgraph *depsgraph, View3D *v3d)
void DRW_gpu_context_disable_ex(bool restore)
void DRW_gpu_context_enable_ex(bool restore)
void DRW_engine_external_free(RegionView3D *rv3d)
void DRW_submission_start()
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
Image * ED_space_image(const SpaceImage *sima)
Scene * ED_render_job_get_current_scene(const bContext *C)
void ED_region_pixelspace(const ARegion *region)
RenderEngineType * ED_view3d_engine_type(const Scene *scene, int drawtype)
void GPU_debug_group_end()
void GPU_debug_group_begin(const char *name)
void GPU_framebuffer_clear_depth(blender::gpu::FrameBuffer *fb, float clear_depth)
void GPU_framebuffer_clear_color(blender::gpu::FrameBuffer *fb, const float clear_col[4])
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
void GPU_matrix_scale_2f(float x, float y)
#define GPU_matrix_set(x)
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
#define GPU_matrix_projection_set(x)
void GPU_matrix_translate_2f(float x, float y)
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
const float4x4 & viewmat(int view_id=0) const
static View & default_get()
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceIndexRange res_index={}, 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)
const DRWContext * DRW_context_get()
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
bool DRW_engine_external_acquire_for_image_editor(const DRWContext *draw_ctx)
RenderEngineType DRW_engine_viewport_external_type
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
void RE_GetViewPlane(Render *re, rctf *r_viewplane, rcti *r_disprect)
void RE_engine_draw_release(Render *re)
RenderEngine * RE_view_engine_get(const ViewRender *view_render)
RenderEngine * RE_engine_get(const Render *re)
bool RE_engine_draw_acquire(Render *re)
static void error(const char *str)
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)
gpu::Batch * pointcloud_sub_pass_setup(PassMain::Sub &sub_ps, Object *object, GPUMaterial *gpu_material=nullptr)
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
gpu::Batch * DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
gpu::Batch * DRW_cache_mesh_surface_get(Object *ob)
MatBase< float, 4, 4 > float4x4
ViewRender * RE_NewViewRender(RenderEngineType *engine_type)
Render * RE_GetSceneRender(const Scene *scene)
void RE_FreeViewRender(ViewRender *view_render)
blender::gpu::FrameBuffer * default_fb
virtual void begin_sync()=0
virtual blender::StringRefNull name_get()=0
virtual void end_sync()=0
struct ViewRender * view_render
void(* view_draw)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
void(* view_update)(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
const c_style_mat & ptr() const
static void set(DRWState state=DRW_STATE_DEFAULT)
DrawEngine * create_instance() final