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

◆ write_grid_extent_constants()

void MayaFlux::Buffers::RelaxationStepProcessor::write_grid_extent_constants ( )
private

Size the push constant block to at least GridExtent and write the attached grid's dimensions into its leading 8 bytes.

Called from on_attach, the first point at which grid dimensions are known. A ShaderSpec-constructed processor already carries spec.push_constant_bytes in m_config; that size is preserved and only the leading extent fields are written, leaving trailing rule parameters available to set_push_constant_data_raw at any offset past sizeof(GridExtent).

Definition at line 58 of file RelaxationStepProcessor.cpp.

59{
60 if (m_config.push_constant_size < sizeof(GridExtent)) {
61 set_push_constant_size(sizeof(GridExtent));
62 }
63
64 auto& data = get_push_constant_data();
65 if (data.size() < m_config.push_constant_size) {
66 data.resize(m_config.push_constant_size);
67 }
68
69 const GridExtent extent {
70 .width = m_grid->get_grid_width(),
71 .height = m_grid->get_grid_height()
72 };
73 std::memcpy(data.data(), &extent, sizeof(GridExtent));
74}
std::shared_ptr< RelaxationGridBuffer > m_grid
The attached RelaxationGridBuffer, cached for descriptor writes and snapshot staging.
const std::vector< uint8_t > & get_push_constant_data() const
Get current push constant data.
void set_push_constant_size()
Set push constant size from type.

References MayaFlux::Buffers::ShaderProcessor::get_push_constant_data(), MayaFlux::Buffers::ShaderProcessor::m_config, m_grid, MayaFlux::Buffers::ShaderConfig::push_constant_size, MayaFlux::Buffers::ShaderProcessor::set_push_constant_size(), and MayaFlux::Buffers::RelaxationStepProcessor::GridExtent::width.

Referenced by on_attach().

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