packages feed

GPipe 2.2.3 → 2.2.4

raw patch · 7 files changed

+16/−10 lines, 7 filesdep ~basedep ~containersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, containers

API changes (from Hackage documentation)

+ Graphics.GPipe.Buffer: -- normal Haskell world)
+ Graphics.GPipe.Buffer: -- | The type a value of this format has when it lives on the host (i.e.
+ Graphics.GPipe.Context: -- and event processing policies
+ Graphics.GPipe.Context: -- decoration
+ Graphics.GPipe.Context: -- | Implementation specific window parameters, eg initial size and border
+ Graphics.GPipe.Expr: -- <a>ShaderBaseType</a> function on an existing instance of
+ Graphics.GPipe.Expr: -- <a>ShaderType</a> to define this in your instance.
+ Graphics.GPipe.Expr: -- | A base type that this type can convert into. Use the
+ Graphics.GPipe.FragmentStream: -- fragment value.
+ Graphics.GPipe.FragmentStream: -- | The type the vertex value will be turned into once it becomes a
+ Graphics.GPipe.PrimitiveArray: type family IndexFormat a
+ Graphics.GPipe.PrimitiveStream: -- value.
+ Graphics.GPipe.PrimitiveStream: -- | The type the buffer value will be turned into once it becomes a vertex
+ Graphics.GPipe.Uniform: -- <a>F</a>).
+ Graphics.GPipe.Uniform: -- or fragment value (the <tt>x</tt> parameter is either <a>V</a> or
+ Graphics.GPipe.Uniform: -- | The type the buffer value will be turned into once it becomes a vertex
- Graphics.GPipe.Buffer: class BufferFormat f where type HostFormat f getGlType = error "This is only defined for BufferColor types" peekPixel = error "This is only defined for BufferColor types" getGlPaddedFormat = error "This is only defined for BufferColor types" where {
+ Graphics.GPipe.Buffer: class BufferFormat f where {
- Graphics.GPipe.Buffer: type family HostFormat f;
+ Graphics.GPipe.Buffer: type family BufferColor c h
- Graphics.GPipe.Context: class ContextHandler ctx where data ContextHandlerParameters ctx type ContextWindow ctx type WindowParameters ctx where {
+ Graphics.GPipe.Context: class ContextHandler ctx where {
- Graphics.GPipe.Expr: class Convert a where type ConvertFloat a type ConvertInt a type ConvertWord a where {
+ Graphics.GPipe.Expr: class Convert a where {
- Graphics.GPipe.Expr: class (IfB a, OrdB a, Floating a) => FloatingOrd a where clamp x a = minB (maxB x a) saturate x = clamp x 0 1 step a x = ifB (x <* a) 0 1 smoothstep a b x = let t = saturate ((x - a) / (b - a)) in t * t * (3 - 2 * t)
+ Graphics.GPipe.Expr: class (IfB a, OrdB a, Floating a) => FloatingOrd a
- Graphics.GPipe.Expr: class Floating a => Real' a where rsqrt = (1 /) . sqrt exp2 = (2 **) log2 = logBase 2 mix x y a = x * (1 - a) + y * a fract' x = x - floor' x mod'' x y = x - y * floor' (x / y) floor' x = - ceiling' (- x) ceiling' x = - floor' (- x)
+ Graphics.GPipe.Expr: class Floating a => Real' a
- Graphics.GPipe.Expr: class ShaderType a x where type ShaderBaseType a where {
+ Graphics.GPipe.Expr: class ShaderType a x where {
- Graphics.GPipe.Expr: ifThen :: forall a x. (ShaderType a x) => S x Bool -> (a -> a) -> a -> a
+ Graphics.GPipe.Expr: ifThen :: forall a x. ShaderType a x => S x Bool -> (a -> a) -> a -> a
- Graphics.GPipe.Expr: ifThenElse' :: forall a x. (ShaderType a x) => S x Bool -> a -> a -> a
+ Graphics.GPipe.Expr: ifThenElse' :: forall a x. ShaderType a x => S x Bool -> a -> a -> a
- Graphics.GPipe.Expr: while :: forall a x. (ShaderType a x) => (a -> S x Bool) -> (a -> a) -> a -> a
+ Graphics.GPipe.Expr: while :: forall a x. ShaderType a x => (a -> S x Bool) -> (a -> a) -> a -> a
- Graphics.GPipe.Format: class ColorSampleable c => ColorRenderable c where isSrgb _ = False clearColor = error "You cannot create your own instances of ColorRenderable"
+ Graphics.GPipe.Format: class ColorSampleable c => ColorRenderable c
- Graphics.GPipe.Format: class TextureFormat f => ColorSampleable f where type Color f a type ColorElement f :: * typeStr = error "You cannot create your own instances of ColorSampleable" typeStr4 = error "You cannot create your own instances of ColorSampleable" toColor = error "You cannot create your own instances of ColorSampleable" fromColor = error "You cannot create your own instances of ColorSampleable" setBorderColor = error "You cannot create your own instances of ColorSampleable" samplerPrefix _ = "" where {
+ Graphics.GPipe.Format: class TextureFormat f => ColorSampleable f where {
- Graphics.GPipe.Format: class ColorRenderable c => ContextColorFormat c where redBits = error "You cannot create your own instances of ContextColorFormat" greenBits = error "You cannot create your own instances of ContextColorFormat" blueBits = error "You cannot create your own instances of ContextColorFormat" alphaBits = error "You cannot create your own instances of ContextColorFormat"
+ Graphics.GPipe.Format: class ColorRenderable c => ContextColorFormat c
- Graphics.GPipe.Format: class TextureFormat f where getGlFormat = error "You cannot create your own instances of TextureFormat"
+ Graphics.GPipe.Format: class TextureFormat f
- Graphics.GPipe.FragmentStream: class FragmentInput a where type FragmentFormat a where {
+ Graphics.GPipe.FragmentStream: class FragmentInput a where {
- Graphics.GPipe.FrameBuffer: ContextColorOption :: Blending -> (ColorMask f) -> ContextColorOption f
+ Graphics.GPipe.FrameBuffer: ContextColorOption :: Blending -> ColorMask f -> ContextColorOption f
- Graphics.GPipe.PrimitiveStream: class VertexInput a where type VertexFormat a where {
+ Graphics.GPipe.PrimitiveStream: class VertexInput a where {
- Graphics.GPipe.Sampler: [SamplerFilter] :: (ColorElement c ~ Float) => MagFilter -> MinFilter -> LodFilter -> Anisotropy -> SamplerFilter c
+ Graphics.GPipe.Sampler: [SamplerFilter] :: ColorElement c ~ Float => MagFilter -> MinFilter -> LodFilter -> Anisotropy -> SamplerFilter c
- Graphics.GPipe.Uniform: class BufferFormat a => UniformInput a where type UniformFormat a x where {
+ Graphics.GPipe.Uniform: class BufferFormat a => UniformInput a where {
- Graphics.GPipe.Uniform: getUniform :: forall os f s b x. (UniformInput b) => (s -> (Buffer os (Uniform b), Int)) -> Shader os s (UniformFormat b x)
+ Graphics.GPipe.Uniform: getUniform :: forall os f s b x. UniformInput b => (s -> (Buffer os (Uniform b), Int)) -> Shader os s (UniformFormat b x)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+### 2.2.4
+
+- Support for GHC 8.6.5 (#63)
+
 ### 2.2.3
 
 - Removing an unnecessary optimization that was broken since 2.2
GPipe.cabal view
@@ -1,5 +1,5 @@ name:           GPipe
-version:        2.2.3
+version:        2.2.4
 cabal-version:  >= 1.8
 build-type:     Simple
 author:         Tobias Bexelius
@@ -21,10 +21,10 @@ 
 library
   hs-source-dirs:   src
-  build-depends:    base >= 4.9 && < 4.11,
+  build-depends:    base >= 4.9 && < 5,
                     transformers >= 0.5.2 && < 0.6,
                     exception-transformers >= 0.3 && < 0.5,
-                    containers >= 0.5 && < 0.6,
+                    containers >= 0.5 && < 0.7,
                     Boolean >= 0.2 && <0.3,
                     hashtables >= 1.2 && < 1.3,
                     gl >= 0.8 && < 0.9,
src/Graphics/GPipe/Internal/Expr.hs view
@@ -267,9 +267,9 @@                                return $ S $ return root
 
 shaderbaseAssignDef  (S shaderM) = do ul <- T.lift shaderM
-                                      x:xs <- get
-                                      put xs
-                                      T.lift $ tellAssignment' x ul
+                                      xs <- get
+                                      put $ tail xs
+                                      T.lift $ tellAssignment' (head xs) ul
                                       return ()
 shaderbaseReturnDef :: ReaderT (ExprM [String]) (State Int) (S x a)
 shaderbaseReturnDef = do i <- T.lift getNext
src/Graphics/GPipe/Internal/FragmentStream.hs view
@@ -33,7 +33,7 @@ 
 -- | A @'FragmentStream' a @ is a stream of fragments of type @a@. You may append 'FragmentStream's using the 'Monoid' instance, and you
 --   can operate a stream's values using the 'Functor' instance (this will result in a shader running on the GPU).
-newtype FragmentStream a = FragmentStream [(a, FragmentStreamData)] deriving Monoid
+newtype FragmentStream a = FragmentStream [(a, FragmentStreamData)] deriving (Semigroup, Monoid)
 
 instance Functor FragmentStream where
         fmap f (FragmentStream xs) = FragmentStream $ map (first f) xs
src/Graphics/GPipe/Internal/PrimitiveArray.hs view
@@ -139,9 +139,11 @@ -- | An array of primitives
 newtype PrimitiveArray p a = PrimitiveArray {getPrimitiveArray :: [PrimitiveArrayInt p a]}
 
+instance Semigroup (PrimitiveArray p a) where
+    PrimitiveArray a <> PrimitiveArray b = PrimitiveArray (a ++ b)
+
 instance Monoid (PrimitiveArray p a) where
     mempty = PrimitiveArray []
-    mappend (PrimitiveArray a) (PrimitiveArray b) = PrimitiveArray (a ++ b)
 
 instance Functor (PrimitiveArray p) where
     fmap f (PrimitiveArray xs) = PrimitiveArray  $ fmap g xs
src/Graphics/GPipe/Internal/PrimitiveStream.hs view
@@ -46,7 +46,7 @@ --   can operate a stream's vertex values using the 'Functor' instance (this will result in a shader running on the GPU).
 --   You may also append 'PrimitiveStream's using the 'Monoid' instance, but if possible append the origin 'PrimitiveArray's instead, as this will create more optimized
 --   draw calls.
-newtype PrimitiveStream t a = PrimitiveStream [(a, (Maybe PointSize, PrimitiveStreamData))] deriving Monoid
+newtype PrimitiveStream t a = PrimitiveStream [(a, (Maybe PointSize, PrimitiveStreamData))] deriving (Semigroup, Monoid)
 
 instance Functor (PrimitiveStream t) where
         fmap f (PrimitiveStream xs) = PrimitiveStream $ map (first f) xs
src/Graphics/GPipe/Internal/Texture.hs view
@@ -1134,7 +1134,7 @@ fetchFunc s off coord lod vToS civToS = do
     c <- vToS coord
     l <- unS lod
-    return $ "fetch" ++ offName off ++ '(' : s ++ ',' : c ++ ',': l ++ o ++ ")"
+    return $ "texelFetch" ++ offName off ++ '(' : s ++ ',' : c ++ ',': l ++ o ++ ")"
   where
     o = offParam off civToS