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

◆ set_real()

bool MayaFlux::Kakshya::CompositeArray::set_real ( size_t  index,
std::string_view  field_name,
double  value 
)
private

Definition at line 251 of file Composite.cpp.

252{
253 const auto field_index = validate_dynamic_write(index, field_name);
254 if (!field_index)
255 return false;
256 DynamicCell cell { real_kind, 0, 0 };
257 std::memcpy(&cell.payload, &value, sizeof(value));
258 const auto& field = m_layout.fields()[*field_index];
259 auto& rows = std::get<std::vector<uint8_t>>(m_rows);
260 std::memcpy(rows.data() + index * m_layout.stride_bytes() + field.offset_bytes, &cell, sizeof(cell));
261 set_present(index, *field_index, true);
262 return true;
263}
uint32_t rows
glm::vec3 value
uint32_t index
Definition VKDevice.cpp:122
void set_present(size_t index, size_t field_index, bool present) noexcept
std::optional< size_t > validate_dynamic_write(size_t index, std::string_view field_name) const
size_t stride_bytes() const noexcept
Bytes per packed element after finalization.
Definition Composite.hpp:86
const std::vector< CompositeField > & fields() const noexcept
Declared fields in element order, with finalized byte offsets.
Definition Composite.hpp:82

References MayaFlux::Kakshya::CompositeLayout::fields(), index, m_layout, m_rows, rows, set_present(), MayaFlux::Kakshya::CompositeLayout::stride_bytes(), validate_dynamic_write(), and value.

+ Here is the call graph for this function: