Skip to content

Asynchronous Graph Culling and Frame-Independent Task Scheduling #2887

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

douira
Copy link
Collaborator

@douira douira commented Nov 22, 2024

Uses an octree to generate render lists independently of the, now asynchronous, slow graph search.

  • It runs the occlusion culler in a separate thread, which allows a large speedup in render list generation time. Correct culling results are ensured with a combination of different types of BFS, synchronous occlusion culling is used as a last resort if the camera teleports or moves extremely quickly.
  • Tasks are ordered based on a combination score of how long they've been pending, their distance from the camera, their type, and whether they're visible in the camera frustum. How many tasks can be scheduled is now independent of the frame rate and instead are limited based on their estimated duration and size.
  • There's an upload limit to ensure not too many tasks are submitted that will exceed the upload buffer's size. This isn't a hard limit and this PR doesn't implement a new way of handling task buffers, to avoid expanding the scope too far.

Testing has not shown regressions and generally frame rate has improved a little if a system was not limited by render list generation, and a lot if it was. (see testing thread)

Companion PR in Iris: IrisShaders/Iris#2539

@douira douira force-pushed the decoupled-frustum-test branch from 94885b5 to 158cd78 Compare November 25, 2024 19:12
@douira douira added the T-enhancement Type: Enhancement label Nov 26, 2024
@douira douira force-pushed the decoupled-frustum-test branch from 1ad3a3f to f969cbb Compare November 27, 2024 22:35
@jellysquid3 jellysquid3 added this to the Sodium 0.7 milestone Dec 2, 2024
@douira douira force-pushed the decoupled-frustum-test branch from ecdd040 to df32670 Compare December 7, 2024 22:31
@douira douira force-pushed the decoupled-frustum-test branch from 29caa4b to 9c44397 Compare December 31, 2024 04:41
@douira douira force-pushed the decoupled-frustum-test branch 2 times, most recently from 3f21cde to 99bd356 Compare January 19, 2025 16:06
@douira douira force-pushed the decoupled-frustum-test branch 4 times, most recently from 0c8a3d9 to d4269aa Compare February 18, 2025 19:25
@douira douira changed the title Asynchronous Render List Generation and Frame-Independent Task Scheduling Asynchronous Graph Culling and Frame-Independent Task Scheduling Feb 20, 2025
@douira douira force-pushed the decoupled-frustum-test branch 2 times, most recently from 7721195 to 927caf6 Compare February 22, 2025 00:25
@douira douira force-pushed the decoupled-frustum-test branch from 927caf6 to ea659d1 Compare April 6, 2025 12:59
@douira douira force-pushed the decoupled-frustum-test branch from ea659d1 to f94b366 Compare April 23, 2025 22:35
@douira douira force-pushed the decoupled-frustum-test branch from 8b14b2a to a3b65f1 Compare May 29, 2025 17:42
@douira douira force-pushed the decoupled-frustum-test branch from a3b65f1 to db115a2 Compare May 29, 2025 22:33
douira added a commit to douira/sodium that referenced this pull request May 29, 2025
douira added a commit to douira/sodium that referenced this pull request May 30, 2025
douira added a commit to douira/sodium that referenced this pull request May 31, 2025
douira added a commit to douira/sodium that referenced this pull request May 31, 2025
@ghost
Copy link

ghost commented Jun 1, 2025

Will this PR be fixed for extended render distance mods such as C2ME? Rendering engine just explodes and crashes when using it.

@douira
Copy link
Collaborator Author

douira commented Jun 1, 2025

Please come to our discord server and give a more detailed report of the issue you're experiencing in the appropriate testing thread.

@ghost
Copy link

ghost commented Jun 2, 2025

Please come to our discord server and give a more detailed report of the issue you're experiencing in the appropriate testing thread.

Discord is blocked in my country, may i report it here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants