Skip to content

Commit ff4b7c0

Browse files
committed
Move NUM_THREADS to stdafx.
1 parent 62bb2af commit ff4b7c0

File tree

10 files changed

+11
-14
lines changed

10 files changed

+11
-14
lines changed

src/utils/xrAI/StdAfx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
1414
#include "utils/xrLCUtil/xrThread.hpp"
1515

16+
#define NUM_THREADS 8
17+
1618
extern ILevelCompilerLogger& Logger;
1719
extern CThread::LogFunc ProxyMsg;
1820
extern CThreadManager::ReportStatusFunc ProxyStatus;

src/utils/xrAI/compiler_cover.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ void compute_non_covers()
526526
delete_data(nearest);
527527
}
528528

529-
#define NUM_THREADS 3
530529
extern void mem_Optimize();
531530
void xrCover(bool pure_covers)
532531
{

src/utils/xrLC/StdAfx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
99
#include "utils/xrLCUtil/xrThread.hpp"
1010

11+
#define NUM_THREADS 8
12+
1113
extern ILevelCompilerLogger& Logger;
1214
extern CThread::LogFunc ProxyMsg;
1315
extern CThreadManager::ReportStatusFunc ProxyStatus;

src/utils/xrLC/xrLight.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ void CBuild::LMapsLocal()
8787
// Main process (4 threads)
8888
Logger.Status("Lighting...");
8989
CThreadManager threads(ProxyStatus, ProxyProgress);
90-
const u32 thNUM = 6;
9190
CTimer start_time;
9291
start_time.Start();
93-
for (int L = 0; L < thNUM; L++)
92+
for (int L = 0; L < NUM_THREADS; L++)
9493
threads.start(new CLMThread(L));
9594
threads.wait(500);
9695
Logger.clMsg("%f seconds", start_time.GetElapsed_sec());

src/utils/xrLC/xrPhase_AdaptiveHT.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ class CPrecalcBaseHemiThread : public CThread
159159
}
160160
};
161161

162-
CThreadManager precalc_base_hemi(ProxyStatus, ProxyProgress);
163-
164162
void CBuild::xrPhase_AdaptiveHT()
165163
{
166164
CDB::COLLIDER DB;
@@ -205,11 +203,11 @@ void CBuild::xrPhase_AdaptiveHT()
205203
// V->C._set (vC);
206204
//}
207205

206+
CThreadManager precalc_base_hemi(ProxyStatus, ProxyProgress);
208207
u32 stride = u32(-1);
209-
210208
u32 threads = u32(-1);
211209
u32 rest = u32(-1);
212-
get_intervals(8, lc_global_data()->g_vertices().size(), threads, stride, rest);
210+
get_intervals(NUM_THREADS, lc_global_data()->g_vertices().size(), threads, stride, rest);
213211
for (u32 thID = 0; thID < threads; thID++)
214212
precalc_base_hemi.start(new CPrecalcBaseHemiThread(thID, thID * stride, thID * stride + stride));
215213
if (rest > 0)

src/utils/xrLC/xrPhase_GI.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "xrCore/Threading/Lock.hpp"
99
#include "xrCDB/xrCDB.h"
1010

11-
#define GI_THREADS 2
1211
const u32 gi_num_photons = 32;
1312
const float gi_optimal_range = 15.f;
1413
const float gi_reflect = 0.9f;
@@ -118,7 +117,7 @@ class CGI : public CThread
118117
dst.type = LT_SECONDARY;
119118
dst.level++;
120119
task_it++;
121-
thProgress = float(task_it) / float(task->size()) / float(GI_THREADS);
120+
thProgress = float(task_it) / float(task->size()) / float(NUM_THREADS);
122121
}
123122
task_cs.Leave();
124123
if (dst.level > gi_maxlevel)
@@ -227,7 +226,7 @@ void CBuild::xrPhase_Radiosity()
227226

228227
// perform all the work
229228
u32 setup_old = task->size();
230-
for (int t = 0; t < GI_THREADS; t++)
229+
for (int t = 0; t < NUM_THREADS; t++)
231230
{
232231
gi.start(new CGI(t));
233232
Sleep(10);

src/utils/xrLC_Light/compiler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include "lightthread.h"
77
#include "xrLightDoNet.h"
88

9-
#define NUM_THREADS 3
10-
119
void xrLight()
1210
{
1311
u32 range = gl_data.slots_data.size_z();

src/utils/xrLC_Light/stdafx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
1111
#include "utils/xrLCUtil/xrThread.hpp"
1212

13+
#define NUM_THREADS 8
14+
1315
extern ILevelCompilerLogger& Logger;
1416
extern CThread::LogFunc ProxyMsg;
1517
extern CThreadManager::ReportStatusFunc ProxyStatus;

src/utils/xrLC_Light/xrLightVertex.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ namespace lc_net
155155
{
156156
void RunLightVertexNet();
157157
}
158-
#define NUM_THREADS 4
159158
void LightVertex(bool net)
160159
{
161160
g_trans = new mapVert();

src/utils/xrLC_Light/xrLight_ImplicitThread.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ void ImplicitThread::Execute()
2323
execute.Execute(0);
2424
}
2525

26-
#define NUM_THREADS 8
2726
void RunImplicitMultithread(ImplicitDeflector& defl)
2827
{
2928
// Start threads

0 commit comments

Comments
 (0)