city lights: report buildMs in __cityDbg (measured: 17.5k places -> 46.7k points in 1.5ms)

This commit is contained in:
Richard Zink committed 2026-10-10 14:30:32 +02:00
1 parent 75dc5ed5b9
commit cd460ec100
1 file changed
+3 -1
+3 -1
View File
@@ -2848,6 +2848,7 @@ function buildCityVBO(gl) {
verts.push(x, y, z, sz * (0.6 + 0.8 * h3), bri * (0.55 + 0.7 * h3));
}
}
var _bT = performance.now();
if (cityVbo) gl.deleteBuffer(cityVbo);
cityVbo = null; cityCount = 0;
if (verts.length < 5) { sanitizeCityAttribSlots(gl); return; }
@@ -2856,7 +2857,8 @@ function buildCityVBO(gl) {
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verts), gl.STATIC_DRAW);
cityVbo = vbo; cityCount = verts.length / 5;
// debug counter (also used by headless smoke tests)
window.__cityDbg = { places: cityGeo ? cityGeo.length : 0, lights: cityCount };
window.__cityDbg = { places: cityGeo ? cityGeo.length : 0, lights: cityCount,
buildMs: +(performance.now() - _bT).toFixed(1) };
sanitizeCityAttribSlots(gl);
if (!cityProg) {
cityProg = makeProgram(gl, CITY_VERT_SRC, CITY_FRAG_SRC);