Hydra tasks refactor #73

Merged
Bogdan Nagirniak merged 8 commits from hydra-tasks-refactor into hydra-render 2023-07-25 22:13:33 +02:00
3 changed files with 9 additions and 4 deletions
Showing only changes of commit 32d8375f64 - Show all commits

View File

@ -54,7 +54,9 @@ void FinalEngine::render(Depsgraph *depsgraph)
pxr::HdTaskSharedPtrVector tasks; pxr::HdTaskSharedPtrVector tasks;
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
if (scene->r.alphamode != R_ALPHAPREMUL) {
tasks.push_back(light_tasks_delegate_->skydome_task()); tasks.push_back(light_tasks_delegate_->skydome_task());
}
tasks.push_back(light_tasks_delegate_->simple_task()); tasks.push_back(light_tasks_delegate_->simple_task());
} }
tasks.push_back(render_task_delegate_->task()); tasks.push_back(render_task_delegate_->task());

View File

@ -244,7 +244,7 @@ void GPURenderTaskDelegate::bind()
&framebuffer_, {GPU_ATTACHMENT_TEXTURE(tex_depth_), GPU_ATTACHMENT_TEXTURE(tex_color_)}); &framebuffer_, {GPU_ATTACHMENT_TEXTURE(tex_depth_), GPU_ATTACHMENT_TEXTURE(tex_color_)});
GPU_framebuffer_bind(framebuffer_); GPU_framebuffer_bind(framebuffer_);
float clear_color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; float clear_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
GPU_framebuffer_clear_color_depth(framebuffer_, clear_color, 1.0f); GPU_framebuffer_clear_color_depth(framebuffer_, clear_color, 1.0f);
/* Important: we have to create and bind at least one Vertex Array Object (VAO) before render /* Important: we have to create and bind at least one Vertex Array Object (VAO) before render

View File

@ -208,9 +208,10 @@ void ViewportEngine::render(Depsgraph * /* depsgraph */)
/* Empty function */ /* Empty function */
} }
void ViewportEngine::render(Depsgraph * /* depsgraph */, bContext *context) void ViewportEngine::render(Depsgraph *depsgraph, bContext *context)
{ {
ViewSettings view_settings(context); ViewSettings view_settings(context);
const Scene *scene = DEG_get_evaluated_scene(depsgraph);
if (view_settings.width() * view_settings.height() == 0) { if (view_settings.width() * view_settings.height() == 0) {
return; return;
}; };
@ -236,7 +237,9 @@ void ViewportEngine::render(Depsgraph * /* depsgraph */, bContext *context)
pxr::HdTaskSharedPtrVector tasks; pxr::HdTaskSharedPtrVector tasks;
if (light_tasks_delegate_) { if (light_tasks_delegate_) {
if (scene->r.alphamode != R_ALPHAPREMUL) {
tasks.push_back(light_tasks_delegate_->skydome_task()); tasks.push_back(light_tasks_delegate_->skydome_task());
}
tasks.push_back(light_tasks_delegate_->simple_task()); tasks.push_back(light_tasks_delegate_->simple_task());
} }
tasks.push_back(render_task_delegate_->task()); tasks.push_back(render_task_delegate_->task());