public static ShaderInputElementSpec CreateSpec(this ShaderInputElementPurpose purpose) { switch (purpose) { case ShaderInputElementPurpose.Position: return(new ShaderInputElementSpec(ShaderInputElementFormat.Float4, purpose)); case ShaderInputElementPurpose.Normal: return(new ShaderInputElementSpec(ShaderInputElementFormat.Float4, purpose)); case ShaderInputElementPurpose.TextureCoordinate: return(new ShaderInputElementSpec(ShaderInputElementFormat.Float2, purpose)); case ShaderInputElementPurpose.Color: return(new ShaderInputElementSpec(ShaderInputElementFormat.Float4, purpose)); default: throw new NotSupportedException("Cannot automatically generate input element spec from this value"); } }
public ShaderInputElementSpec(ShaderInputElementFormat format, ShaderInputElementPurpose purpose) { Format = format; Purpose = purpose; }
public ShaderInputElementSpec(ShaderInputElementFormat format) { Format = format; Purpose = ShaderInputElementPurpose.Custom; }