Skip to content

Commit

Permalink
Hydrogent: disable parallel syncing of ext computations on Web
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Sep 22, 2024
1 parent 1a46424 commit b9ce361
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Hydrogent/src/HnRenderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,21 @@ void HnRenderDelegate::CommitResources(pxr::HdChangeTracker* tracker)

bool HnRenderDelegate::IsParallelSyncEnabled(pxr::TfToken primType) const
{
return (primType == pxr::HdPrimTypeTokens->mesh ||
primType == pxr::HdPrimTypeTokens->material ||
primType == pxr::HdPrimTypeTokens->camera ||
primType == pxr::HdPrimTypeTokens->extComputation);
bool ParallelSyncEnabled = (primType == pxr::HdPrimTypeTokens->mesh ||
primType == pxr::HdPrimTypeTokens->material ||
primType == pxr::HdPrimTypeTokens->camera ||
primType == pxr::HdPrimTypeTokens->extComputation);

#if PLATFORM_EMSCRIPTEN
if (primType == pxr::HdPrimTypeTokens->extComputation)
{
// On Emscripten, parallel syncing of ext computations is several times slower
// due to memory allocation overhead.
ParallelSyncEnabled = false;
}
#endif

return ParallelSyncEnabled;
}

const pxr::SdfPath* HnRenderDelegate::GetRPrimId(Uint32 UID) const
Expand Down

0 comments on commit b9ce361

Please sign in to comment.