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

◆ declare_scratch()

ScalarRef MayaFlux::Buffers::VolumeGridBuffer::declare_scratch ( std::string  name)

Declare a single-slot scalar field.

Parameters
nameLookup key, unique within this volume.
Returns
Ref naming the field, or a ref with an empty name if the declaration was rejected.

Read and write resolve to one handle, which suits a quantity recomputed from other fields every cycle and never carried across cycles: divergence is the ordinary case. A stage that reads a neighbourhood of a field it also writes cannot use one of these, and VolumeFieldProcessor rejects that arrangement at attach.

Definition at line 172 of file VolumeGridBuffer.cpp.

173{
174 if (!allocate_field(name, sizeof(float), false)) {
175 return {};
176 }
177
178 return ScalarRef {
179 .name = std::move(name),
180 .owner = std::dynamic_pointer_cast<VolumeGridBuffer>(shared_from_this()),
181 };
182}
bool allocate_field(const std::string &name, size_t stride_bytes, bool double_buffered)
Allocate one field's slots and register it.

References allocate_field(), and MayaFlux::Buffers::ScalarRef::name.

+ Here is the call graph for this function: