Skip to content
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

WebGLRenderer: Remove superfluous program check in setProgram(). #20097

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Aug 17, 2020

I think it's safe to remove this check since materialProperties.program can never be undefined if materialProperties.__version is equal to material.version. If both values are equal, initMaterial() was called at least once which ensures that materialProperties.program is set.

Removing any access to program before initMaterial() is called is useful for further refactoring.

@Mugen87 Mugen87 marked this pull request as draft August 17, 2020 11:00
@Mugen87 Mugen87 marked this pull request as ready for review August 17, 2020 11:02
@mrdoob mrdoob added this to the r120 milestone Aug 17, 2020
@mrdoob mrdoob merged commit cf613a2 into mrdoob:dev Aug 17, 2020
@mrdoob
Copy link
Owner

mrdoob commented Aug 17, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants