/// <summary> Make a new entry of this type with an optional name </summary> public GLShaderPipeline NewShaderPipeline(string name, IGLPipelineComponentShader vertex, IGLPipelineComponentShader fragment) { GLShaderPipeline s = new GLShaderPipeline(vertex, fragment); items[EnsureName(name)] = s; return(s); }
/// <summary> Create a pipeline shader with a optional vertex, tcs, tes, geo and fragment components and with these optional start and finish actions</summary> public GLShaderPipeline(IGLPipelineComponentShader vertex, IGLPipelineComponentShader tcs, IGLPipelineComponentShader tes, IGLPipelineComponentShader geo, IGLPipelineComponentShader fragment, Action <IGLProgramShader, GLMatrixCalc> sa = null, Action <IGLProgramShader> fa = null) : this() { AddVertexTCSTESGeoFragment(vertex, tcs, tes, geo, fragment); StartAction = sa; FinishAction = fa; }
/// <summary> Add a pipeline shader of shadertype </summary> public void Add(IGLPipelineComponentShader pipelineshader, ShaderType shadertype) { System.Diagnostics.Debug.Assert(!shaders.ContainsKey(shadertype)); shaders[shadertype] = pipelineshader; pipelineshader.References++; GL.UseProgramStages(pipelineid, convmask[shadertype], pipelineshader.Id); GLStatics.Check(); }
/// <summary> Add shaders: optional vertex, tcs, tes, geo and fragment shaders</summary> public void AddVertexTCSTESGeoFragment(IGLPipelineComponentShader p, IGLPipelineComponentShader tcs, IGLPipelineComponentShader tes, IGLPipelineComponentShader g, IGLPipelineComponentShader f) { if (p != null) { Add(p, ShaderType.VertexShader); } if (tcs != null) { Add(tcs, ShaderType.TessControlShader); } if (tes != null) { Add(tes, ShaderType.TessEvaluationShader); } if (g != null) { Add(g, ShaderType.GeometryShader); } if (f != null) { Add(f, ShaderType.FragmentShader); } }
/// <summary> Add this type with an optional name </summary> public IGLPipelineComponentShader Add(IGLPipelineComponentShader disp, string name = null) { System.Diagnostics.Debug.Assert(!items.ContainsValue(disp)); items.Add(EnsureName(name), disp); return(disp); }
/// <summary> Add vertex and fragment shaders</summary> public void AddVertexFragment(IGLPipelineComponentShader p, IGLPipelineComponentShader f) { Add(p, ShaderType.VertexShader); Add(f, ShaderType.FragmentShader); }
/// <summary> Add vertex shader</summary> public void AddVertex(IGLPipelineComponentShader p) { Add(p, ShaderType.VertexShader); }
/// <summary> Create a pipeline shader with a vertex components and with these optional start and finish actions</summary> public GLShaderPipeline(IGLPipelineComponentShader vertex, Action <IGLProgramShader, GLMatrixCalc> sa = null, Action <IGLProgramShader> fa = null) : this() { AddVertex(vertex); StartAction = sa; FinishAction = fa; }