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

Do not call updateDrawList, updateDrawListShadow, and touchMapBlocks in the same frame #13393

Merged
merged 2 commits into from Apr 9, 2023

Conversation

lhofhansl
Copy link
Contributor

All of updateDrawList, updateDrawListShadow, and touchMapBlocks can take a few milliseconds with larg'ish viewing ranges. This avoids calling any combination of them in the same frame.

This also required a change to the shadow renderer. Before the game would add a directional light upon the first use. Now it's in the constructor, and it allow some slight simplification.
The alternative is to check for this in MainShaderConstantSetter::onSetConstants, but this seems cleaner.

To do

This PR is Ready for Review.

How to test

Load any world. Make sure there are no crashes :)
Try with shadows and note how the "not rendering time" in the usage graphs is better spread over the frames.

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lhofhansl lhofhansl merged commit 4a742be into minetest:master Apr 9, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants