Skip to content

Commit

Permalink
Hdx: Avoid dirtying tasks if render tags are unchanged.
Browse files Browse the repository at this point in the history
To support this, querying render tags on a task where they are
not yet set is not an error.

(Internal change: 1974780)
  • Loading branch information
blevin authored and pixar-oss committed May 30, 2019
1 parent d2a5b98 commit fede993
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pxr/imaging/lib/hdx/taskController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ HdxTaskController::_Delegate::GetRenderBufferDescriptor(SdfPath const& id)
TfTokenVector
HdxTaskController::_Delegate::GetTaskRenderTags(SdfPath const& taskId)
{
return GetParameter<TfTokenVector>(taskId, _tokens->renderTags);
if (HasParameter(taskId, _tokens->renderTags)) {
return GetParameter<TfTokenVector>(taskId, _tokens->renderTags);
}
return TfTokenVector();
}


Expand Down Expand Up @@ -967,11 +970,13 @@ HdxTaskController::SetRenderTags(TfTokenVector const& renderTags)
HdChangeTracker &tracker = GetRenderIndex()->GetChangeTracker();

for (SdfPath const& renderTaskId : _renderTaskIds) {
_delegate.SetParameter(renderTaskId,
_tokens->renderTags,
renderTags);

tracker.MarkTaskDirty(renderTaskId, HdChangeTracker::DirtyRenderTags);
if (_delegate.GetTaskRenderTags(renderTaskId) != renderTags) {
_delegate.SetParameter(renderTaskId,
_tokens->renderTags,
renderTags);
tracker.MarkTaskDirty(renderTaskId,
HdChangeTracker::DirtyRenderTags);
}
}

if (!_pickTaskId.IsEmpty()) {
Expand Down

0 comments on commit fede993

Please sign in to comment.