checkBundleAgreement function
Every mismatch between the stages of a bundle that are drawn together:
vertex and fragment are the GLSL of each stage by name, includes
resolved, and each vertex stage is held to the fragment stage
pairedFragmentStage names. Empty when they agree.
Implementation
List<StageMismatch> checkBundleAgreement({
required Map<String, String> vertex,
required Map<String, String> fragment,
}) {
final fragments = fragment.keys.toSet();
return <StageMismatch>[
for (final MapEntry(key: name, value: glsl) in vertex.entries)
if (pairedFragmentStage(name, fragments) case final paired?)
...checkStageAgreement(
vertex: StageInterface.fromGlsl(glsl, name: name, fragment: false),
fragment: StageInterface.fromGlsl(
fragment[paired]!,
name: paired,
fragment: true,
),
),
];
}