45 const glm::vec3& bounds_min,
46 const glm::vec3& bounds_max,
69 std::shared_ptr<VKBuffer> grid_buf,
70 std::shared_ptr<VKBuffer> counter_buf,
71 const glm::vec3& bounds_min,
72 const glm::vec3& bounds_max,
84 void set_bounds(
const glm::vec3& bounds_min,
const glm::vec3& bounds_max);
92 void set_resolution(uint32_t res_x, uint32_t res_y, uint32_t res_z);
95 void set_iso_level(
float iso_level);
100 [[nodiscard]]
bool is_dirty()
const {
return m_dirty; }
103 void on_attach(
const std::shared_ptr<Buffer>& buffer)
override;
104 void on_descriptors_created()
override;
105 bool on_before_execute(
107 const std::shared_ptr<VKBuffer>& buffer)
override;
108 void on_after_execute(
110 const std::shared_ptr<VKBuffer>& buffer)
override;
120 bool m_dirty {
true };
121 bool m_owns_buffers {
true };
137 static_assert(
sizeof(McPC) % 16 == 0);
139 void rebuild_owned_buffers();
140 void evaluate_grid();
141 void rebuild_lookup_buffers();
145 return (m_res_x + 1) * (m_res_y + 1) * (m_res_z + 1);
150 return m_res_x * m_res_y * m_res_z;
155 return voxel_count() * 15U;