Example #1
0
        internal ShaderPipeline GetShaderPipeline(Shader vertex, Shader tescontrol, Shader teseval, Shader geometry,
                                                  Shader fragment, Shader compute)
        {
            ShaderPipelineDescription desc = new ShaderPipelineDescription()
            {
                Vertex                = vertex,
                TesselationControl    = tescontrol,
                TesselationEvaluation = teseval,
                Geometry              = geometry,
                Fragment              = fragment,
                Compute               = compute
            };

            if (_pipelines.ContainsKey(desc))
            {
                return(_pipelines[desc]);
            }

            ShaderPipeline pipeline = new ShaderPipeline(desc);

            _pipelines.Add(desc, pipeline);

            desc.Vertex?.Pipelines.Add(pipeline);
            desc.TesselationControl?.Pipelines.Add(pipeline);
            desc.TesselationEvaluation?.Pipelines.Add(pipeline);
            desc.Geometry?.Pipelines.Add(pipeline);
            desc.Fragment?.Pipelines.Add(pipeline);
            desc.Compute?.Pipelines.Add(pipeline);

            return(pipeline);
        }
Example #2
0
 public ShaderPipeline(ShaderPipelineDescription description)
 {
     Description            = description;
     _rebuildShaderPipeline = true;
 }