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

◆ collect_push_writes()

void MayaFlux::Buffers::RelaxationStepProcessor::collect_push_writes ( const std::shared_ptr< VKBuffer > & buffer,
std::vector< Portal::Graphics::PushDescriptorWrite > & writes )
overrideprotectedvirtual

Push state_in and state_out for the current front/back assignment.

Parameters
bufferThe attached buffer.
writesReceives the parent's writes, then the two state slots.

Recorded into each dispatch's command buffer, so the generation swap between cycles needs no descriptor rewrite.

Reimplemented from MayaFlux::Buffers::ComputeProcessor.

Definition at line 26 of file RelaxationStepProcessor.cpp.

29{
31
32 if (!m_grid) {
33 return;
34 }
35
36 const auto& resources = m_grid->get_buffer_resources();
37 if (resources.back_buffers.size() < 2) {
38 return;
39 }
40
41 const size_t bytes = m_grid->get_state_bytes();
43
44 writes.push_back({
45 .binding = 0,
46 .type = type,
47 .buffer = vk::DescriptorBufferInfo(resources.back_buffers[m_grid->front_index()].buffer, 0, bytes),
48 });
49 writes.push_back({
50 .binding = 1,
51 .type = type,
52 .buffer = vk::DescriptorBufferInfo(resources.back_buffers[m_grid->back_index()].buffer, 0, bytes),
53 });
54}
virtual void collect_push_writes(const std::shared_ptr< VKBuffer > &buffer, std::vector< Portal::Graphics::PushDescriptorWrite > &writes)
Collect the writes for the push descriptor set, set 0.
std::shared_ptr< RelaxationGridBuffer > m_grid
The attached RelaxationGridBuffer, cached for descriptor writes and snapshot reads.
@ STORAGE
Large arrays or buffers the shader may write (SSBO).
vk::DescriptorType to_vk_descriptor_type(DescriptorRole role)
Convert DescriptorRole to the corresponding vk::DescriptorType.

References MayaFlux::Buffers::ComputeProcessor::collect_push_writes(), m_grid, MayaFlux::Portal::Graphics::STORAGE, and MayaFlux::Portal::Graphics::to_vk_descriptor_type().

Here is the call graph for this function: