Locate a target's word offset and component count in the layout.
189{
190 const auto modality = target_modality(target);
191 if (!modality.has_value())
192 return std::nullopt;
193
195 [&modality](
const Kakshya::VertexAttributeLayout&
a) {
196 return a.component_modality == *modality;
197 });
198
200 return std::nullopt;
201
202 if (it->offset_in_vertex % 4 != 0) {
204 "GpuFieldOperator: attribute '{}' sits at byte offset {}, which is "
205 "not word-aligned and cannot be addressed as a float index.",
206 it->name, it->offset_in_vertex);
207 return std::nullopt;
208 }
209
210 return std::make_pair(it->offset_in_vertex / 4, modality_components(*modality));
211}
#define MF_ERROR(comp, ctx,...)
Kakshya::VertexLayout m_layout
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
std::vector< VertexAttributeLayout > attributes
All attributes that make up one vertex Ordered by shader location (0, 1, 2, ...)