forked from blender/blender
Support more AOVs #78
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "render_task_delegate.h"
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
#include "render_task_delegate.h"
|
||||||
|
|
||||||
namespace blender::render::hydra {
|
namespace blender::render::hydra {
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ RenderTaskDelegate::RenderTaskDelegate(pxr::HdRenderIndex *parent_index,
|
|||||||
CLOG_INFO(LOG_RENDER_HYDRA, 1, "%s", render_task_id_.GetText());
|
CLOG_INFO(LOG_RENDER_HYDRA, 1, "%s", render_task_id_.GetText());
|
||||||
}
|
}
|
||||||
|
|
||||||
pxr::VtValue RenderTaskDelegate::Get(pxr::SdfPath const & id, pxr::TfToken const &key)
|
pxr::VtValue RenderTaskDelegate::Get(pxr::SdfPath const &id, pxr::TfToken const &key)
|
||||||
{
|
{
|
||||||
CLOG_INFO(LOG_RENDER_HYDRA, 3, "%s, %s", id.GetText(), key.GetText());
|
CLOG_INFO(LOG_RENDER_HYDRA, 3, "%s, %s", id.GetText(), key.GetText());
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ pxr::VtValue RenderTaskDelegate::Get(pxr::SdfPath const & id, pxr::TfToken const
|
|||||||
return pxr::VtValue();
|
return pxr::VtValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
pxr::TfTokenVector RenderTaskDelegate::GetTaskRenderTags(pxr::SdfPath const & id)
|
pxr::TfTokenVector RenderTaskDelegate::GetTaskRenderTags(pxr::SdfPath const &id)
|
||||||
{
|
{
|
||||||
CLOG_INFO(LOG_RENDER_HYDRA, 3, "%s", id.GetText());
|
CLOG_INFO(LOG_RENDER_HYDRA, 3, "%s", id.GetText());
|
||||||
|
|
||||||
@ -66,7 +66,8 @@ void RenderTaskDelegate::set_camera(pxr::SdfPath const &camera_id)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
render_task_params_.camera = camera_id;
|
render_task_params_.camera = camera_id;
|
||||||
GetRenderIndex().GetChangeTracker().MarkTaskDirty(render_task_id_, pxr::HdChangeTracker::DirtyParams);
|
GetRenderIndex().GetChangeTracker().MarkTaskDirty(render_task_id_,
|
||||||
|
pxr::HdChangeTracker::DirtyParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderTaskDelegate::is_converged(pxr::HdTaskSharedPtr task)
|
bool RenderTaskDelegate::is_converged(pxr::HdTaskSharedPtr task)
|
||||||
@ -81,7 +82,8 @@ void RenderTaskDelegate::set_viewport(pxr::GfVec4d const &viewport)
|
|||||||
}
|
}
|
||||||
auto &render_index = GetRenderIndex();
|
auto &render_index = GetRenderIndex();
|
||||||
render_task_params_.viewport = viewport;
|
render_task_params_.viewport = viewport;
|
||||||
render_index.GetChangeTracker().MarkTaskDirty(render_task_id_, pxr::HdChangeTracker::DirtyParams);
|
render_index.GetChangeTracker().MarkTaskDirty(render_task_id_,
|
||||||
|
pxr::HdChangeTracker::DirtyParams);
|
||||||
|
|
||||||
int w = viewport[2] - viewport[0];
|
int w = viewport[2] - viewport[0];
|
||||||
int h = viewport[3] - viewport[1];
|
int h = viewport[3] - viewport[1];
|
||||||
@ -117,7 +119,8 @@ void RenderTaskDelegate::add_aov(pxr::TfToken const &aov_key)
|
|||||||
binding.renderBufferId = buf_id;
|
binding.renderBufferId = buf_id;
|
||||||
binding.aovSettings = aov_desc.aovSettings;
|
binding.aovSettings = aov_desc.aovSettings;
|
||||||
render_task_params_.aovBindings.push_back(binding);
|
render_task_params_.aovBindings.push_back(binding);
|
||||||
render_index.GetChangeTracker().MarkTaskDirty(render_task_id_, pxr::HdChangeTracker::DirtyParams);
|
render_index.GetChangeTracker().MarkTaskDirty(render_task_id_,
|
||||||
|
pxr::HdChangeTracker::DirtyParams);
|
||||||
|
|
||||||
CLOG_INFO(LOG_RENDER_HYDRA, 1, "%s", aov_key.GetText());
|
CLOG_INFO(LOG_RENDER_HYDRA, 1, "%s", aov_key.GetText());
|
||||||
}
|
}
|
||||||
@ -158,7 +161,7 @@ pxr::SdfPath RenderTaskDelegate::buffer_id(pxr::TfToken const &aov_key) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
GPURenderTaskDelegate::GPURenderTaskDelegate(pxr::HdRenderIndex *parent_index,
|
GPURenderTaskDelegate::GPURenderTaskDelegate(pxr::HdRenderIndex *parent_index,
|
||||||
pxr::SdfPath const &delegate_id)
|
pxr::SdfPath const &delegate_id)
|
||||||
: RenderTaskDelegate(parent_index, delegate_id)
|
: RenderTaskDelegate(parent_index, delegate_id)
|
||||||
{
|
{
|
||||||
aov_task_id_ = GetDelegateID().AppendElementString("aovTask");
|
aov_task_id_ = GetDelegateID().AppendElementString("aovTask");
|
||||||
@ -194,7 +197,8 @@ void GPURenderTaskDelegate::set_viewport(pxr::GfVec4d const &viewport)
|
|||||||
}
|
}
|
||||||
auto &render_index = GetRenderIndex();
|
auto &render_index = GetRenderIndex();
|
||||||
render_task_params_.viewport = viewport;
|
render_task_params_.viewport = viewport;
|
||||||
render_index.GetChangeTracker().MarkTaskDirty(render_task_id_, pxr::HdChangeTracker::DirtyParams);
|
render_index.GetChangeTracker().MarkTaskDirty(render_task_id_,
|
||||||
|
pxr::HdChangeTracker::DirtyParams);
|
||||||
|
|
||||||
if (tex_color_) {
|
if (tex_color_) {
|
||||||
GPU_texture_free(tex_color_);
|
GPU_texture_free(tex_color_);
|
||||||
|
Loading…
Reference in New Issue
Block a user