Skip to content

Commit

Permalink
fix for many empty paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrit committed Aug 8, 2024
1 parent 6834ea1 commit 1264caa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SeeSharp/Integrators/Common/PathCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public ref PathVertex GetVertex(int globalVertexIdx) {
int offset = globalVertexIdx - (idx == 0 ? 0 : cumPathLen[idx - 1]);
vertexMemoryIdx = pathIndices[idx] + offset;
} else {
vertexMemoryIdx = pathIndices[idx + 1];
// Skip empty paths in-between
do idx++;
while (pathIndices[idx] == -1);
vertexMemoryIdx = pathIndices[idx];
}
return ref memory[vertexMemoryIdx];
}
Expand Down

0 comments on commit 1264caa

Please sign in to comment.