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

VRAD: Fix thread-sharing bug #141

Merged
merged 4 commits into from
Sep 17, 2020
Merged

VRAD: Fix thread-sharing bug #141

merged 4 commits into from
Sep 17, 2020

Conversation

devvoid
Copy link

@devvoid devvoid commented Sep 15, 2020

The raytracing code has debug variable n_intersection_calculations. This was used solely for debugging, but its existence caused a massive bottleneck in VRAD; performance nearly doubles on some systems without it.

More information and some performance testing can be found here: ValveSoftware/source-sdk-2013#436

@Yttrium-tYcLief Yttrium-tYcLief added the tf2 Related to the TF2 live version and TC2 label Sep 15, 2020
Copy link
Member

@mastercoms mastercoms left a comment

Choose a reason for hiding this comment

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

Could you wrap these in #ifdef _DEBUG / #endif?

@devvoid
Copy link
Author

devvoid commented Sep 15, 2020

Just in raytrace, or in float_bm4 too?

@devvoid
Copy link
Author

devvoid commented Sep 15, 2020

Also, the original code doesn't work as-intended because it isn't an atomic int and the raytracing system is multithreaded. I can also go ahead and change that too.

raytrace/raytrace.cpp Outdated Show resolved Hide resolved
@GamerDude27
Copy link

Out of curiosity, is the std::atomic<int> part something TC2 specific or does this count for, say, SDK2013 as well?

@GamerDude27
Copy link

Additionally, the linked PR also proposes upping MAX_THREADS and MAX_TOOLS_THREADS from 16 to 32, would this be relevant for TC2?

@mastercoms
Copy link
Member

@GamerDude27 Please move the MAX_THREADS discussion to a new issue, thanks!

@mastercoms mastercoms merged commit 0d63ec8 into mastercomfig:master Sep 17, 2020
@GamerDude27
Copy link

@mastercoms I'm still curious about my first question though!

@micwoj92
Copy link

micwoj92 commented Oct 7, 2020

rip bro @devvoid

mastercoms added a commit that referenced this pull request Oct 7, 2020
mastercoms added a commit that referenced this pull request Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tf2 Related to the TF2 live version and TC2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants