ombra-0.1.1.0: Render engine.

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Shader.CPU

Synopsis

Documentation

data CPUSetterType k #

This kind represents the way you are setting a GPU value.

Constructors

S

Single CPU type (only for types with one field)

M

Mirror type (a data type identical to the GPU one but with CPU single types instead of GPU)

type family CPU (s :: CPUSetterType *) g where ... #

Equations

CPU S x = CPUSingle x 
CPU M x = CPUMirror x 

type family CPUBase g #

Instances

type CPUBase Mat4 # 
type CPUBase Mat3 # 
type CPUBase Mat2 # 
type CPUBase BVec4 # 
type CPUBase BVec3 # 
type CPUBase BVec2 # 
type CPUBase IVec4 # 
type CPUBase IVec3 # 
type CPUBase IVec2 # 
type CPUBase Vec4 # 
type CPUBase Vec3 # 
type CPUBase Vec2 # 
type CPUBase SamplerCube # 
type CPUBase Sampler2D # 
type CPUBase Int # 
type CPUBase Float # 
type CPUBase Bool # 
type CPUBase (Array n BVec4) # 
type CPUBase (Array n BVec4) = [IVec4]
type CPUBase (Array n BVec3) # 
type CPUBase (Array n BVec3) = [IVec3]
type CPUBase (Array n BVec2) # 
type CPUBase (Array n BVec2) = [IVec2]
type CPUBase (Array n IVec4) # 
type CPUBase (Array n IVec4) = [IVec4]
type CPUBase (Array n IVec3) # 
type CPUBase (Array n IVec3) = [IVec3]
type CPUBase (Array n IVec2) # 
type CPUBase (Array n IVec2) = [IVec2]
type CPUBase (Array n Vec4) # 
type CPUBase (Array n Vec4) = [Vec4]
type CPUBase (Array n Vec3) # 
type CPUBase (Array n Vec3) = [Vec3]
type CPUBase (Array n Vec2) # 
type CPUBase (Array n Vec2) = [Vec2]
type CPUBase (Array n Int) # 
type CPUBase (Array n Int) = [Int32]
type CPUBase (Array n Bool) # 
type CPUBase (Array n Bool) = [Int32]
type CPUBase (Array n Float) # 
type CPUBase (Array n Float) = [Float]

type family CPUMirror g #

The mirror type of a certain global.

For instance:

     data T = T Vec3 Float -- In the shader module
     data T = T Vec3 Float -- CPU version of the uniform type
     type CPUMirror GPU.T = T

class BaseUniform g where #

CPU types convertible to GPU types (as uniforms).

Minimal complete definition

setUniform

Methods

setUniform :: UniformLocation -> proxy g -> CPUBase g -> GL () #

Instances

GLES => BaseUniform Mat4 # 

Methods

setUniform :: UniformLocation -> proxy Mat4 -> CPUBase Mat4 -> GL () #

GLES => BaseUniform Mat3 # 

Methods

setUniform :: UniformLocation -> proxy Mat3 -> CPUBase Mat3 -> GL () #

GLES => BaseUniform Mat2 # 

Methods

setUniform :: UniformLocation -> proxy Mat2 -> CPUBase Mat2 -> GL () #

GLES => BaseUniform BVec4 # 

Methods

setUniform :: UniformLocation -> proxy BVec4 -> CPUBase BVec4 -> GL () #

GLES => BaseUniform BVec3 # 

Methods

setUniform :: UniformLocation -> proxy BVec3 -> CPUBase BVec3 -> GL () #

GLES => BaseUniform BVec2 # 

Methods

setUniform :: UniformLocation -> proxy BVec2 -> CPUBase BVec2 -> GL () #

GLES => BaseUniform IVec4 # 

Methods

setUniform :: UniformLocation -> proxy IVec4 -> CPUBase IVec4 -> GL () #

GLES => BaseUniform IVec3 # 

Methods

