BLEN-365: Improve creation algorithm of PreviewEngine #21

Merged
Bogdan Nagirniak merged 11 commits from BLEN-365 into hydra-render 2023-04-10 12:44:48 +02:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit f73befb068 - Show all commits

View File

@ -35,7 +35,7 @@ PreviewEngine *PreviewEngine::get_instance(RenderEngine *bl_engine, const std::s
/* Unregister timer while PreviewEngine is working */
BLI_timer_unregister((uintptr_t)instance.get());
}
instance->update_bl_engine(bl_engine);
instance->update(bl_engine, render_delegate_id);
return instance.get();
}
@ -117,9 +117,10 @@ void PreviewEngine::render(Depsgraph *depsgraph)
update_render_result(layer_name, res[0], res[1], pixels);
}
void PreviewEngine::update_bl_engine(RenderEngine *bl_engine)
void PreviewEngine::update(RenderEngine *bl_engine, const std::string &render_delegate_id)
{
this->bl_engine = bl_engine;
/* TODO: recreate render_delegate when render_delegate_id is changed */
}
void PreviewEngine::update_render_result(const std::string &layer_name,

View File

@ -22,9 +22,9 @@ class PreviewEngine : public FinalEngine {
bContext *context,
pxr::HdRenderSettingsMap &render_settings) override;
void render(Depsgraph *depsgraph) override;
void update_bl_engine(RenderEngine *bl_engine);
protected:
private:
void update(RenderEngine *bl_engine, const std::string &render_delegate_id);
void update_render_result(const std::string &layer_name,
int width,
int height,