Count only the placer's samples against its budget in the tiles scenario

The scenario counted every sampleHeight call in a task as the placer's
pass, so a single sample from elsewhere in the app that landed in the
same task pushed a full pass to 17. Calls that are neither a fixture
point nor the one camera estimate are now counted apart.
This commit is contained in:
German Khokhlov committed 2026-11-11 00:45:36 +04:00
1 parent 9e2c424030
commit 69617af7ef
1 file changed
+13
+13
View File
@@ -565,6 +565,19 @@ async function checkPoints(page, kind) {
pass = null;
});
}
// Only the placer's samples count against its budget: the fixture's
// points and one estimate of the ground under the camera. Other code
// that samples in the same task is counted apart.
const isPoint = points.some(
(p) =>
Math.abs(p.cartographic.longitude - args[0].longitude) < 1e-10 &&
Math.abs(p.cartographic.latitude - args[0].latitude) < 1e-10,
);
if (!isPoint && pass.estimated) {
pass.other = (pass.other ?? 0) + 1;
return sampleHeight.apply(this, args);
}
if (!isPoint) pass.estimated = true;
pass.samples++;
stats.samples++;
const start = performance.now();