lambdacube-edsl-0.2.0: LambdaCube 3D EDSL definition

Safe HaskellNone
LanguageHaskell2010

LambdaCube.Language.HOAS

Documentation

data Exp :: Frequency -> * -> * where Source

Constructors

Tag :: GPU t => Int -> String -> Exp stage t 
Shr :: N -> Exp stage t 
Let :: (GPU a, GPU b) => Exp stage a -> (Exp stage a -> Exp stage b) -> Exp stage b 
Var :: GPU t => Dynamic -> 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 -> Exp Obj (Texture dim arr t ar) -> Exp stage (Sampler dim arr t ar) 
TextureSlot :: IsValidTextureSlot t => ByteString -> TextureType dim mip arr layerCount t ar -> Exp Obj (Texture dim arr t ar) 
Texture :: (IsScalar (TexSizeRepr dim), IsMipValid canMip mip) => TextureType dim canMip arr layerCount t ar -> TexSizeRepr dim -> MipMap mip -> [Exp Obj (Image layerCount (TexDataRepr ar t))] -> Exp Obj (Texture 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, KnownNat 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 * k 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 k t, IsVecScalar * k d a t) => OperatorShift (Exp stage a) (Exp stage Word32) 
(GPU a, GPU b, IsIntegral k t, IsVecScalar * k 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 k t, IsVecScalar * k 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) a Source

data VertexOut clipDistances t where Source

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 where Source

Constructors

GeometryShader :: (GPU j, GPU i, GPU b, GPU outputClipDistances, GPU input, KnownNat 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 where Source

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 where Source

Constructors

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

data GPOutput o where Source