Skip to content

Commit

Permalink
HnRenderPass: update draw list of mesh geometry version changes
Browse files Browse the repository at this point in the history
It is needed to properly handle meshes that are being loaded
  • Loading branch information
TheMostDiligent committed Nov 1, 2024
1 parent d6a500b commit 222a6e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Hydrogent/src/HnRenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,17 @@ void HnRenderPass::UpdateDrawList(const pxr::TfTokenVector& RenderTags)
DrawListDirty = true;
}

const Uint32 MeshGeometryVersion = pRenderParam->GetAttribVersion(HnRenderParam::GlobalAttrib::MeshGeometry);
if (m_GlobalAttribVersions.MeshGeometry != MeshGeometryVersion)
{
// Only update draw list, but not the draw items list.
// Note: it is important to update the draw list when mesh geometry changes
// to handle meshes that are being loaded over multiple frames.
DrawListDirty = true;
// NB: Do NOT update m_GlobalAttribVersions.MeshGeometry here.
// It will be updated later in HnRenderPass::Execute.
}

const pxr::HdRprimCollection& Collection = GetRprimCollection();
const pxr::HdChangeTracker& Tracker = pRenderIndex->GetChangeTracker();
const pxr::TfToken& MaterialTag = Collection.GetMaterialTag();
Expand Down

0 comments on commit 222a6e7

Please sign in to comment.