public void BindAttributes(IVertexStream vertexStream, VertexFormat vertexFormat) { foreach (var mapping in mappings) { if (vertexFormat.HasAttribute(mapping.SrcUsage, mapping.SrcIndex)) { var attribute = vertexFormat.FindAttribute(mapping.SrcUsage, mapping.SrcIndex); vertexStream.Add( mapping, attribute, vertexFormat.Stride ); } } }
public void BindAttributes(VertexStreamRL vertexStream, IProgram program, VertexFormat vertexFormat) { foreach (var mapping in mappings) { var programAttribute = program.Attribute(mapping.Name); if (programAttribute == null) { continue; } var vertexFormatAttribute = vertexFormat.FindAttribute(mapping.SrcUsage, mapping.SrcIndex); if (vertexFormatAttribute == null) { continue; } vertexStream.Add( mapping, vertexFormatAttribute, vertexFormat.Stride, programAttribute.Slot ); } }