lambdacube-core-0.1.0: LambdaCube 3D is a domain specific language and library that makes it possible to program GPUs in a purely functional style.

Safe HaskellNone

LC_T_HOAS

Documentation

data Exp whereSource

Constructors

Tag :: GPU t => Int -> String -> Exp stage t 
Const :: (GPU t, IsScalar t) => t -> Exp stage t 
PrimVar :: GPU t => Input t -> Exp stage t 
Uni :: GPU t => Input t -> Exp stage t 
Cond :: GPU t => Exp stage Bool -> Exp stage t -> Exp stage t -> Exp stage t 
PrimApp :: (GPU a, GPU r) => PrimFun stage (a -> r) -> Exp stage a -> Exp stage r 
Tup :: (GPU t, IsTuple t) => Tuple (Exp stage) (TupleRepr t) -> Exp stage t 
Prj :: (GPU e, GPU t, IsTuple t) => TupleIdx (TupleRepr t) e -> Exp stage t -> Exp stage e 
Sampler :: GPU (Sampler dim arr t ar) => Filter -> EdgeMode -> Texture (Exp Obj) dim arr t ar -> Exp stage (Sampler dim arr t ar) 
Loop :: (GPU s, GPU a) => (Exp stage s -> Exp stage s) -> (Exp stage s -> Exp stage Bool) -> (Exp stage s -> Exp stage a) -> Exp stage s -> Exp stage a 
Fetch :: (InputTuple a, SGPU (InputTupleRepr a)) => ByteString -> FetchPrimitive primitive -> a -> Exp Obj (VertexStream primitive (InputTupleRepr a)) 
Transform :: (GPU a, GPU b) => (Exp V a -> VertexOut clipDistances b) -> Exp Obj (VertexStream primitive a) -> Exp Obj (PrimitiveStream primitive clipDistances 1 V b) 
Reassemble :: GeometryShader inputPrimitive outputPrimitive inputClipDistances outputClipDistances layerCount a b -> Exp Obj (PrimitiveStream inputPrimitive inputClipDistances 1 V a) -> Exp Obj (PrimitiveStream outputPrimitive outputClipDistances layerCount G b) 
Rasterize :: RasterContext primitive -> Exp Obj (PrimitiveStream primitive clipDistances layerCount freq a) -> Exp Obj (FragmentStream layerCount a) 
FrameBuffer :: FrameBuffer layerCount t -> Exp Obj (FrameBuffer layerCount (FTRepr' t)) 
Accumulate :: (GPU a, GPU (FTRepr' b), IsValidOutput b) => AccumulationContext b -> FragmentFilter a -> (Exp F a -> FragmentOut (NoStencilRepr b)) -> Exp Obj (FragmentStream layerCount a) -> Exp Obj (FrameBuffer layerCount (FTRepr' b)) -> Exp Obj (FrameBuffer layerCount (FTRepr' b)) 
PrjFrameBuffer :: ByteString -> TupleIdx (EltRepr b) t -> Exp Obj (FrameBuffer layerCount b) -> Exp Obj (Image layerCount t) 
PrjImage :: ((idx + 1) <= layerCount, 2 <= layerCount, SingI idx) => ByteString -> NatNum idx -> Exp Obj (Image layerCount t) -> Exp Obj (Image 1 t) 

Instances

(GPU a, IsVecScalar d a Float) => BuiltinStep (Exp stage a) (Exp stage Float) 
BuiltinStep (Exp stage V4F) (Exp stage V4F) 
BuiltinStep (Exp stage V3F) (Exp stage V3F) 
BuiltinStep (Exp stage V2F) (Exp stage V2F) 
(GPU a, GPU b, IsVecScalar d a Float, IsVecScalar d b Bool) => BuiltinMix (Exp stage a) (Exp stage b) 
(GPU a, IsVecScalar d a Float) => BuiltinMix (Exp stage a) (Exp stage Float) 
(GPU a, IsVecScalar d a Float) => BuiltinMix (Exp stage a) (Exp stage a) 
(GPU a, GPU t, IsNum t, IsVecScalar d a t) => BuiltinCommon (Exp stage a) (Exp stage t) 
(GPU a, IsNum t, IsVecScalar d a t) => BuiltinCommon (Exp stage a) (Exp stage a) 
(GPU a, GPU b, IsNum t, IsVecScalar d a t, IsVecScalar d b Bool) => OperatorRelational (Exp stage a) (Exp stage b) 
(GPU a, IsMatVecScalar a t) => OperatorEq (Exp stage a) (Exp stage Bool) 
(GPU a, GPU b, IsNum t, IsVecScalar d a t, IsVecScalar d b Bool) => OperatorEq (Exp stage a) (Exp stage b) 
(GPU a, IsIntegral t, IsVecScalar d a t) => OperatorShift (Exp stage a) (Exp stage Word32) 
(GPU a, GPU b, IsIntegral t, IsVecScalar d a t, IsVecScalar d b Word32) => OperatorShift (Exp stage a) (Exp stage b) 
(GPU a, GPU t, IsIntegral t, IsVecScalar d a t) => OperatorBit (Exp stage a) (Exp stage t) 
(GPU a, IsIntegral t, IsVecScalar d a t) => OperatorBit (Exp stage a) (Exp stage a) 
(GPU a, GPU t, IsNum t, IsVecScalar d a t) => OperatorDivide (Exp stage a) (Exp stage t) 
(GPU a, IsNum t, IsVecScalar d a t) => OperatorDivide (Exp stage a) (Exp stage a) 
(GPU a, GPU t, IsNum t, IsMatVecScalar a t) => OperatorArithmetic (Exp stage a) (Exp stage t) 
(GPU c, GPU (V4 t), IsNumComponent t, IsMatVecScalar (V4 t) c, IsNum c) => OperatorArithmetic (Exp stage (V4 t)) (Exp stage c) 
(GPU c, GPU (V3 t), IsNumComponent t, IsMatVecScalar (V3 t) c, IsNum c) => OperatorArithmetic (Exp stage (V3 t)) (Exp stage c) 
(GPU c, GPU (V2 t), IsNumComponent t, IsMatVecScalar (V2 t) c, IsNum c) => OperatorArithmetic (Exp stage (V2 t)) (Exp stage c) 
(GPU (V4 t), IsNumComponent t, IsMatVec (V4 t) c, IsNum c) => OperatorArithmetic (Exp stage (V4 t)) (Exp stage (V4 t)) 
(GPU (V3 t), IsNumComponent t, IsMatVec (V3 t) c, IsNum c) => OperatorArithmetic (Exp stage (V3 t)) (Exp stage (V3 t)) 
(GPU (V2 t), IsNumComponent t, IsMatVec (V2 t) c, IsNum c) => OperatorArithmetic (Exp stage (V2 t)) (Exp stage (V2 t)) 

type FlatExp stage a = FlatTuple GPU (Exp stage) aSource

data VertexOut clipDistances t whereSource

Constructors

VertexOut :: IsFloatTuple clipDistances => Exp V V4F -> Exp V Float -> FlatExp V clipDistances -> InterpolatedFlatExp V a -> VertexOut (FTRepr clipDistances) (FTRepr a) 

data GeometryShader inPrimitive outPrimitive inClipDistances outClipDistances layerCount a b whereSource

Constructors

GeometryShader :: (GPU j, GPU i, GPU b, GPU outputClipDistances, GPU input, SingI layerCount, inputVertex ~ (V4F, Float, inputClipDistances, a), input ~ PrimitiveVertices inputPrimitive inputVertex) => NatNum layerCount -> OutputPrimitive outputPrimitive -> Int -> (Exp G input -> Exp G (i, Int32)) -> (Exp G i -> Exp G (Int32, Int32, i, j, Int32)) -> (Exp G j -> GeometryOut j outputClipDistances b) -> GeometryShader inputPrimitive outputPrimitive inputClipDistances outputClipDistances layerCount a b 

data GeometryOut i clipDistances t whereSource

Constructors

GeometryOut :: IsFloatTuple clipDistances => Exp G i -> Exp G V4F -> Exp G Float -> FlatExp G clipDistances -> InterpolatedFlatExp G a -> GeometryOut i (FTRepr clipDistances) (FTRepr a) 

data FragmentFilter a whereSource

Constructors

PassAll :: FragmentFilter a 
Filter :: (Exp F a -> Exp F Bool) -> FragmentFilter a