-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
WebGL matrix performance fix #5072
base: main
Are you sure you want to change the base?
Conversation
It would be nice to also have some hard perf numbers for this from a benchmark. I will see if there is a benchmark that can catch this and try to post some numbers tomorrow. |
Nice work and quick fix! |
Added a small question around object creation... |
private _posMatrixCache: {[_: string]: mat4}; | ||
private _fogMatrixCache: {[_: string]: mat4}; | ||
private _alignedPosMatrixCache: {[_: string]: mat4}; | ||
private _posMatrixCacheF32: Map<string, mat4> = new Map(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would advise to create an object/type that has both 32 and 64 matrices to avoid cache misalignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean exactly. As in not allowing the maps to have different sets of key-value pairs by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of two maps holding the same keys, have one map holding an object with two fields.
Codecov is not running on PRs lately for somereason, I'll see if I can make it work again. |
Fixes #5070 by passing float32 matrices to WebGL instead of float64. Note that the performance degradation only seemed to affect Chrome, not Firefox. Updates relevant unit & render tests.