Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- tshow :: Show a => a -> Text
- type NextTempVar = Int
- type NextGlobal = Int
- data SType
- stypeName :: SType -> Text
- stypeSize :: SType -> Int
- type ExprM = SNMapReaderT [Text] (StateT ExprState IO)
- type GlobDeclM = Writer Text
- data ExprState = ExprState ShaderInputs !NextTempVar !Builder
- emptyExprState :: ExprState
- data ShaderInputs = ShaderInputs {
- shaderUsedUniformBlocks :: !(IntMap UniformId (GlobDeclM ()))
- shaderUsedSamplers :: !(IntMap SamplerId (GlobDeclM ()))
- shaderUsedInput :: !(IntMap Int (GlobDeclM (), (ExprM (), GlobDeclM ())))
- shaderGeometry :: !(Maybe (GlobDeclM ()))
- emptyShaderInputs :: ShaderInputs
- data ExprResult = ExprResult {}
- runExprM :: GlobDeclM () -> ExprM () -> IO ExprResult
- data ShaderStageInput = ShaderStageInput {
- outputDeclarations :: !(GlobDeclM ())
- expression :: !(ExprM ())
- data ShaderStageOutput = ShaderStageOutput {}
- evaluateExpression :: [ExprM ()] -> ExprM () -> GlobDeclM () -> IO ShaderStageOutput
- newtype S x a = S {}
- scalarS :: SType -> ExprM RValue -> S c a
- vec2S :: SType -> ExprM RValue -> V2 (S c a)
- vec3S :: SType -> ExprM RValue -> V3 (S c a)
- vec4S :: SType -> ExprM RValue -> V4 (S c a)
- scalarS' :: RValue -> S c a
- vec2S' :: RValue -> V2 (S c a)
- vec3S' :: RValue -> V3 (S c a)
- vec4S' :: RValue -> V4 (S c a)
- vec2S'' :: S c a -> V2 (S c a)
- vec3S'' :: S c a -> V3 (S c a)
- vec4S'' :: S c a -> V4 (S c a)
- data V
- data F
- type G = V
- newtype GenerativeGeometry p a = GenerativeGeometry a
- type VFloat = S V Float
- type VInt = S V Int
- type VWord = S V Word
- type VBool = S V Bool
- type GGenerativeGeometry p a = S G (GenerativeGeometry p a)
- type FFloat = S F Float
- type FInt = S F Int
- type FWord = S F Word
- type FBool = S F Bool
- useVInput :: SType -> Int -> ExprM Text
- useGInput :: Text -> SType -> Int -> Int -> ExprM Text -> ExprM Text
- useFInputFromG :: Text -> SType -> Int -> ExprM Text -> ExprM Text
- useFInput :: Text -> Text -> SType -> Int -> ExprM Text -> ExprM Text
- declareGeometryLayout :: Text -> Text -> Int -> ExprM ()
- useUniform :: GlobDeclM () -> UniformId -> Int -> ExprM Text
- useSampler :: Text -> Text -> SamplerId -> ExprM Text
- getNext :: Monad m => StateT ExprState m Int
- type RValue = Text
- tellAssignment :: SType -> ExprM RValue -> ExprM Text
- tellAssignment' :: Text -> RValue -> ExprM ()
- tellST :: Text -> StateT ExprState IO ()
- discard :: FBool -> ExprM ()
- tellGlobalLn :: Text -> GlobDeclM ()
- tellGlobal :: Text -> GlobDeclM ()
- data ShaderBase a x where
- ShaderBaseFloat :: S x Float -> ShaderBase (S x Float) x
- ShaderBaseInt :: S x Int -> ShaderBase (S x Int) x
- ShaderBaseWord :: S x Word -> ShaderBase (S x Word) x
- ShaderBaseBool :: S x Bool -> ShaderBase (S x Bool) x
- ShaderBaseUnit :: ShaderBase () x
- ShaderBaseProd :: ShaderBase a x -> ShaderBase b x -> ShaderBase (a, b) x
- ShaderBaseGenerativeGeometry :: S x (GenerativeGeometry p a) -> ShaderBase (S x (GenerativeGeometry p a)) x
- shaderbaseDeclare :: ShaderBase a x -> WriterT [Text] ExprM (ShaderBase a x)
- shaderbaseAssign :: ShaderBase a x -> StateT [Text] ExprM ()
- shaderbaseReturn :: ShaderBase a x -> ReaderT (ExprM [Text]) (State ExprState) (ShaderBase a x)
- shaderbaseDeclareDef :: SType -> WriterT [Text] ExprM (S x a)
- shaderbaseAssignDef :: S x a -> StateT [Text] ExprM ()
- shaderbaseReturnDef :: ReaderT (ExprM [Text]) (State ExprState) (S x a)
- class ShaderType a x where
- type ShaderBaseType a
- toBase :: x -> a -> ShaderBase (ShaderBaseType a) x
- fromBase :: x -> ShaderBase (ShaderBaseType a) x -> a
- ifThenElse' :: forall a x. ShaderType a x => S x Bool -> a -> a -> a
- ifThenElse :: forall a b x. (ShaderType a x, ShaderType b x) => S x Bool -> (a -> b) -> (a -> b) -> a -> b
- ifThen :: forall a x. ShaderType a x => S x Bool -> (a -> a) -> a -> a
- tellIf :: RValue -> ExprM ()
- while :: forall a x. ShaderType a x => (a -> S x Bool) -> (a -> a) -> a -> a
- errShaderType :: a
- bin :: SType -> Text -> S c x -> S c y -> S c z
- fun1 :: SType -> Text -> S c x -> S c y
- fun2 :: SType -> Text -> S c x -> S c y -> S c z
- fun3 :: SType -> Text -> S c x -> S c y -> S c z -> S c w
- fun4 :: SType -> Text -> S c x -> S c y -> S c z -> S c w -> S c r
- postop :: SType -> Text -> S c x -> S c y
- preop :: SType -> Text -> S c x -> S c y
- binf :: Text -> S c x -> S c y -> S c Float
- fun1f :: Text -> S c x -> S c Float
- fun2f :: Text -> S c x -> S c y -> S c Float
- fun3f :: Text -> S c x -> S c y -> S c z -> S c Float
- preopf :: Text -> S c x -> S c Float
- postopf :: Text -> S c x -> S c Float
- bini :: Text -> S c x -> S c y -> S c Int
- fun1i :: Text -> S c x -> S c Int
- preopi :: Text -> S c x -> S c Int
- binu :: Text -> S c x -> S c y -> S c Word
- fun1u :: Text -> S c x -> S c Word
- preopu :: Text -> S c x -> S c Word
- class Integral' a where
- class Bits' a where
- class Floating a => Real' a where
- class (IfB a, OrdB a, Floating a) => FloatingOrd a where
- clamp :: a -> a -> a -> a
- saturate :: a -> a
- step :: a -> a -> a
- smoothstep :: a -> a -> a -> a
- class Convert a where
- type ConvertFloat a
- type ConvertInt a
- type ConvertWord a
- toFloat :: a -> ConvertFloat a
- toInt :: a -> ConvertInt a
- toWord :: a -> ConvertWord a
- dFdx :: FFloat -> FFloat
- dFdy :: FFloat -> FFloat
- fwidth :: FFloat -> FFloat
- fromV :: Foldable t => (a -> S x b) -> Text -> t a -> S x (t b)
- fromVec4 :: V4 (S x Float) -> S x (V4 Float)
- fromVec3 :: V3 (S x Float) -> S x (V3 Float)
- fromVec2 :: V2 (S x Float) -> S x (V2 Float)
- fromMat22 :: V2 (V2 (S x Float)) -> S x (V2 (V2 Float))
- fromMat23 :: V2 (V3 (S x Float)) -> S x (V2 (V3 Float))
- fromMat24 :: V2 (V4 (S x Float)) -> S x (V2 (V4 Float))
- fromMat32 :: V3 (V2 (S x Float)) -> S x (V3 (V2 Float))
- fromMat33 :: V3 (V3 (S x Float)) -> S x (V3 (V3 Float))
- fromMat34 :: V3 (V4 (S x Float)) -> S x (V3 (V4 Float))
- fromMat42 :: V4 (V2 (S x Float)) -> S x (V4 (V2 Float))
- fromMat43 :: V4 (V3 (S x Float)) -> S x (V4 (V3 Float))
- fromMat44 :: V4 (V4 (S x Float)) -> S x (V4 (V4 Float))
- mulToV4 :: S x (f1 a) -> S x (f2 b) -> V4 (S x Float)
- mulToV3 :: S x (f1 a) -> S x (f2 b) -> V3 (S x Float)
- mulToV2 :: S x (f1 a) -> S x (f2 b) -> V2 (S x Float)
- mulToM :: Functor f => (Int, S c z -> f a) -> (Int, a -> b) -> S c x -> S c y -> f b
- d2 :: Num a => (a, S x b -> V2 (S x b))
- d3 :: Num a => (a, S x b -> V3 (S x b))
- d4 :: Num a => (a, S x b -> V4 (S x b))
- unV1 :: V1 t -> t
- outerToM :: Functor f => (Int, S c z -> f a) -> (Int, a -> b) -> S c x -> S c y -> f b
- length4 :: V4 (S x Float) -> S x Float
- length3 :: V3 (S x Float) -> S x Float
- length2 :: V2 (S x Float) -> S x Float
- normalize4 :: V4 (S x Float) -> V4 (S x Float)
- normalize3 :: V3 (S x Float) -> V3 (S x Float)
- normalize2 :: V2 (S x Float) -> V2 (S x Float)
- dist4 :: V4 (S x Float) -> V4 (S x Float) -> S x Float
- dist3 :: V3 (S x Float) -> V3 (S x Float) -> S x Float
- dist2 :: V2 (S x Float) -> V2 (S x Float) -> S x Float
- crossS :: V3 (S x Float) -> V3 (S x Float) -> V3 (S x Float)
- minS :: S x Float -> S x Float -> S x Float
- maxS :: S x Float -> S x Float -> S x Float
- mul_12_21vv :: V2 (S x Float) -> V2 (S x Float) -> S x Float
- mul_13_31vv :: V3 (S x Float) -> V3 (S x Float) -> S x Float
- mul_14_41vv :: V4 (S x Float) -> V4 (S x Float) -> S x Float
- mul_12_21vm :: V2 (S x Float) -> V2 (V1 (S x Float)) -> V1 (S x Float)
- mul_13_31vm :: V3 (S x Float) -> V3 (V1 (S x Float)) -> V1 (S x Float)
- mul_14_41vm :: V4 (S x Float) -> V4 (V1 (S x Float)) -> V1 (S x Float)
- mul_12_21mv :: V1 (V2 (S x Float)) -> V2 (S x Float) -> V1 (S x Float)
- mul_13_31mv :: V1 (V3 (S x Float)) -> V3 (S x Float) -> V1 (S x Float)
- mul_14_41mv :: V1 (V4 (S x Float)) -> V4 (S x Float) -> V1 (S x Float)
- mul_12_21mm :: V1 (V2 (S x Float)) -> V2 (V1 (S x Float)) -> V1 (V1 (S x Float))
- mul_13_31mm :: V1 (V3 (S x Float)) -> V3 (V1 (S x Float)) -> V1 (V1 (S x Float))
- mul_14_41mm :: V1 (V4 (S x Float)) -> V4 (V1 (S x Float)) -> V1 (V1 (S x Float))
- mul_21_12 :: V2 (S x Float) -> V2 (S x Float) -> V2 (V2 (S x Float))
- mul_21_13 :: V2 (S x Float) -> V3 (S x Float) -> V2 (V3 (S x Float))
- mul_21_14 :: V2 (S x Float) -> V4 (S x Float) -> V2 (V4 (S x Float))
- mul_31_12 :: V3 (S x Float) -> V2 (S x Float) -> V3 (V2 (S x Float))
- mul_31_13 :: V3 (S x Float) -> V3 (S x Float) -> V3 (V3 (S x Float))
- mul_31_14 :: V3 (S x Float) -> V4 (S x Float) -> V3 (V4 (S x Float))
- mul_41_12 :: V4 (S x Float) -> V2 (S x Float) -> V4 (V2 (S x Float))
- mul_41_13 :: V4 (S x Float) -> V3 (S x Float) -> V4 (V3 (S x Float))
- mul_41_14 :: V4 (S x Float) -> V4 (S x Float) -> V4 (V4 (S x Float))
- mul_21_12m :: V2 (V1 (S x Float)) -> V1 (V2 (S x Float)) -> V2 (V2 (S x Float))
- mul_21_13m :: V2 (V1 (S x Float)) -> V1 (V3 (S x Float)) -> V2 (V3 (S x Float))
- mul_21_14m :: V2 (V1 (S x Float)) -> V1 (V4 (S x Float)) -> V2 (V4 (S x Float))
- mul_31_12m :: V3 (V1 (S x Float)) -> V1 (V2 (S x Float)) -> V3 (V2 (S x Float))
- mul_31_13m :: V3 (V1 (S x Float)) -> V1 (V3 (S x Float)) -> V3 (V3 (S x Float))
- mul_31_14m :: V3 (V1 (S x Float)) -> V1 (V4 (S x Float)) -> V3 (V4 (S x Float))
- mul_41_12m :: V4 (V1 (S x Float)) -> V1 (V2 (S x Float)) -> V4 (V2 (S x Float))
- mul_41_13m :: V4 (V1 (S x Float)) -> V1 (V3 (S x Float)) -> V4 (V3 (S x Float))
- mul_41_14m :: V4 (V1 (S x Float)) -> V1 (V4 (S x Float)) -> V4 (V4 (S x Float))
- mul_12_22 :: V2 (S x Float) -> V2 (V2 (S x Float)) -> V2 (S x Float)
- mul_13_32 :: V3 (S x Float) -> V3 (V2 (S x Float)) -> V2 (S x Float)
- mul_14_42 :: V4 (S x Float) -> V4 (V2 (S x Float)) -> V2 (S x Float)
- mul_12_23 :: V2 (S x Float) -> V2 (V3 (S x Float)) -> V3 (S x Float)
- mul_13_33 :: V3 (S x Float) -> V3 (V3 (S x Float)) -> V3 (S x Float)
- mul_14_43 :: V4 (S x Float) -> V4 (V3 (S x Float)) -> V3 (S x Float)
- mul_12_24 :: V2 (S x Float) -> V2 (V4 (S x Float)) -> V4 (S x Float)
- mul_13_34 :: V3 (S x Float) -> V3 (V4 (S x Float)) -> V4 (S x Float)
- mul_14_44 :: V4 (S x Float) -> V4 (V4 (S x Float)) -> V4 (S x Float)
- mul_12_22m :: V1 (V2 (S x Float)) -> V2 (V2 (S x Float)) -> V1 (V2 (S x Float))
- mul_13_32m :: V1 (V3 (S x Float)) -> V3 (V2 (S x Float)) -> V1 (V2 (S x Float))
- mul_14_42m :: V1 (V4 (S x Float)) -> V4 (V2 (S x Float)) -> V1 (V2 (S x Float))
- mul_12_23m :: V1 (V2 (S x Float)) -> V2 (V3 (S x Float)) -> V1 (V3 (S x Float))
- mul_13_33m :: V1 (V3 (S x Float)) -> V3 (V3 (S x Float)) -> V1 (V3 (S x Float))
- mul_14_43m :: V1 (V4 (S x Float)) -> V4 (V3 (S x Float)) -> V1 (V3 (S x Float))
- mul_12_24m :: V1 (V2 (S x Float)) -> V2 (V4 (S x Float)) -> V1 (V4 (S x Float))
- mul_13_34m :: V1 (V3 (S x Float)) -> V3 (V4 (S x Float)) -> V1 (V4 (S x Float))
- mul_14_44m :: V1 (V4 (S x Float)) -> V4 (V4 (S x Float)) -> V1 (V4 (S x Float))
- mul_22_21 :: V2 (V2 (S x Float)) -> V2 (S x Float) -> V2 (S x Float)
- mul_23_31 :: V2 (V3 (S x Float)) -> V3 (S x Float) -> V2 (S x Float)
- mul_24_41 :: V2 (V4 (S x Float)) -> V4 (S x Float) -> V2 (S x Float)
- mul_32_21 :: V3 (V2 (S x Float)) -> V2 (S x Float) -> V3 (S x Float)
- mul_33_31 :: V3 (V3 (S x Float)) -> V3 (S x Float) -> V3 (S x Float)
- mul_34_41 :: V3 (V4 (S x Float)) -> V4 (S x Float) -> V3 (S x Float)
- mul_42_21 :: V4 (V2 (S x Float)) -> V2 (S x Float) -> V4 (S x Float)
- mul_43_31 :: V4 (V3 (S x Float)) -> V3 (S x Float) -> V4 (S x Float)
- mul_44_41 :: V4 (V4 (S x Float)) -> V4 (S x Float) -> V4 (S x Float)
- mul_22_21m :: V2 (V2 (S x Float)) -> V2 (V1 (S x Float)) -> V2 (V1 (S x Float))
- mul_23_31m :: V2 (V3 (S x Float)) -> V3 (V1 (S x Float)) -> V2 (V1 (S x Float))
- mul_24_41m :: V2 (V4 (S x Float)) -> V4 (V1 (S x Float)) -> V2 (V1 (S x Float))
- mul_32_21m :: V3 (V2 (S x Float)) -> V2 (V1 (S x Float)) -> V3 (V1 (S x Float))
- mul_33_31m :: V3 (V3 (S x Float)) -> V3 (V1 (S x Float)) -> V3 (V1 (S x Float))
- mul_34_41m :: V3 (V4 (S x Float)) -> V4 (V1 (S x Float)) -> V3 (V1 (S x Float))
- mul_42_21m :: V4 (V2 (S x Float)) -> V2 (V1 (S x Float)) -> V4 (V1 (S x Float))
- mul_43_31m :: V4 (V3 (S x Float)) -> V3 (V1 (S x Float)) -> V4 (V1 (S x Float))
- mul_44_41m :: V4 (V4 (S x Float)) -> V4 (V1 (S x Float)) -> V4 (V1 (S x Float))
- mul_22_22 :: V2 (V2 (S x Float)) -> V2 (V2 (S x Float)) -> V2 (V2 (S x Float))
- mul_23_32 :: V2 (V3 (S x Float)) -> V3 (V2 (S x Float)) -> V2 (V2 (S x Float))
- mul_24_42 :: V2 (V4 (S x Float)) -> V4 (V2 (S x Float)) -> V2 (V2 (S x Float))
- mul_22_23 :: V2 (V2 (S x Float)) -> V2 (V3 (S x Float)) -> V2 (V3 (S x Float))
- mul_23_33 :: V2 (V3 (S x Float)) -> V3 (V3 (S x Float)) -> V2 (V3 (S x Float))
- mul_24_43 :: V2 (V4 (S x Float)) -> V4 (V3 (S x Float)) -> V2 (V3 (S x Float))
- mul_22_24 :: V2 (V2 (S x Float)) -> V2 (V4 (S x Float)) -> V2 (V4 (S x Float))
- mul_23_34 :: V2 (V3 (S x Float)) -> V3 (V4 (S x Float)) -> V2 (V4 (S x Float))
- mul_24_44 :: V2 (V4 (S x Float)) -> V4 (V4 (S x Float)) -> V2 (V4 (S x Float))
- mul_32_22 :: V3 (V2 (S x Float)) -> V2 (V2 (S x Float)) -> V3 (V2 (S x Float))
- mul_33_32 :: V3 (V3 (S x Float)) -> V3 (V2 (S x Float)) -> V3 (V2 (S x Float))
- mul_34_42 :: V3 (V4 (S x Float)) -> V4 (V2 (S x Float)) -> V3 (V2 (S x Float))
- mul_32_23 :: V3 (V2 (S x Float)) -> V2 (V3 (S x Float)) -> V3 (V3 (S x Float))
- mul_33_33 :: V3 (V3 (S x Float)) -> V3 (V3 (S x Float)) -> V3 (V3 (S x Float))
- mul_34_43 :: V3 (V4 (S x Float)) -> V4 (V3 (S x Float)) -> V3 (V3 (S x Float))
- mul_32_24 :: V3 (V2 (S x Float)) -> V2 (V4 (S x Float)) -> V3 (V4 (S x Float))
- mul_33_34 :: V3 (V3 (S x Float)) -> V3 (V4 (S x Float)) -> V3 (V4 (S x Float))
- mul_34_44 :: V3 (V4 (S x Float)) -> V4 (V4 (S x Float)) -> V3 (V4 (S x Float))
- mul_42_22 :: V4 (V2 (S x Float)) -> V2 (V2 (S x Float)) -> V4 (V2 (S x Float))
- mul_43_32 :: V4 (V3 (S x Float)) -> V3 (V2 (S x Float)) -> V4 (V2 (S x Float))
- mul_44_42 :: V4 (V4 (S x Float)) -> V4 (V2 (S x Float)) -> V4 (V2 (S x Float))
- mul_42_23 :: V4 (V2 (S x Float)) -> V2 (V3 (S x Float)) -> V4 (V3 (S x Float))
- mul_43_33 :: V4 (V3 (S x Float)) -> V3 (V3 (S x Float)) -> V4 (V3 (S x Float))
- mul_44_43 :: V4 (V4 (S x Float)) -> V4 (V3 (S x Float)) -> V4 (V3 (S x Float))
- mul_42_24 :: V4 (V2 (S x Float)) -> V2 (V4 (S x Float)) -> V4 (V4 (S x Float))
- mul_43_34 :: V4 (V3 (S x Float)) -> V3 (V4 (S x Float)) -> V4 (V4 (S x Float))
- mul_44_44 :: V4 (V4 (S x Float)) -> V4 (V4 (S x Float)) -> V4 (V4 (S x Float))
Documentation
type NextTempVar = Int Source #
type NextGlobal = Int Source #
data ShaderInputs Source #
ShaderInputs | |
|
data ExprResult Source #
ExprResult | |
|
data ShaderStageInput Source #
ShaderStageInput | |
|
data ShaderStageOutput Source #
ShaderStageOutput | |
|
evaluateExpression :: [ExprM ()] -> ExprM () -> GlobDeclM () -> IO ShaderStageOutput Source #
Instances
Instances
We reuse V for geometry shader, which simplify things and makes sense save the GenerativeGeometry…
newtype GenerativeGeometry p a Source #
Instances
IfB (S x (GenerativeGeometry p b)) Source # | |
Defined in Graphics.GPipe.Internal.Expr ifB :: bool ~ BooleanOf (S x (GenerativeGeometry p b)) => bool -> S x (GenerativeGeometry p b) -> S x (GenerativeGeometry p b) -> S x (GenerativeGeometry p b) # | |
ShaderType (S x (GenerativeGeometry p a)) x Source # | |
Defined in Graphics.GPipe.Internal.Expr type ShaderBaseType (S x (GenerativeGeometry p a)) Source # toBase :: x -> S x (GenerativeGeometry p a) -> ShaderBase (ShaderBaseType (S x (GenerativeGeometry p a))) x Source # fromBase :: x -> ShaderBase (ShaderBaseType (S x (GenerativeGeometry p a))) x -> S x (GenerativeGeometry p a) Source # | |
type ShaderBaseType (S x (GenerativeGeometry p a)) Source # | |
Defined in Graphics.GPipe.Internal.Expr |
type GGenerativeGeometry p a = S G (GenerativeGeometry p a) Source #
tellGlobalLn :: Text -> GlobDeclM () Source #
tellGlobal :: Text -> GlobDeclM () Source #
data ShaderBase a x where Source #
An opaque type
ShaderBaseFloat :: S x Float -> ShaderBase (S x Float) x | |
ShaderBaseInt :: S x Int -> ShaderBase (S x Int) x | |
ShaderBaseWord :: S x Word -> ShaderBase (S x Word) x | |
ShaderBaseBool :: S x Bool -> ShaderBase (S x Bool) x | |
ShaderBaseUnit :: ShaderBase () x | |
ShaderBaseProd :: ShaderBase a x -> ShaderBase b x -> ShaderBase (a, b) x | |
ShaderBaseGenerativeGeometry :: S x (GenerativeGeometry p a) -> ShaderBase (S x (GenerativeGeometry p a)) x |
shaderbaseDeclare :: ShaderBase a x -> WriterT [Text] ExprM (ShaderBase a x) Source #
shaderbaseAssign :: ShaderBase a x -> StateT [Text] ExprM () Source #
shaderbaseReturn :: ShaderBase a x -> ReaderT (ExprM [Text]) (State ExprState) (ShaderBase a x) Source #
class ShaderType a x where Source #
Constraint for types that may pass in and out of shader control structures. Define your own instances in terms of others and make sure to make toBase as lazy as possible.
type ShaderBaseType a Source #
A base type that this type can convert into. Use the ShaderBaseType
function on an existing instance of ShaderType
to define this in your instance.
toBase :: x -> a -> ShaderBase (ShaderBaseType a) x Source #
Convert this type to the shader base type. Make sure this is as lazy as possible (e.g. use tilde (~
) on each pattern match).
fromBase :: x -> ShaderBase (ShaderBaseType a) x -> a Source #
Convert back from the shader base type to this type.
Instances
ifThenElse' :: forall a x. ShaderType a x => S x Bool -> a -> a -> a Source #
ifThenElse :: forall a b x. (ShaderType a x, ShaderType b x) => S x Bool -> (a -> b) -> (a -> b) -> a -> b Source #
ifThenElse c f g x
will return f x
if c
evaluates to true
or g x
otherwise.
In most cases functionally equivalent to ifThenElse'
but
usually generate smaller shader code since the last argument is not inlined into the two branches, which also would affect implicit derivates (e.g. dFdx
, dFdy
or sampling using SampleAuto
)
ifThen :: forall a x. ShaderType a x => S x Bool -> (a -> a) -> a -> a Source #
ifThen c f x
will return f x
if c
evaluates to true
or x
otherwise.
In most cases functionally equivalent to ifThenElse'
but
usually generate smaller shader code since the last argument is not inlined into the two branches, which also would affect implicit derivates (e.g. dFdx
, dFdy
or sampling using SampleAuto
)
while :: forall a x. ShaderType a x => (a -> S x Bool) -> (a -> a) -> a -> a Source #
while f g x
will iteratively transform x
with g
as long as f
generates true
.
errShaderType :: a Source #
class Integral' a where Source #
Instances
Integral' Int Source # | |
Integral' Int8 Source # | |
Integral' Int16 Source # | |
Integral' Int32 Source # | |
Integral' Word Source # | |
Integral' Word8 Source # | |
Integral' Word16 Source # | |
Integral' Word32 Source # | |
Integral' a => Integral' (V0 a) Source # | |
Integral' a => Integral' (V4 a) Source # | |
Integral' a => Integral' (V3 a) Source # | |
Integral' a => Integral' (V2 a) Source # | |
Integral' a => Integral' (V1 a) Source # | |
Integral' (S x Word) Source # | |
Integral' (S x Int) Source # | |
Instances
Bits' (S x Word) Source # | |
Defined in Graphics.GPipe.Internal.Expr | |
Bits' (S x Int) Source # | |
Defined in Graphics.GPipe.Internal.Expr |
class Floating a => Real' a where Source #
This class provides the GPU functions either not found in Prelude's numerical classes, or that has wrong types.
Instances are also provided for normal Float
s and Double
s.
Instances
Real' Double Source # | |
Defined in Graphics.GPipe.Internal.Expr rsqrt :: Double -> Double Source # exp2 :: Double -> Double Source # log2 :: Double -> Double Source # floor' :: Double -> Double Source # ceiling' :: Double -> Double Source # fract' :: Double -> Double Source # mod'' :: Double -> Double -> Double Source # | |
Real' Float Source # | |
Defined in Graphics.GPipe.Internal.Expr | |
Real' a => Real' (V0 a) Source # | |
Real' a => Real' (V4 a) Source # | |
Real' a => Real' (V3 a) Source # | |
Real' a => Real' (V2 a) Source # | |
Real' a => Real' (V1 a) Source # | |
Real' (S x Float) Source # | |
Defined in Graphics.GPipe.Internal.Expr rsqrt :: S x Float -> S x Float Source # exp2 :: S x Float -> S x Float Source # log2 :: S x Float -> S x Float Source # floor' :: S x Float -> S x Float Source # ceiling' :: S x Float -> S x Float Source # fract' :: S x Float -> S x Float Source # mod'' :: S x Float -> S x Float -> S x Float Source # mix :: S x Float -> S x Float -> S x Float -> S x Float Source # |
class (IfB a, OrdB a, Floating a) => FloatingOrd a where Source #
This class provides various order comparing functions
Nothing
Instances
class Convert a where Source #
Provides a common way to convert numeric types to integer and floating point representations.
toFloat :: a -> ConvertFloat a Source #
Convert to a floating point number.
toInt :: a -> ConvertInt a Source #
Convert to an integral number, using truncation if necessary.
toWord :: a -> ConvertWord a Source #
Convert to an unsigned integral number, using truncation if necessary.
Instances
Convert Float Source # | |
Defined in Graphics.GPipe.Internal.Expr | |
Convert Int Source # | |
Defined in Graphics.GPipe.Internal.Expr | |
Convert Word Source # | |
Defined in Graphics.GPipe.Internal.Expr | |
Convert (S x Word) Source # | |
Defined in Graphics.GPipe.Internal.Expr type ConvertFloat (S x Word) Source # type ConvertInt (S x Word) Source # type ConvertWord (S x Word) Source # | |
Convert (S x Int) Source # | |
Convert (S x Float) Source # | |
Defined in Graphics.GPipe.Internal.Expr type ConvertFloat (S x Float) Source # type ConvertInt (S x Float) Source # type ConvertWord (S x Float) Source # |
dFdx :: FFloat -> FFloat Source #
The derivative in x using local differencing of the rasterized value.
dFdy :: FFloat -> FFloat Source #
The derivative in y using local differencing of the rasterized value.