[util] Return unchanged matrix if matrix cannot be inverted

This commit is contained in:
Robin Kertels 2024-03-11 19:12:20 +01:00
parent a7cce7c785
commit f984dd4df2
No known key found for this signature in database
GPG Key ID: 3824904F14D40757
1 changed files with 4 additions and 0 deletions

View File

@ -205,6 +205,10 @@ namespace dxvk {
Vector4 dot0 = { m[0] * row0 };
float dot1 = (dot0.x + dot0.y) + (dot0.z + dot0.w);
if (unlikely(std::abs(dot1) <= 0.000001f)) {
return m;
}
return inverse * (1.0f / dot1);
}