Example #1
0
        public GPUPipeline CreatePipeline(GPUPipelineCreateInfo info)
        {
            GPUBuffer[] buffers = new GPUBuffer[info.Format.GetBufferFormats().Length];
            int         i;

            for (i = 0; i < info.Format.GetBufferFormats().Length; i++)
            {
                buffers[i] = CreateBuffer(info.Format.GetBufferFormats()[i].Size);
            }
            for (i = 0; i < info.Format.GetBufferFormats().Length; i++)
            {
                GPUBufferFormat bf = info.Format.GetBufferFormats()[i];
                Gl.glVertexArrayVertexBuffer(info.Format, bf.BufferIndex, _buffers[i], bf.Offset, (int)bf.Stride);
            }
            GPUPipeline pipe = new GPUPipeline(this, info.ShaderProgram, info.Format, buffers);

            _pipelines.Add(pipe);
            return(pipe);
        }
Example #2
0
 public void DeletePipeline(GPUPipeline pipe)
 {
     //TODO: delete all handles in pipeline
     _pipelines.Remove(pipe);
 }