Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error handling #54

Open
vorg opened this issue Nov 3, 2018 · 1 comment
Open

Runtime error handling #54

vorg opened this issue Nov 3, 2018 · 1 comment
Assignees
Labels
type/feat A new feature

Comments

@vorg
Copy link
Member

vorg commented Nov 3, 2018

Currently if you provide a mesh with invalid vertex layout e.g. aPosition attribute missing the pex-context will crash via failed assert . e.g.

assert.fail(`Can't set uniform "${name}" with a null value`)
assert.fail(`Command is missing attribute "${name}" at location ${location} with ${attrib}`)

It's annoying because it's breaking e.g. pex-renderer render loop and the whole app stops so the options are as follows

a) crash and ask you to fix code immediately
b) don’t render invalid meshes
c) don’t render invalid meshes and print warning (forever and ever every frame..)

Currently option a) is implemented. After discussion with @nicknikolov I tried to implement option c) but it's not without issues:

  • currently logs are printed via debug module so invisible by default until enabled
  • printing log every frame to dev tools via console.warn le basically freezes Safari especially if there is some data attached (e.g. whole command object)
  • printing the message once requires dirty flags and pollution with magic obj._sth variables attached to e.g. command or the geometry

I'm currently leaning towards keeping option a) as null uniform or missing mesh attribute usually indicates invalid data or algorithm error. If we want to avoid our render loop being broken or app crashing some kind of watchdogs should be in the higher layers. E.g. pex-renderer switches to "show 100% red material" for shaders that failed to compile. In the case of geometry would that be a Cube? what if fullscreen quad fails?

Thoughts?

@dmnsgn
Copy link
Member

dmnsgn commented Mar 12, 2019

I would keep crashing and enhance the error as much as possible.

@dmnsgn dmnsgn added type/feat A new feature and removed enhancement labels Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat A new feature
Projects
None yet
Development

No branches or pull requests

3 participants