72 dummy_buf.push_update();
81 auto &sub = ps_.sub(
"Mesh");
82 sub.shader_set(depth_mesh.get());
86 auto &sub = ps_.sub(
"Curves");
87 sub.shader_set(depth_curves.get());
91 auto &sub = ps_.sub(
"PointCloud");
92 sub.shader_set(depth_pointcloud.get());
93 pointcloud_ps_ = ⊂
113 if (handle.
raw == 0u) {
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_;
173 if (pass ==
nullptr) {
180 pass->
draw(geom_list[material_id], res_handle);
196 bool do_prepass =
false;
212 prepass.begin_sync();
219 prepass.object_sync(manager, ob_ref, *draw_ctx);
228 ARegion *region = draw_ctx->region;
240 draw_ctx->v3d->shading.type);
269 prepass.submit(manager,
view);
273 if (render_engine->
text[0] !=
'\0') {
286 void external_image_space_matrix_set(
const RenderEngine *engine)
306 const float width_inv = width ? 1.0f / width : 0.0f;
307 const float height_inv = height ? 1.0f / height : 0.0f;
322 void draw_scene_do_image()
324 Scene *scene = draw_ctx->scene;
350 external_image_space_matrix_set(engine);
358 engine_type->
draw(engine, draw_ctx->evil_C, draw_ctx->
depsgraph);
373 if (draw_ctx->v3d !=
nullptr) {
374 draw_scene_do_v3d(manager,
view);
378 if (draw_ctx->space_data ==
nullptr) {
384 draw_scene_do_image();
399 if (draw_ctx->evil_C) {
400 const float clear_col[4] = {0, 0, 0, 0};
407 draw_scene_do(manager,
view);
455 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_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)
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_bind(GPUFrameBuffer *fb)
void GPU_framebuffer_clear_color(GPUFrameBuffer *fb, const float clear_col[4])
void GPU_framebuffer_clear_depth(GPUFrameBuffer *fb, float clear_depth)
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(const ObjectRef &ref)
ResourceHandleRange resource_handle_for_sculpt(const ObjectRef &ref)
void submit(PassSimple &pass, View &view)
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, ResourceHandleRange handle={0}, 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 @064345207361167251075330302113175271221317160336::@113254110077376341056327177062323111323010325277 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)
gpu::Batch * curves_sub_pass_setup(PassMain::Sub &ps, const Scene *scene, Object *ob, GPUMaterial *gpu_material=nullptr)
detail::Pass< command::DrawMultiBuf > PassMain
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)
float4x4 DRW_particles_dupli_matrix_get(const ObjectRef &ob_ref)
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)
GPUFrameBuffer * 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