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

◆ write_state_slot()

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

Full back_buffers slot a stage should write the named state field to.

Returns
The slot, or a default-constructed (null-handle) slot if undeclared. Equals read_state_slot() for single-slot fields.

Same resolution as write_state_handle, without narrowing to just the Vulkan handle: a CPU-side upload through StagingUtils::upload_back_buffer needs the whole slot (it checks mapped_ptr for the host-visible fast path), not only .buffer.

Definition at line 402 of file NetworkGeometryBuffer.cpp.

403{
404 const auto* field = find_state_field(name, "write_state_slot");
405 if (!field) {
406 return {};
407 }
408
409 const uint32_t slot = field->read_is_a ? field->slot_b : field->slot_a;
410 return get_buffer_resources().back_buffers[slot];
411}
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.

Referenced by ensure_cluster_ids().

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