MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
DivergenceProcessor.cpp
Go to the documentation of this file.
2
3namespace MayaFlux::Buffers {
4
5std::vector<VolumeFieldProcessor::FieldBinding> DivergenceProcessor::make_bindings(
6 const std::string& velocity_field, const std::string& divergence_field)
7{
8 return {
9 { .name = "velocity_in", .binding = 0, .field = velocity_field, .access = FieldAccess::READ },
10 { .name = "divergence_out", .binding = 1, .field = divergence_field, .access = FieldAccess::WRITE },
11 };
12}
13
15 std::string velocity_field,
16 std::string divergence_field,
17 const std::string& shader_path)
18 : VolumeFieldProcessor(make_bindings(velocity_field, divergence_field), shader_path)
19 , m_velocity_field(std::move(velocity_field))
20 , m_divergence_field(std::move(divergence_field))
21{
22}
23
25 std::string velocity_field,
26 std::string divergence_field,
28 : VolumeFieldProcessor(make_bindings(velocity_field, divergence_field), spec)
29 , m_velocity_field(std::move(velocity_field))
30 , m_divergence_field(std::move(divergence_field))
31{
32}
33
34} // namespace MayaFlux::Buffers
static std::vector< FieldBinding > make_bindings(const std::string &velocity_field, const std::string &divergence_field)
Build the binding table for the two field names.
DivergenceProcessor(std::string velocity_field, std::string divergence_field, const std::string &shader_path)
Construct a divergence stage.
@ READ
Resolves to VolumeGridBuffer::read_handle.
@ WRITE
Resolves to VolumeGridBuffer::write_handle.
ComputeProcessor operating on named fields of a VolumeGridBuffer.
Complete declarative description of a generated compute shader.