Add LTO visibility attribute for wait_context_vertex#1644
Draft
kboyarinov wants to merge 2 commits intomasterfrom
Draft
Add LTO visibility attribute for wait_context_vertex#1644kboyarinov wants to merge 2 commits intomasterfrom
kboyarinov wants to merge 2 commits intomasterfrom
Conversation
solbjorn
added a commit
to solbjorn/reaper-engine
that referenced
this pull request
Feb 22, 2025
Due to the bug in oneTBB (not really a bug, but with -fwhole-program-vtables task_group::wait() was exiting without waiting for anything), I left TTAPI earlier for async tasks. Now that there's a PR for fixing the issue uxlfoundation/oneTBB#1644 I managed to get xrEngine working without TTAPI, consistently using solely oneTBB for parallel processing. xr_task_group_get() is a simple wrapper which allocates a task_group from the TLS small pool from oneTBB. This pool is fast, uses recycling, and returns cacheline-aligned buffers, just what we need here. I think this feature, which is placed in tbb::detail, is not meant to be used outsife of oneTBB, but hey, it works :> These task groups are used for: 1. HOM processing. Previously it was queued in seqParallel, which is not a good idea since seqParallel is processed in parallel with the main rendering. Now it's just a task fired after the camera pos is updated, same as in OXR. 2. Details processing. Similarly to HOM, this is fired once the camera pos is updated, which should happen earlier than seqFrame from the actor update function. 3. Sun cascades processing. This is now queued from the environment update, i.e. from GamePersistent update, as we want to have the actual weather params. It's a bit later than OnCameraUpdated() in normal cases and right after Render::OnFrame(), so the impact is negligible. 4. Rain processing. Same as above. Bonus: 5. Parallel load of input, sound, and light anims during the initialization thanks to OXR (with minor adjustments). Saves 1+ second between the splash screen and the main menu. Tracing shows that tg.wait() of all the above flows consume only several microseconds, which means the queue/sync calls are balanced. `-max-threads` is still supported, now via oneTBB global control. Remove all non-MT counterparts to simplify code. Even on low-core machines this won't hurt. Remove software details processing since it's explicitly unsupported anyway (the engine won't run). Initialize/clear occRasterizer (78 Kb) using 32-byte AVX2 writes. Signed-off-by: Alexander Lobakin <alobakin@mailbox.org>
|
Pinging just in case. I've been using changes from this PR for 1.5 months already with no issues observed (with My app is only a home project, no urgency anyway. |
akukanov
reviewed
Jul 17, 2025
Comment on lines
+335
to
+340
| #if __clang__ | ||
| #define __TBB_lto_visibility_public [[clang::lto_visibility_public]] | ||
| #else | ||
| #define __TBB_lto_visibility_public | ||
| #endif | ||
|
|
Contributor
There was a problem hiding this comment.
I think we need to give the macro a better, semantical name, something similar to __TBB_EXPORTED_FUNC. The property of a type that we want to indicate and apply as needed is that it's a "callback interface" that is declared in the library headers but used in the binaries. We have other such types, for example delegate_base, and so it's likely only the matter of time for similar issues with whole program optimization options to be seen for these types as well.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@to send notificationsOther information