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

◆ seed_raw()

void MayaFlux::Buffers::VolumeGridBuffer::seed_raw ( const std::string &  name,
const void *  data,
size_t  size 
)

Write initial values into a field from raw host memory.

Parameters
nameField name.
dataPointer to at least size bytes.
sizeByte count; must equal get_field_bytes(name).

Writes into the current read slot. For double-buffered fields the write slot is left untouched, which is correct when the first stage to touch the field reads before it writes.

Definition at line 517 of file VolumeGridBuffer.cpp.

518{
519 const auto* field = find_field(name, "seed_raw");
520 if (!field) {
521 return;
522 }
523
524 const size_t expected = static_cast<size_t>(get_cell_count()) * field->stride_bytes;
525 if (size != expected) {
527 "VolumeGridBuffer::seed_raw: size {} does not match expected {} for '{}'",
528 size, expected, name);
529 return;
530 }
531
533
534 const uint32_t slot = field->read_is_a ? field->slot_a : field->slot_b;
536 get_buffer_resources().back_buffers[slot], data, size, m_transfer_staging);
537}
#define MF_ERROR(comp, ctx,...)
const VKBufferResources & get_buffer_resources() const
Get all buffer resources at once (read-only)
Definition VKBuffer.hpp:341
const Field * find_field(const std::string &name, const char *context) const
Resolve a field by name.
TransferHandle m_pending_transfer
In-flight seed upload, resolved before the next transfer.
uint32_t get_cell_count() const
Total cell count.
std::shared_ptr< VKBuffer > m_transfer_staging
Reused across seed and read calls.
void resolve_transfer(TransferHandle &handle)
Wait for a transfer and release its resources.
TransferHandle upload_back_buffer_async(const VKBufferResources::GenerationSlot &slot, const void *data, size_t size, std::shared_ptr< VKBuffer > &staging)
Upload to a back_buffers slot without waiting for completion.
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferManagement, MayaFlux::Journal::Buffers, find_field(), MayaFlux::Buffers::VKBuffer::get_buffer_resources(), get_cell_count(), m_pending_transfer, m_transfer_staging, MF_ERROR, MayaFlux::Buffers::resolve_transfer(), and MayaFlux::Buffers::upload_back_buffer_async().

Referenced by accumulate(), and seed().

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