public bool Equals(ShaderProgramDescription <VertexT> other) { return(VertexLayout.Equals(other.VertexLayout) && VertexShader.Equals(other.VertexShader) && FragmentShader.Equals(other.FragmentShader) && PipelineOptions.Equals(other.PipelineOptions) && UseSpirV == other.UseSpirV); }
private static Shader[] CreateShaders(ResourceFactory factory, ShaderProgramDescription <VertexT> material) { if (material.UseSpirV) { return(factory.CreateFromSpirv(material.VertexShader.Description, material.FragmentShader.Description)); } else { throw new InvalidOperationException("SPIR-V is the only supported shader format."); } }
public ShaderProgram(IDataSource dataSource, ShaderProgramDescription <VertexT> programDescription) { if (dataSource is null) { throw new ArgumentNullException(nameof(dataSource)); } if (!programDescription.UseSpirV) { throw new NotImplementedException("Support for only SPIR-V shaders are currently implemented."); } this.dataSource = dataSource; this.programDescription = programDescription; }