MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / IntersectionThread

Method IntersectionThread

src/luxrays/idevices/nativeidevice.cpp:144–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void NativeThreadIntersectionDevice::IntersectionThread(NativeThreadIntersectionDevice *renderDevice, const u_int threadIndex) {
145 //LR_LOG(renderDevice->deviceContext, "[NativeThread device::" << renderDevice->deviceName << "::" << threadIndex <<"] Rendering thread started");
146
147 try {
148 RayBufferQueue *queue = renderDevice->rayBufferQueue;
149
150 const double startTime = WallClockTime();
151 while (!boost::this_thread::interruption_requested()) {
152 const double t1 = WallClockTime();
153 RayBuffer *rayBuffer = queue->PopToDo();
154 renderDevice->threadDeviceIdleTime[threadIndex] += WallClockTime() - t1;
155
156 // Trace rays
157 const Ray *rb = rayBuffer->GetRayBuffer();
158 RayHit *hb = rayBuffer->GetHitBuffer();
159 const size_t rayCount = rayBuffer->GetRayCount();
160 for (unsigned int i = 0; i < rayCount; ++i) {
161 hb[i].SetMiss();
162 renderDevice->accel->Intersect(&rb[i], &hb[i]);
163 }
164 renderDevice->threadTotalDataParallelRayCount[threadIndex] += rayCount;
165 queue->PushDone(rayBuffer);
166
167 renderDevice->threadDeviceTotalTime[threadIndex] = WallClockTime() - startTime;
168 }
169
170 //LR_LOG(renderDevice->deviceContext, "[NativeThread device::" << renderDevice->deviceName << "::" << threadIndex <<"] Rendering thread halted");
171 } catch (boost::thread_interrupted) {
172 //LR_LOG(renderDevice->deviceContext, "[NativeThread device::" << renderDevice->deviceName << "::" << threadIndex <<"] Rendering thread halted");
173 }
174}
175
176//------------------------------------------------------------------------------
177// Statistics

Callers

nothing calls this directly

Calls 8

WallClockTimeFunction · 0.85
GetRayBufferMethod · 0.80
GetHitBufferMethod · 0.80
GetRayCountMethod · 0.80
SetMissMethod · 0.80
PopToDoMethod · 0.45
IntersectMethod · 0.45
PushDoneMethod · 0.45

Tested by

no test coverage detected