Skip to content

Commit 1138716

Browse files
committed
tr_init: report OpenMP support in /gfxinfo
1 parent 1b7a21e commit 1138716

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/Omp.h"
2627
#include "DetectGLVendors.h"
2728
#include "Material.h"
2829
#include "GeometryCache.h"
@@ -1055,6 +1056,21 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
10551056
Log::Notice("Using dual processor acceleration." );
10561057
}
10571058

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

0 commit comments

Comments
 (0)