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

◆ read_state_slot()

VKBufferResources::GenerationSlot MayaFlux::Buffers::NetworkGeometryBuffer::read_state_slot ( const std::string &  name) const

Full back_buffers slot a stage should read the named state field from.

Returns
The slot, or a default-constructed (null-handle) slot if undeclared.

Same resolution as read_state_handle, without narrowing to just the Vulkan handle: a CPU-side readback through StagingUtils::download_back_buffer needs the whole slot (it checks mapped_ptr for the host-visible fast path), not only .buffer. Returned by value since GenerationSlot is three handles wide.

Definition at line 380 of file NetworkGeometryBuffer.cpp.

381{
382 const auto* field = find_state_field(name, "read_state_slot");
383 if (!field) {
384 return {};
385 }
386
387 const uint32_t slot = field->read_is_a ? field->slot_a : field->slot_b;
388 return get_buffer_resources().back_buffers[slot];
389}
std::string name
Definition VKDevice.cpp:143
const StateField * find_state_field(const std::string &name, const char *context) const
Resolve a declared state field by name.
const VKBufferResources & get_buffer_resources() const
Get all buffer resources at once (read-only)
Definition VKBuffer.hpp:341
std::vector< GenerationSlot > back_buffers
Definition VKBuffer.hpp:48

References MayaFlux::Buffers::VKBufferResources::back_buffers, find_state_field(), MayaFlux::Buffers::VKBuffer::get_buffer_resources(), and name.

+ Here is the call graph for this function: