Fix #134320: EEVEE: Crashes when leaving camera view back to orthographic

This happened because the interpolated winmat was degenerate.
Using a fallback matrix in this case to avoid a crash.
This commit is contained in:
Clément Foucault
2025-02-10 15:18:05 +01:00
parent 7891089a2c
commit 52e87d0fa3

View File

@@ -161,6 +161,12 @@ void Camera::sync()
* In this case the produced winmat is degenerate. So just revert to the input matrix. */
data.winmat = inst_.drw_view->winmat();
}
if (isnan(data.winmat.w.x)) {
/* Can happen in weird corner case (see #134320).
* Simply fallback to something that we can render with. */
data.winmat = math::projection::orthographic(0.01f, 0.01f, 0.01f, 0.01f, -1000.0f, +1000.0f);
}
}
else if (inst_.render) {
const Render *re = inst_.render->re;