diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-25 22:29:59 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-25 22:30:20 +0300 |
commit | 90110d373291b2a9e3bfc2d20f58cb6829dc1515 (patch) | |
tree | 4f79d3944b13a5c2e9b2b20fb5a391bbafe3392a /intern | |
parent | 12f627cd9f0adab33bd5b334b5703e785d278ac4 (diff) |
Fix mistake in previous tangent space optimization
Diffstat (limited to 'intern')
-rw-r--r-- | intern/mikktspace/mikktspace.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 2e8e58d37d4..b9de91e95c2 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -1679,16 +1679,17 @@ static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int } else if(iElems < 16) { int i, j; - for (i = 0; i < iElems - 1; i++) { - for (j = 0; j < iElems - i - 1; j++) { + for (i = 0; i < iElems; i++) { + for (j = 0; j < iElems - 1; j++) { int index = iLeft + j; if (pSortBuffer[index].array[channel] > pSortBuffer[index + 1].array[channel]) { sTmp = pSortBuffer[index]; - pSortBuffer[index] = pSortBuffer[index]; + pSortBuffer[index] = pSortBuffer[index + 1]; pSortBuffer[index + 1] = sTmp; } } } + return; } // Random |