shady-gen-0.5.1: Functional GPU programming - DSEL & compiler

Stabilityexperimental
Maintainerconal@conal.net

Shady.Language.GLSL

Contents

Description

Abstract syntax for GLSL. Evolving.

Synopsis

Syntax types

data Program Source

Program: Vertex shader and Fragment shader

Constructors

P 

data Shader Source

Shader

Constructors

Sh [Declaration] [Definition] 

Instances

data Declaration Source

Variable declaration/initialization.

Constructors

forall a . D [Qualifier] (Pat a) 

data Definition Source

Top-level definition

Constructors

forall n a . F (Maybe (VectorT n a)) Id [Param] Statement 

data VectorT n a Source

Constructors

VectorT (Nat n) (ScalarT a) 

Instances

data ScalarT whereSource

Constructors

Bool :: ScalarT Bool 
Int :: ScalarT Int 
Float :: ScalarT Float 

data Param Source

formal parameter

Constructors

forall n a . M (VectorT n a) Id 

Instances

type Id = StringSource

Variable name

data Bind Source

Variable binding

Constructors

forall a . B (Pat a) (E a) 

Instances

data Qualifier Source

Storage qualifier

Constructors

Uniform 
Attribute 
Varying 

Handy for building bindings

data BindO a Source

Binding with open (exposed) type. Build with '(=::)' and '(#)'.

Instances

(=::) :: HasType a => V a -> E a -> BindO aSource

V specialization of '(=:)'.

closeB :: HasType a => BindO a -> StatementSource

Close an open binding

Utilities

(=:) :: HasType a => Pat a -> E a -> StatementSource

Assignment statement

glPosition :: Pat R4Source

The standard gl_Position variable, which must be set in a vertex shader

glFragColor :: Pat R4Source

The standard gl_FragColor variable, which must be set in a fragment shader

vTrans :: E R4 -> E R4Source

Transform a vertex using the standard model/view matrix

nTrans :: E R3 -> E R3Source

Transform a normal using the standard normal matrix

mainDef :: Statement -> DefinitionSource

main in a shader program.