-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Splat updates #5808
Splat updates #5808
Conversation
@@ -163,7 +188,10 @@ class SplatSorter { | |||
data: oldData | |||
}, [oldData]); | |||
|
|||
this.vertexBuffer.setData(newData); | |||
setTimeout(() => { |
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.
Just wondering why the setTimeout
is required...
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.
Without the setTimeout, the postMessage above will only be enqueued after setData has finished executing (setData can be slooow). With the setTimeout, postMessage is sent immediately and the worker can start sorting for the next round while setData completes.
I've confirmed this using Chrome profiler, but it's possible we can do better.
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.
Worthy of a comment in the code?
This is a followup PR to #5785 and adds a few bits required in SuperSplat:
updated
event to sorter so editors can re-draw the scene even when camera is static