pex-renderer icon indicating copy to clipboard operation
pex-renderer copied to clipboard

Maximum call stack size exceeded

Open vorg opened this issue 2 years ago • 3 comments

Happens when pipeline crash. Looks like RAF stacks to infinity on error

Screenshot 2023-10-18 at 12 06 37

Can this be caused by requestAnimationFrame(frame.bind(this)); in pex-renderer?

vorg avatar Oct 18 '23 11:10 vorg

It was added in pex-context@3 alpha to avoid self = this variable.

vorg avatar Oct 18 '23 11:10 vorg

Easiest way ATM to recreate issue it to create lineMaterial

const cubeEntity = createEntity({
  transform: components.transform(),
  geometry: components.geometry(cube()),
  material: components.material({ type: "line" }),
});
world.add(cubeEntity);

That will crash lineRendererSystem at buffer: entity._geometry.attributes.aVertexColor.buffer, as vertex colors are missing

vorg avatar Oct 18 '23 11:10 vorg

We should try/catch renderEngine.update/render in ctx.frame and return false on error to stop the loop. Restarting the raf will need better devx than a reload in Nodes.

dmnsgn avatar Oct 18 '23 12:10 dmnsgn