private void Initialize(string source) { GLShader = GL.CreateShader(GLHelper.GetGLShaderType(Stage)); GLHelper.CheckGLErrors(); GL.ShaderSource(GLShader, ProcessSource(source)); GLHelper.CheckGLErrors(); GL.CompileShader(GLShader); GLHelper.CheckGLErrors(); GL.GetShader(GLShader, ShaderParameter.CompileStatus, out int compileStatus); if (compileStatus == 0) { var infoLog = GL.GetShaderInfoLog(GLShader); GLHelper.CheckGLErrors(); GL.DeleteShader(GLShader); GLHelper.CheckGLErrors(); throw new System.Exception($"Shader compilation failed:\n{infoLog}"); } }