fix(markers): skip objects with NaN position/scale on update

A non-finite object transform would produce NaN vertex positions
in the marker mesh — Vulkan validation flags it and dropping the
entire batch leaves all markers invisible. Skip the bad object
instead so the rest of the markers still render.
This commit is contained in:
Kelsi 2026-05-06 07:56:26 -07:00
parent 45dabaff44
commit b1cfef8264

View file

@ -43,6 +43,11 @@ void EditorMarkers::update(const std::vector<PlacedObject>& objects) {
std::vector<MarkerVertex> verts;
for (const auto& obj : objects) {
// Skip markers for objects with non-finite transform — would
// produce NaN vertex positions and trip Vulkan validation or
// collapse the entire vertex buffer to garbage.
if (!std::isfinite(obj.position.x) || !std::isfinite(obj.position.y) ||
!std::isfinite(obj.position.z) || !std::isfinite(obj.scale)) continue;
float s = 3.0f * obj.scale;
float x = obj.position.x;
float y = obj.position.y;