Wayverb
run.h
1 #pragma once
2 
3 #include "raytracer/image_source/postprocess_branches.h"
4 #include "raytracer/image_source/reflection_path_builder.h"
5 #include "raytracer/raytracer.h"
6 #include "raytracer/reflection_processor/image_source.h"
7 #include "raytracer/reflector.h"
8 
9 namespace wayverb {
10 namespace raytracer {
11 namespace image_source {
12 
13 // Has to take voxelised_scene_data<cl_float3, surface> because it uses GPU.
14 template <typename It>
15 auto run(
16  It b,
17  It e,
18  const core::compute_context& cc,
19  const core::voxelised_scene_data<cl_float3,
20  core::surface<core::simulation_bands>>&
21  voxelised,
22  const glm::vec3& source,
23  const glm::vec3& receiver,
24  const core::environment& environment) {
25  const auto callbacks =
26  std::make_tuple(raytracer::reflection_processor::make_image_source{
27  std::numeric_limits<size_t>::max()});
28 
29  auto results = raytracer::run(b,
30  e,
31  cc,
32  voxelised,
33  source,
34  receiver,
35  environment,
36  true,
37  [](auto /*i*/, auto /*steps*/) {},
38  callbacks);
39 
40  if (!results) {
41  throw std::runtime_error{"Raytracer failed to generate results."};
42  }
43 
44  return std::move(std::get<0>(*results));
45 }
46 
47 } // namespace image_source
48 } // namespace raytracer
49 } // namespace wayverb
Definition: pressure.h:22
Definition: capsule_base.h:9