setUniform :: UniformLocation -> proxy IVec3 -> CPUBase IVec3 -> GL () #

GLES => BaseUniform IVec2 # 

Methods

setUniform :: UniformLocation -> proxy IVec2 -> CPUBase IVec2 -> GL () #

GLES => BaseUniform Vec4 # 

Methods

setUniform :: UniformLocation -> proxy Vec4 -> CPUBase Vec4 -> GL () #

GLES => BaseUniform Vec3 # 

Methods

setUniform :: UniformLocation -> proxy Vec3 -> CPUBase Vec3 -> GL () #

GLES => BaseUniform Vec2 # 

Methods

setUniform :: UniformLocation -> proxy Vec2 -> CPUBase Vec2 -> GL () #

GLES => BaseUniform SamplerCube # 
GLES => BaseUniform Sampler2D # 
GLES => BaseUniform Int # 

Methods

setUniform :: UniformLocation -> proxy Int -> CPUBase Int -> GL () #

GLES => BaseUniform Float # 

Methods

setUniform :: UniformLocation -> proxy Float -> CPUBase Float -> GL () #

GLES => BaseUniform Bool # 

Methods

setUniform :: UniformLocation -> proxy Bool -> CPUBase Bool -> GL () #

GLES => BaseUniform (Array n BVec4) # 

Methods

setUniform :: UniformLocation -> proxy (Array n BVec4) -> CPUBase (Array n BVec4) -> GL () #

GLES => BaseUniform (Array n BVec3) # 

Methods

setUniform :: UniformLocation -> proxy (Array n BVec3) -> CPUBase (Array n BVec3) -> GL () #

GLES => BaseUniform (Array n BVec2) # 

Methods

setUniform :: UniformLocation -> proxy (Array n BVec2) -> CPUBase (Array n BVec2) -> GL () #

GLES => BaseUniform (Array n IVec4) # 

Methods

setUniform :: UniformLocation -> proxy (Array n IVec4) -> CPUBase (Array n IVec4) -> GL () #

GLES => BaseUniform (Array n IVec3) # 

Methods

setUniform :: UniformLocation -> proxy (Array n IVec3) -> CPUBase (Array n IVec3) -> GL () #

GLES => BaseUniform (Array n IVec2) # 

Methods

setUniform :: UniformLocation -> proxy (Array n IVec2) -> CPUBase (Array n IVec2) -> GL () #

GLES => BaseUniform (Array n Vec4) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Vec4) -> CPUBase (Array n Vec4) -> GL () #

GLES => BaseUniform (Array n Vec3) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Vec3) -> CPUBase (Array n Vec3) -> GL () #

GLES => BaseUniform (Array n Vec2) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Vec2) -> CPUBase (Array n Vec2) -> GL () #

GLES => BaseUniform (Array n Int) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Int) -> CPUBase (Array n Int) -> GL () #

GLES => BaseUniform (Array n Bool) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Bool) -> CPUBase (Array n Bool) -> GL () #

GLES => BaseUniform (Array n Float) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Float) -> CPUBase (Array n Float) -> GL () #

class ShaderType g => BaseAttribute g where #

CPU types convertible to GPU types (as attributes).

Minimal complete definition

encodeAttribute, setAttribute

Methods

encodeAttribute :: proxy g -> [CPUBase g] -> GL AnyArray #

setAttribute :: proxy g -> GLUInt -> GL () #

Instances

GLES => BaseAttribute BVec4 # 

Methods

encodeAttribute :: proxy BVec4 -> [CPUBase BVec4] -> GL AnyArray #

setAttribute :: proxy BVec4 -> GLUInt -> GL () #

GLES => BaseAttribute BVec3 # 

Methods

encodeAttribute :: proxy BVec3 -> [CPUBase BVec3] -> GL AnyArray #

setAttribute :: proxy BVec3 -> GLUInt -> GL () #

GLES => BaseAttribute BVec2 # 

