Wayverb
visual.h
1 #pragma once
2 
3 #include "raytracer/cl/structs.h"
4 #include "raytracer/iterative_builder.h"
5 
6 #include "core/cl/common.h"
7 #include "core/environment.h"
8 #include "core/spatial_division/scene_buffers.h"
9 
10 namespace wayverb {
11 namespace raytracer {
12 namespace reflection_processor {
13 
15 public:
16  explicit visual_group_processor(size_t items);
17 
18  template <typename It>
19  void process(It b,
20  It /*e*/,
21  const core::scene_buffers& /*buffers*/,
22  size_t /*step*/,
23  size_t /*total*/) {
24  builder_.push(b, b + builder_.get_num_items());
25  }
26 
27  auto get_results() const { return builder_.get_data(); }
28 
29 private:
31 };
32 
34 
35 class visual_processor final {
36 public:
37  explicit visual_processor(size_t items);
38 
39  visual_group_processor get_group_processor(size_t num_directions) const;
40  void accumulate(const visual_group_processor& processor);
41 
42  util::aligned::vector<util::aligned::vector<reflection>> get_results();
43 
44 private:
45  size_t items_;
46 
47  util::aligned::vector<util::aligned::vector<reflection>> results_;
48 };
49 
51 
52 class make_visual final {
53 public:
54  explicit make_visual(size_t items);
55 
56  visual_processor get_processor(
57  const core::compute_context& cc,
58  const glm::vec3& source,
59  const glm::vec3& receiver,
60  const core::environment& environment,
62  cl_float3,
63  core::surface<core::simulation_bands>>& voxelised) const;
64 
65 private:
66  size_t items_;
67 };
68 
69 } // namespace reflection_processor
70 } // namespace raytracer
71 } // namespace wayverb
Definition: iterative_builder.h:11
Definition: scene_buffers.h:12
Definition: pressure.h:22
Definition: environment.h:6
Definition: capsule_base.h:9
invariant: device is a valid device for the context
Definition: common.h:13
Definition: voxelised_scene_data.h:14