Skip to content

Commit

Permalink
save and restore uniform buffer bindings during batch renderer selection
Browse files Browse the repository at this point in the history
Uniform buffer bindings need to be saved and restored across Hydra Execute()
calls as a workaround to the issue described in the documentation for the
UBOBindingsSaver class. There are two such calls in the Pixar batch renderer,
one during drawing, and another in the private _TestIntersection() method which
is used when computing selections and during live surface workflows. The former
was already protected by the workaround, but the latter was not, so this change
applies the workaround there as well.
  • Loading branch information
mattyjams committed Feb 20, 2020
1 parent 35a6a0f commit b0b7205
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/render/pxrUsdMayaGL/batchRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,8 @@ UsdMayaGLBatchRenderer::TestIntersectionCustomPrimFilter(
// Differs from viewport implementations in that it doesn't rely on
// _ComputeSelection being called first.

UBOBindingsSaver bindingsSaver;

return _TestIntersection(primFilter.collection,
primFilter.renderTags,
viewMatrix, projectionMatrix,
Expand Down Expand Up @@ -1196,6 +1198,8 @@ UsdMayaGLBatchRenderer::_ComputeSelection(

_selectResults.clear();

UBOBindingsSaver bindingsSaver;

for (const PxrMayaHdPrimFilter& primFilter : primFilters) {
TF_DEBUG(PXRUSDMAYAGL_BATCHED_SELECTION).Msg(
" --- Intersection Testing with collection: %s\n",
Expand Down

0 comments on commit b0b7205

Please sign in to comment.