From cca48f8e31852b04bb7a92195e981eca02028fb7 Mon Sep 17 00:00:00 2001 From: elasota Date: Fri, 27 Apr 2018 02:03:54 -0400 Subject: [PATCH] Fixed PCA math bugs --- DirectXTex/BC7Parallel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectXTex/BC7Parallel.cpp b/DirectXTex/BC7Parallel.cpp index 73e0d30..5a22c79 100644 --- a/DirectXTex/BC7Parallel.cpp +++ b/DirectXTex/BC7Parallel.cpp @@ -773,7 +773,7 @@ namespace { sum = sum + inVec[col] * m_values[index]; if (col >= row) - index += col; + index += col + 1; else index++; } @@ -832,7 +832,7 @@ namespace for (int ch = 0; ch < TVectorSize; ch++) { MFloat min = m_centroid[ch] + m_direction[ch] * m_minDist; - MFloat max = m_centroid[ch] + m_direction[ch] * (m_maxDist - m_minDist); + MFloat max = m_centroid[ch] + m_direction[ch] * m_maxDist; float safeWeight = channelWeights[ch]; if (safeWeight == 0.f)