MCPcopy Create free account
hub / github.com/RenderKit/embree / renderFrameStandard

Function renderFrameStandard

tutorials/point_geometry/point_geometry_device.cpp:186–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186extern "C" void renderFrameStandard (int* pixels,
187 const unsigned int width,
188 const unsigned int height,
189 const float time,
190 const ISPCCamera& camera)
191{
192#if defined(EMBREE_SYCL_TUTORIAL) && !defined(EMBREE_SYCL_RT_SIMULATION)
193 TutorialData ldata = data;
194 sycl::event event = global_gpu_queue->submit([=](sycl::handler& cgh){
195 const sycl::nd_range<2> nd_range = make_nd_range(height,width);
196 cgh.parallel_for(nd_range,[=](sycl::nd_item<2> item) {
197 const unsigned int x = item.get_global_id(1); if (x >= width ) return;
198 const unsigned int y = item.get_global_id(0); if (y >= height) return;
199 RayStats stats;
200 renderPixelStandard(ldata,x,y,pixels,width,height,time,camera,stats);
201 });
202 });
203 global_gpu_queue->wait_and_throw();
204
205 const auto t0 = event.template get_profiling_info<sycl::info::event_profiling::command_start>();
206 const auto t1 = event.template get_profiling_info<sycl::info::event_profiling::command_end>();
207 const double dt = (t1-t0)*1E-9;
208 ((ISPCCamera*)&camera)->render_time = dt;
209
210#else
211 const int numTilesX = (width +TILE_SIZE_X-1)/TILE_SIZE_X;
212 const int numTilesY = (height+TILE_SIZE_Y-1)/TILE_SIZE_Y;
213 parallel_for(size_t(0),size_t(numTilesX*numTilesY),[&](const range<size_t>& range) {
214 const int threadIndex = (int)TaskScheduler::threadIndex();
215 for (size_t i=range.begin(); i<range.end(); i++)
216 renderTileTask((int)i,threadIndex,pixels,width,height,time,camera,numTilesX,numTilesY);
217 });
218#endif
219}
220
221
222/* called by the C++ code to render */

Callers

nothing calls this directly

Calls 6

make_nd_rangeFunction · 0.85
parallel_forFunction · 0.85
renderPixelStandardFunction · 0.70
renderTileTaskFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected