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

◆ on_before_execute()

bool MayaFlux::Buffers::RelaxationEmitProcessor::on_before_execute ( Portal::Graphics::CommandBufferID  cmd_id,
const std::shared_ptr< VKBuffer > &  buffer 
)
overrideprotectedvirtual

Write the cell_state and vertices descriptor bindings for this cycle's dispatch.

Parameters
cmd_idCommand buffer this cycle's dispatch will be recorded into.
bufferThe attached RelaxationGridBuffer, received as VKBuffer.
Returns
True unconditionally; emission always runs when the buffer is a valid RelaxationGridBuffer.

Reimplemented from MayaFlux::Buffers::ShaderProcessor.

Definition at line 36 of file RelaxationEmitProcessor.cpp.

39{
40 auto* grid = dynamic_cast<RelaxationGridBuffer*>(buffer.get());
41 if (!grid) {
42 return false;
43 }
44
45 if (!are_descriptors_ready()) {
46 return true;
47 }
48
50 auto& resources = grid->get_buffer_resources();
51
52 foundry.update_descriptor_buffer(
53 m_descriptor_set_ids[0], 0, vk::DescriptorType::eStorageBuffer,
54 resources.back_buffers[grid->front_index()].buffer, 0, grid->get_state_bytes());
55
56 foundry.update_descriptor_buffer(
57 m_descriptor_set_ids[0], 1, vk::DescriptorType::eStorageBuffer,
58 buffer->get_buffer(), 0, buffer->get_size_bytes());
59
60 return true;
61}
bool are_descriptors_ready() const
Check if descriptors are initialized.
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Buffers::ShaderProcessor::are_descriptors_ready(), MayaFlux::Portal::Graphics::get_shader_foundry(), and MayaFlux::Buffers::ShaderProcessor::m_descriptor_set_ids.

+ Here is the call graph for this function: