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

◆ declare_scratch()

ScalarRef MayaFlux::Buffers::VolumeGridBuffer::declare_scratch ( std::string  name,
Kinesis::LatticeSemantics  semantics = {} 
)

Declare a single-slot scalar field.

Parameters
nameLookup key, unique within this volume.
semanticsWhat the values mean. A divergence field wants
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 177 of file VolumeGridBuffer.cpp.

178{
179 if (!allocate_field(name, sizeof(float), false, semantics)) {
180 return {};
181 }
182
183 return ScalarRef {
184 .name = std::move(name),
185 .owner = std::dynamic_pointer_cast<VolumeGridBuffer>(shared_from_this()),
186 };
187}
std::string name
Definition VKDevice.cpp:123
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(), MayaFlux::Buffers::ScalarRef::name, and name.

+ Here is the call graph for this function: