Skip to content

Commit

Permalink
Merge pull request #3663 from Autodesk/bailp/EMSUSD-1056/vertex-optim…
Browse files Browse the repository at this point in the history
…ization-robustness

EMS1056 vertex processing robustness
  • Loading branch information
seando-adsk authored Mar 19, 2024
2 parents 3222f51 + 41463da commit 1de33b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,11 @@ void HdVP2Mesh::Sync(
for (size_t i = 0; i < numFaceVertexIndices; i++) {
const int sceneFaceVtxId = faceVertexIndices[i];

// Scene index is actually greater than anticipated, increase the buffer size.
if (size_t(sceneFaceVtxId) >= _meshSharedData->_sceneToRenderingFaceVtxIds.size()) {
_meshSharedData->_sceneToRenderingFaceVtxIds.resize(sceneFaceVtxId + 1, -1);
}

int renderFaceVtxId = _meshSharedData->_sceneToRenderingFaceVtxIds[sceneFaceVtxId];
if (renderFaceVtxId < 0) {
renderFaceVtxId = _meshSharedData->_renderingToSceneFaceVtxIds.size();
Expand Down

0 comments on commit 1de33b1

Please sign in to comment.