MayaFlux 1.0.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 577 of file VolumeGridBuffer.cpp.

578{
579 const auto* field = find_field(name, "seed_raw");
580 if (!field) {
581 return;
582 }
583
584 const size_t expected = static_cast<size_t>(get_cell_count()) * field->stride_bytes;
585 if (size != expected) {
587 "VolumeGridBuffer::seed_raw: size {} does not match expected {} for '{}'",
588 size, expected, name);
589 return;
590 }
591
593
594 const uint32_t slot = field->read_is_a ? field->slot_a : field->slot_b;
596 get_buffer_resources().back_buffers[slot], data, size, m_transfer_staging);
597}
#define MF_ERROR(comp, ctx,...)
bool size
std::string name
Definition VKDevice.cpp:123
const VKBufferResources & get_buffer_resources() const
Get all buffer resources at once (read-only)
Definition VKBuffer.hpp:343
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, name, MayaFlux::Buffers::resolve_transfer(), size, 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: