8 constexpr size_t k_tail_offset = 32;
9 constexpr size_t k_param_size = 80;
30 static_assert(k_tail_offset +
sizeof(InfluxTail) == k_param_size);
34 const std::string& field)
37 { .name =
"field_in", .binding = 0, .field = field, .access =
FieldAccess::READ },
44 , m_field(
std::move(field))
51 , m_field(
std::move(field))
71 const InfluxTail tail {
void write_tail()
Write every parameter past the shared prefix.
void restart()
Reset elapsed time to zero.
static std::vector< FieldBinding > make_bindings(const std::string &field)
Build the binding table for the field name.
void on_volume_ready() override
Raise the parameter block and write everything past the prefix.
void set_time_step(float dt)
Set the integration step.
void set_center(const glm::vec3 ¢er)
Set the shape's world-space centre.
InfluxProcessor(std::string field, const std::string &shader_path)
Construct an influx stage.
void set_falloff(float falloff)
Set the shape's edge softness.
void set_radius(float radius)
Set the shape's characteristic size.
void processing_function(const std::shared_ptr< Buffer > &buffer) override
The core processing function that must be implemented by derived classes.
void set_rate(float rate)
Set the amount added per unit time at shape value one.
void write_param_tail(size_t offset, const void *data, size_t size)
Write subclass parameters past the shared prefix.
void reserve_param_size(size_t size)
Raise the push constant block to at least this size.
void write_lattice_word7(float value)
Write word seven of the parameter prefix, at byte offset 28.
void processing_function(const std::shared_ptr< Buffer > &buffer) override
Rewrite field descriptors, run the shader, then swap.
@ READ
Resolves to VolumeGridBuffer::read_handle.
@ WRITE
Resolves to VolumeGridBuffer::write_handle.
void write_lattice_params()
Write the lattice dimensions and cell size into the staged push constant block, preserving word three...
const std::shared_ptr< VolumeGridBuffer > & get_volume() const
The attached volume, or null if attachment failed validation.
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.