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

◆ declare_vector()

VectorRef MayaFlux::Buffers::VolumeGridBuffer::declare_vector ( std::string  name)

Declare a double-buffered vector 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.

Vector fields are always double-buffered. The single-slot case saves one slot, a megabyte at 64 cubed, and every vector field in use is either advected or diffused, both of which require two.

Definition at line 184 of file VolumeGridBuffer.cpp.

185{
186 if (!allocate_field(name, sizeof(glm::vec4), true)) {
187 return {};
188 }
189
190 return VectorRef {
191 .name = std::move(name),
192 .owner = std::dynamic_pointer_cast<VolumeGridBuffer>(shared_from_this()),
193 };
194}
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::VectorRef::name.

+ Here is the call graph for this function: