MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_lattice_params()

void MayaFlux::Buffers::VolumeFieldProcessor::write_lattice_params ( )
protected

Write the lattice dimensions and cell size into the staged push constant block, preserving word three.

Definition at line 136 of file VolumeFieldProcessor.cpp.

137{
138 if (!m_volume) {
139 return;
140 }
141
142 auto& data = get_push_constant_data();
143 if (data.size() < m_config.push_constant_size) {
144 data.resize(m_config.push_constant_size);
145 }
146
147 const Kinesis::Lattice3D& lattice = m_volume->get_lattice();
148 const glm::vec3 cell = lattice.cell_size();
149
150 uint32_t preserved_3 = 0;
151 float preserved_7 = 0.0F;
152 std::memcpy(&preserved_3, data.data() + k_word3_offset, sizeof(uint32_t));
153 std::memcpy(&preserved_7, data.data() + k_word7_offset, sizeof(float));
154
155 const LatticePrefix prefix {
156 .width = lattice.resolution.x,
157 .height = lattice.resolution.y,
158 .depth = lattice.resolution.z,
159 .word3 = preserved_3,
160 .cell_size_x = cell.x,
161 .cell_size_y = cell.y,
162 .cell_size_z = cell.z,
163 .word7 = preserved_7,
164 };
165
166 std::memcpy(data.data(), &prefix, k_prefix_size);
167}
const std::vector< uint8_t > & get_push_constant_data() const
Get current push constant data.
std::shared_ptr< VolumeGridBuffer > m_volume
The attached volume, null until on_attach validates it.

References MayaFlux::Kinesis::Lattice3D::cell_size(), MayaFlux::Buffers::ShaderProcessor::get_push_constant_data(), MayaFlux::Buffers::ShaderProcessor::m_config, m_volume, MayaFlux::Buffers::ShaderConfig::push_constant_size, and MayaFlux::Kinesis::Lattice3D::resolution.

Referenced by on_attach(), MayaFlux::Buffers::AdvectProcessor::on_volume_ready(), MayaFlux::Buffers::BuoyancyProcessor::on_volume_ready(), and MayaFlux::Buffers::InfluxProcessor::on_volume_ready().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: