Fix matrix inversion

hotfix/mipmap-alpha-fix
Andrew Cassidy 3 years ago
parent ac62e1c262
commit f7f5a10b66

@ -602,6 +602,7 @@ template <ColorMode M> bool BC1Encoder::RefineEndpointsLS(Color4x4 pixels, Encod
return false;
}
std::swap(matrix[0], matrix[3]);
matrix *= Vector4(1, -1, -1, 1);
matrix *= ((float)denominator / 255.0f) / det;

@ -74,6 +74,7 @@ template <size_t N> class OrderTable {
if (fabs(det) < 1e-8f) {
factors->at(i) = Vector4(0);
} else {
std::swap(factor_matrix[0], factor_matrix[3]);
factor_matrix *= Vector4(1, -1, -1, 1);
factor_matrix *= (denominator / 255.0f) / det;
factors->at(i) = factor_matrix;

Loading…
Cancel
Save