-
Notifications
You must be signed in to change notification settings - Fork 262
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
Defer checking shader compile status #216
Comments
Passing in a callback or using I forgot if there was a reason I didn't make it do what you suggest for the non-async path. the code there is kind of a mess at the moment. You'd get even more time back if you compiled all shaders and linked all programs and only after checked for results for all of them. |
Thanks, yeah I saw that. But right now I need it to be synchronous. I'm looking into batch compiling and then checking as you say; it's a little bit tricky but much less complicated than async if you need scenes to be complete. |
I'm using the technique Greg suggested: compile and link everything, then check link status, etc. It provided significant speedup. Highly recommended! |
I could add add Something like
|
Let me also point out that if you did this
It would end up compiling and linking all of them before checking any of them. |
So I put this in,
added As before, all 4 take a callback if you want them to run async and there are async versions that return a promise so you can await on them. |
Heads up: it looks like |
I wrote my own (much simpler) function to compile shader programs, in which I don't check compile status of individual shaders until linking fails. It then goes back and gets the error status and log of each shader. I had a big batch of 55 shader programs to compile and link that went from 980ms down to 870ms, about 11% faster.
Reference: Don't check shader compile status unless linking fails
...unless you know of some reason there would be a shader error with no linking error?
Here's the code you can use as a reference, but it doesn't include any of your fancy options:
The text was updated successfully, but these errors were encountered: