-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
RFC - support KHR_parallel_shader_compile #16662
Closed
Closed
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
573eee7
WIP demo parallel compile
aardgoose 2d30ed5
WIP
aardgoose 16b5607
Merge commit '2d30ed58772302420cd9a8bcb8cb3e16706168f4' of https://gi…
aardgoose cf97d60
update to latest paralle1
aardgoose e4d71a4
update to lhash
aardgoose bc79134
adjust to lhash
aardgoose 85962cd
Merge branch 'lhash' into parallel2
aardgoose 756ab02
make material specific
aardgoose 4359c68
WIP shared programs etc
aardgoose 60bce20
default to no parallel compile
aardgoose adff022
testing
aardgoose eb9c7fe
Merge branch 'dev' into parallel2
aardgoose e7e2d26
Merge branch 'dev' into parallel2
aardgoose eb44c9a
remove testing parts
aardgoose 368e91b
add sync mode to preserve .compile() behaviour
aardgoose 2a88ce0
limit simultaneous compiles
aardgoose 447638f
Merge branch 'dev' into parallel2
aardgoose 1e493fb
Merge branch 'dev' into parallel2
aardgoose 7f462f4
merge dev
aardgoose 6676ae3
Merge branch 'dev' into parallel2
aardgoose 774b5c8
document capability
aardgoose b2f5822
doc update
aardgoose 715f6f3
use getContext()
aardgoose c04a231
remove Material.parallelCompile
aardgoose 810c9c2
move switch back to material
aardgoose 9ac963f
fix race on destruction and tidy
aardgoose d23cab2
Merge branch 'dev' into parallel2
aardgoose 25d3707
Add global default
aardgoose afa66ae
Merge branch 'dev' into parallel2
aardgoose e8ddd76
pass extension in parameters
aardgoose f2385ce
merge
aardgoose 38a7aad
merge dev
aardgoose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this boolean needed?
What are the downsides of using KHR_parallel_shader_compile by default?
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.
A material can be ready a few animation frames away since the material is added to the scene. That means The mesh can't show up in the first few animation frames. So if it's true as default
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.
Does it need to be per material? Or can it be per renderer?
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.
Personally I think moving the flag to renderer would sound simpler.
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.
In addition to what I mentioned above, if it hasn't been updated, there is a chance that the extension may have performance issue on Chrome due to browser side problem now. (Sorry I've been delaying to evaluate and report! I'm happy if anyone evaluates.) Even if it still has performance problem, we may go forward. Chrome may resolve sooner or later.
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.
Yeah, may be easier to start with the renderer first, and if people need more granularity we can consider moving to deeper objects.
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.
What is your preferred API for a renderer swicth?
A new property of the parameters object or a simple boolean parameter of the renderer itself?
I think the later is simpler, since the renderer is passed as a parameter to WebGLProgram()
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.
OK, I have found out an issue with a renderer wide switch.
Some passes like the PMREMGenerator carry out single pass operations which can and do fail with parallel compilation enabled when the compilation does not complete immediately, I imagine there are other cases out there.
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 see...
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 could set a global default on Material.DefaultParallelCompile and use that to init each material.
So a user could opt in globally for simplicity but the default would be safe for all the odd corner cases out there.