Blender V5.0
blender::workbench::Instance Class Reference

Inherits DrawEngine.

Public Member Functions

blender::StringRefNull name_get () final
Span< const GPUMaterial * > get_dummy_gpu_materials (int material_count)
void init () final
void init (Depsgraph *depsgraph, Object *camera_ob=nullptr)
void begin_sync () final
void end_sync () final
Material get_material (ObjectRef ob_ref, eV3DShadingColorType color_type, int slot=0)
void object_sync (ObjectRef &ob_ref, Manager &manager) final
template<typename F>
void draw_to_mesh_pass (ObjectRef &ob_ref, bool is_transparent, F draw_callback)
void draw_mesh (ObjectRef &ob_ref, Material &material, gpu::Batch *batch, ResourceHandleRange handle, const MaterialTexture *texture=nullptr, bool show_missing_texture=false)
void mesh_sync (ObjectRef &ob_ref, ResourceHandleRange handle, const ObjectState &object_state)
void sculpt_sync (ObjectRef &ob_ref, ResourceHandleRange handle, const ObjectState &object_state)
void pointcloud_sync (Manager &manager, ObjectRef &ob_ref, const ObjectState &object_state)
void hair_sync (Manager &manager, ObjectRef &ob_ref, ResourceHandleRange emitter_handle, const ObjectState &object_state, ParticleSystem *psys, ModifierData *md)
void curves_sync (Manager &manager, ObjectRef &ob_ref, const ObjectState &object_state)
void draw (Manager &manager, gpu::Texture *depth_tx, gpu::Texture *depth_in_front_tx, gpu::Texture *color_tx)
void draw_viewport (Manager &manager, gpu::Texture *depth_tx, gpu::Texture *depth_in_front_tx, gpu::Texture *color_tx)
void draw (Manager &manager) final
void draw_image_render (Manager &manager, gpu::Texture *depth_tx, gpu::Texture *depth_in_front_tx, gpu::Texture *color_tx, RenderEngine *engine=nullptr)
Public Member Functions inherited from DrawEngine
virtual ~DrawEngine ()=default

Public Attributes

const DRWContextdraw_ctx = nullptr
Public Attributes inherited from DrawEngine
char info [GPU_INFO_SIZE] = {'\0'}
bool used = false

Additional Inherited Members

Static Public Attributes inherited from DrawEngine
static constexpr int GPU_INFO_SIZE = 512

Detailed Description

Definition at line 46 of file workbench_engine.cc.

Member Function Documentation

◆ begin_sync()

void blender::workbench::Instance::begin_sync ( )
inlinefinalvirtual

Scene synchronization. Command buffers building.

Implements DrawEngine.

Definition at line 110 of file workbench_engine.cc.

References final.

Referenced by workbench_render_to_image().

◆ curves_sync()

void blender::workbench::Instance::curves_sync ( Manager & manager,
ObjectRef & ob_ref,
const ObjectState & object_state )
inline

◆ draw() [1/2]

void blender::workbench::Instance::draw ( Manager & manager)
inlinefinalvirtual

◆ draw() [2/2]

void blender::workbench::Instance::draw ( Manager & manager,
gpu::Texture * depth_tx,
gpu::Texture * depth_in_front_tx,
gpu::Texture * color_tx )
inline

Always setup in-front depth, since Overlays can be updated without causing a Workbench re-sync (See #113580).

Definition at line 447 of file workbench_engine.cc.

References blender::draw::View::default_get(), draw_ctx, GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE, GPU_framebuffer_clear_depth_stencil(), GPU_framebuffer_multi_clear(), GPU_TEXTURE_USAGE_ATTACHMENT, and GPU_TEXTURE_USAGE_SHADER_READ.

Referenced by draw_image_render(), and draw_viewport().

◆ draw_image_render()

void blender::workbench::Instance::draw_image_render ( Manager & manager,
gpu::Texture * depth_tx,
gpu::Texture * depth_in_front_tx,
gpu::Texture * color_tx,
RenderEngine * engine = nullptr )
inline

◆ draw_mesh()

void blender::workbench::Instance::draw_mesh ( ObjectRef & ob_ref,
Material & material,
gpu::Batch * batch,
ResourceHandleRange handle,
const MaterialTexture * texture = nullptr,
bool show_missing_texture = false )
inline

Definition at line 261 of file workbench_engine.cc.

References batch, draw_to_mesh_pass(), and texture().

Referenced by mesh_sync(), and sculpt_sync().

◆ draw_to_mesh_pass()

template<typename F>
void blender::workbench::Instance::draw_to_mesh_pass ( ObjectRef & ob_ref,
bool is_transparent,
F draw_callback )
inline

◆ draw_viewport()

void blender::workbench::Instance::draw_viewport ( Manager & manager,
gpu::Texture * depth_tx,
gpu::Texture * depth_in_front_tx,
gpu::Texture * color_tx )
inline

Definition at line 507 of file workbench_engine.cc.

References draw(), DRW_viewport_request_redraw(), DrawEngine::info, and STRNCPY().

Referenced by draw().

◆ end_sync()

void blender::workbench::Instance::end_sync ( )
inlinefinalvirtual

Implements DrawEngine.

Definition at line 127 of file workbench_engine.cc.

References final.

Referenced by workbench_render_to_image().

◆ get_dummy_gpu_materials()

Span< const GPUMaterial * > blender::workbench::Instance::get_dummy_gpu_materials ( int material_count)
inline

Definition at line 81 of file workbench_engine.cc.

◆ get_material()

◆ hair_sync()

◆ init() [1/2]

void blender::workbench::Instance::init ( )
inlinefinalvirtual

Init engine. Run first and for every redraw.

Implements DrawEngine.

Definition at line 89 of file workbench_engine.cc.

References draw_ctx, DRW_context_get(), final, and blender::eevee::Instance::init().

Referenced by workbench_render_to_image().

◆ init() [2/2]

void blender::workbench::Instance::init ( Depsgraph * depsgraph,
Object * camera_ob = nullptr )
inline

◆ mesh_sync()

◆ name_get()

blender::StringRefNull blender::workbench::Instance::name_get ( )
inlinefinalvirtual

Implements DrawEngine.

Definition at line 76 of file workbench_engine.cc.

References final.

◆ object_sync()

◆ pointcloud_sync()

void blender::workbench::Instance::pointcloud_sync ( Manager & manager,
ObjectRef & ob_ref,
const ObjectState & object_state )
inline

◆ sculpt_sync()

Member Data Documentation

◆ draw_ctx

const DRWContext* blender::workbench::Instance::draw_ctx = nullptr

Definition at line 74 of file workbench_engine.cc.

Referenced by draw(), draw(), draw_image_render(), init(), and object_sync().


The documentation for this class was generated from the following file: