MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
SolenoidalProcessor.cpp
Go to the documentation of this file.
2
3namespace MayaFlux::Buffers {
4
5std::vector<VolumeFieldProcessor::FieldBinding> SolenoidalProcessor::make_bindings(
6 const std::string& pressure_field, const std::string& velocity_field)
7{
8 return {
9 { .name = "pressure_in", .binding = 0, .field = pressure_field, .access = FieldAccess::READ },
10 { .name = "velocity_in", .binding = 1, .field = velocity_field, .access = FieldAccess::READ },
11 { .name = "velocity_out", .binding = 2, .field = velocity_field, .access = FieldAccess::WRITE },
12 };
13}
14
16 std::string pressure_field,
17 std::string velocity_field,
18 const std::string& shader_path)
19 : VolumeFieldProcessor(make_bindings(pressure_field, velocity_field), shader_path)
20 , m_pressure_field(std::move(pressure_field))
21 , m_velocity_field(std::move(velocity_field))
22{
24}
25
27 std::string pressure_field,
28 std::string velocity_field,
30 : VolumeFieldProcessor(make_bindings(pressure_field, velocity_field), spec)
31 , m_pressure_field(std::move(pressure_field))
32 , m_velocity_field(std::move(velocity_field))
33{
35}
36
37} // namespace MayaFlux::Buffers
SolenoidalProcessor(std::string pressure_field, std::string velocity_field, const std::string &shader_path)
Construct a gradient subtraction stage.
static std::vector< FieldBinding > make_bindings(const std::string &pressure_field, const std::string &velocity_field)
Build the binding table for the two field names.
@ READ
Resolves to VolumeGridBuffer::read_handle.
@ WRITE
Resolves to VolumeGridBuffer::write_handle.
void add_swap_field(std::string field)
Register a field to swap after each dispatch.
ComputeProcessor operating on named fields of a VolumeGridBuffer.
Complete declarative description of a generated compute shader.