"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../stats/buffer.mjs.js");exports.createRenderStep=function(t,s){let r=new Set,n=new Set,o=!1,c=!1;const a=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1},l=0;function d(e){a.has(e)&&(f.schedule(e),t()),l++,e(u)}const f={schedule:function(e){const t=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&o?r:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),t.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:t=>{if(u=t,o)return void(c=!0);o=!0;const a=r;r=n,n=a,r.forEach(d),s&&e.statsBuffer.value&&e.statsBuffer.value.frameloop[s].push(l),l=0,r.clear(),o=!1,c&&(c=!1,f.process(t))}};return f};
//# sourceMappingURL=render-step.mjs.js.map
