Skip to content

Commit 905210c

Browse files
committed
tr_init: report OpenMP support in /gfxinfo
1 parent 4867415 commit 905210c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/engine/renderer/tr_init.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
// tr_init.c -- functions that are not called every frame
2424
#include "tr_local.h"
2525
#include "framework/CvarSystem.h"
26+
#include "framework/OmpSystem.h"
2627
#include "DetectGLVendors.h"
2728
#include "Material.h"
2829
#include "GeometryCache.h"
@@ -1057,6 +1058,21 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
10571058
Log::Notice("Using dual processor acceleration." );
10581059
}
10591060

1061+
#if defined(_OPENMP)
1062+
int ompThreads = Omp::GetThreads();
1063+
1064+
if ( ompThreads == 1 )
1065+
{
1066+
Log::Notice("%sNot using OpenMP parallelism: only one thread.", Color::ToString( Color::Red ) );
1067+
}
1068+
else
1069+
{
1070+
Log::Notice("%sUsing OpenMP parallelism with %d threads.", Color::ToString( Color::Green ), ompThreads );
1071+
}
1072+
#else
1073+
Log::Notice("%sNot using OpenMP parallelism: unavailable.", Color::ToString( Color::Red ) );
1074+
#endif
1075+
10601076
if ( r_finish->integer )
10611077
{
10621078
Log::Notice("Forcing glFinish." );

0 commit comments

Comments
 (0)