func GeometryShader(r io.Reader) PipelineConfig {
	var s shader
	var err error
	s.stages = C.GL_GEOMETRY_SHADER_BIT
	s.shader, err = newShader(C.GL_GEOMETRY_SHADER, r)
	if err != nil {
		setErr(internal.Wrap("gl geometry shader compiling", err))
	}
	return func(p *Pipeline) {
		p.attachShader(s)
	}
}
GeometryShader compiles a geometry shader.
package gl
import (
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"unsafe"
	"github.com/cozely/cozely/internal"
)
import "C"
type shader struct {
	shader C.GLuint
	stages C.GLenum
}
func Shader(path string) PipelineConfig {
	f, err := os.Open(filepath.FromSlash(path))
	if err != nil {
		setErr(internal.Wrap("gl shader file opening", err))
	}
	defer f.Close()
	switch {
	case strings.HasSuffix(path, ".vert"):
		return VertexShader(f)
	case strings.HasSuffix(path, ".frag"):
		return FragmentShader(f)
	case strings.HasSuffix(path, ".tesc"):
		return TessControlShader(f)
	case strings.HasSuffix(path, ".tese"):
		return TessEvaluationShader(f)
	case strings.HasSuffix(path, ".geom"):
		return GeometryShader(f)
	case strings.HasSuffix(path, ".comp"):
		return ComputeShader(f)
	}
	setErr(errors.New("gl shader file opening: unknown file extension"))
	return func(*Pipeline) {}
}
func VertexShader(r io.Reader) PipelineConfig {
	var s shader
	var err error
	s.stages = C.GL_VERTEX_SHADER_BIT
	s.shader, err = newShader(C.GL_VERTEX_SHADER, r)
	if err != nil {
		setErr(internal.Wrap("gl vertex shader compiling", err))
	}
	return func(p *Pipeline) {
		p.attachShader(s)
	}
}
func FragmentShader(r io.Reader) PipelineConfig {
	var s shader
	var err error
	s.stages = C.GL_FRAGMENT_SHADER_BIT
	s.shader, err = newShader(C.GL_FRAGMENT_SHADER, r)
	if err != nil {
		setErr(internal.Wrap("gl fragment shader compiling", err))
	}
	return func(p *Pipeline) {
		p.attachShader(s)
	}
}