city lights: report buildMs in __cityDbg (measured: 17.5k places -> 46.7k points in 1.5ms)
This commit is contained in:
1 parent
75dc5ed5b9
commit
cd460ec100
1 file changed
+3
-1
Vendored
+3
-1
@@ -2848,6 +2848,7 @@ function buildCityVBO(gl) {
|
|||||||
verts.push(x, y, z, sz * (0.6 + 0.8 * h3), bri * (0.55 + 0.7 * h3));
|
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);
|
if (cityVbo) gl.deleteBuffer(cityVbo);
|
||||||
cityVbo = null; cityCount = 0;
|
cityVbo = null; cityCount = 0;
|
||||||
if (verts.length < 5) { sanitizeCityAttribSlots(gl); return; }
|
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);
|
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verts), gl.STATIC_DRAW);
|
||||||
cityVbo = vbo; cityCount = verts.length / 5;
|
cityVbo = vbo; cityCount = verts.length / 5;
|
||||||
// debug counter (also used by headless smoke tests)
|
// 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);
|
sanitizeCityAttribSlots(gl);
|
||||||
if (!cityProg) {
|
if (!cityProg) {
|
||||||
cityProg = makeProgram(gl, CITY_VERT_SRC, CITY_FRAG_SRC);
|
cityProg = makeProgram(gl, CITY_VERT_SRC, CITY_FRAG_SRC);
|
||||||
|
|||||||
Reference in new issue
Block a user