Example #1
0
 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);
 }
Example #2
0
 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.");
     }
 }
Example #3
0
        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;
        }