-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix eye dome lighting crashes #9719
Conversation
Thanks for the pull request @lilleyse!
Reviewers, don't forget to make sure that:
|
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.
Thanks @lilleyse - I checked that these changes fix the crash and specs pass locally. Mainly just had a question but otherwise this looks good to me.
derivedCommand.framebuffer = this._framebuffer; | ||
derivedCommand.shaderProgram = getECShaderProgram( | ||
frameState.context, | ||
command.shaderProgram | ||
); | ||
derivedCommand.castShadows = false; | ||
derivedCommand.receiveShadows = false; | ||
|
||
if (defined(derivedCommandObject)) { |
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.
To make sure I understand this, does the else
block only get reached on the first frame before pointCloudProcessor
is given a value?
Also it might not help performance, but would it be more precise to wrap both the if
and else
here with an if (originalShaderProgram !== command.shaderProgram)
so that the pointCloudProcessor
object only gets updated when necessary? In Sandcastle doing this didn't seem to have any effect (as I'd expect) but maybe it's wrong if it's possible that the command or shader program need to get updated for a reason other than the mismatch we check for..
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.
To make sure I understand this, does the
else
block only get reached on the first frame beforepointCloudProcessor
is given a value?
Yeah that's what's going on. I reorganized the code a bit so it is hopefully more self-documenting.
It should be ok to set originalShaderProgram
every time even if the command is rederived for some other reason besides shader changes.
Thanks @lilleyse - just in case I made sure everything still works after the last commit but this looks good to me 👍 |
Fixes #9715 (local sandcastle)
Fixes #8818 (local sandcastle)
Fixes #6440 (local sandcastle)
Fixes several issues related issue to eye dome lighting using either destroyed or outdated shaders.
For #9715 the issue was basically:
The fix was to check if the derived command was using a different shader, and if so, rederive the command.
This is really just a symptom of the poor design of the derived command system which needs to be redone at some point.
CC @ebogo1 @mramato