Methods

encodeAttribute :: proxy BVec2 -> [CPUBase BVec2] -> GL AnyArray #

setAttribute :: proxy BVec2 -> GLUInt -> GL () #

GLES => BaseAttribute IVec4 # 

Methods

encodeAttribute :: proxy IVec4 -> [CPUBase IVec4] -> GL AnyArray #

setAttribute :: proxy IVec4 -> GLUInt -> GL () #

GLES => BaseAttribute IVec3 # 

Methods

encodeAttribute :: proxy IVec3 -> [CPUBase IVec3] -> GL AnyArray #

setAttribute :: proxy IVec3 -> GLUInt -> GL () #

GLES => BaseAttribute IVec2 # 

Methods

encodeAttribute :: proxy IVec2 -> [CPUBase IVec2] -> GL AnyArray #

setAttribute :: proxy IVec2 -> GLUInt -> GL () #

GLES => BaseAttribute Vec4 # 

Methods

encodeAttribute :: proxy Vec4 -> [CPUBase Vec4] -> GL AnyArray #

setAttribute :: proxy Vec4 -> GLUInt -> GL () #

GLES => BaseAttribute Vec3 # 

Methods

encodeAttribute :: proxy Vec3 -> [CPUBase Vec3] -> GL AnyArray #

setAttribute :: proxy Vec3 -> GLUInt -> GL () #

GLES => BaseAttribute Vec2 # 

Methods

encodeAttribute :: proxy Vec2 -> [CPUBase Vec2] -> GL AnyArray #

setAttribute :: proxy Vec2 -> GLUInt -> GL () #

GLES => BaseAttribute Int # 

Methods

encodeAttribute :: proxy Int -> [CPUBase Int] -> GL AnyArray #

setAttribute :: proxy Int -> GLUInt -> GL () #

GLES => BaseAttribute Float # 

Methods

encodeAttribute :: proxy Float -> [CPUBase Float] -> GL AnyArray #

setAttribute :: proxy Float -> GLUInt -> GL () #

GLES => BaseAttribute Bool # 

Methods

encodeAttribute :: proxy Bool -> [CPUBase Bool] -> GL AnyArray #

setAttribute :: proxy Bool -> GLUInt -> GL () #

class Generic g => Uniform s g where #

Minimal complete definition

withUniforms

Methods

withUniforms :: Applicative f => proxy s -> g -> CPU s g -> (forall g. BaseUniform g => Int -> Proxy g -> CPUBase g -> f ()) -> f () #

Instances

(BaseUniform (GCPUValue (Rep g)), Generic g) => Uniform (S * *) g # 

Methods

withUniforms :: Applicative f => proxy (S * *) -> g -> CPU (S * *) g -> (forall a. BaseUniform a => Int -> Proxy * a -> CPUBase a -> f ()) -> f () #

(GUniformMirror (Rep g) (Rep (CPUMirror g)) (TData (Rep (CPUMirror g))) (TCons (Rep (CPUMirror g))), Generic g, Generic (CPUMirror g)) => Uniform (M * *) g # 

Methods

withUniforms :: Applicative f => proxy (M * *) -> g -> CPU (M * *) g -> (forall a. BaseUniform a => Int -> Proxy * a -> CPUBase a -> f ()) -> f () #

class Generic g => Attribute s g where #

Minimal complete definition

withAttributes

Methods

withAttributes :: Applicative f => proxy s -> g -> [CPU s g] -> (forall g. BaseAttribute g => Int -> Proxy g -> [CPUBase g] -> f ()) -> f () #

Instances

(BaseAttribute (GCPUValue (Rep g)), Generic g) => Attribute (S * *) g # 

Methods

withAttributes :: Applicative f => proxy (S * *) -> g -> [CPU (S * *) g] -> (forall a. BaseAttribute a => Int -> Proxy * a -> [CPUBase a] -> f ()) -> f () #