summaryrefslogtreecommitdiff
path: root/lc
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-02-05 16:35:12 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-02-05 17:55:41 +0100
commite19b4e7051066ce8bff0e4b3c51b06e1169d4fb1 (patch)
tree0c4a2078c30f2faf7ee83ed4a78d4028cc34e6c1 /lc
parentae0343e3053c5d8b9301f4f43b35a7a4f9c05dcf (diff)
refactor Builtins.lc
Diffstat (limited to 'lc')
-rw-r--r--lc/Builtins.lc27
1 files changed, 14 insertions, 13 deletions
diff --git a/lc/Builtins.lc b/lc/Builtins.lc
index a8b9e98b..80a818eb 100644
--- a/lc/Builtins.lc
+++ b/lc/Builtins.lc
@@ -295,12 +295,12 @@ type family FragOps a where
295 FragOps (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4) = (t1, t2, t3, t4) 295 FragOps (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4) = (t1, t2, t3, t4)
296 FragOps (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4, FragmentOperation t5) = (t1, t2, t3, t4, t5) 296 FragOps (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4, FragmentOperation t5) = (t1, t2, t3, t4, t5)
297-} 297-}
298type family FragOps' a where 298type family FragOps a where
299 FragOps' (t1, t2) = (FragmentOperation t1, FragmentOperation t2) 299 FragOps (t1, t2) = (FragmentOperation t1, FragmentOperation t2)
300 FragOps' (t1, t2, t3) = (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3) 300 FragOps (t1, t2, t3) = (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3)
301 FragOps' (t1, t2, t3, t4) = (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4) 301 FragOps (t1, t2, t3, t4) = (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4)
302 FragOps' (t1, t2, t3, t4, t5) = (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4, FragmentOperation t5) 302 FragOps (t1, t2, t3, t4, t5) = (FragmentOperation t1, FragmentOperation t2, FragmentOperation t3, FragmentOperation t4, FragmentOperation t5)
303 FragOps' t = (FragmentOperation t) 303 FragOps t = (FragmentOperation t)
304 304
305[] ++ ys = ys 305[] ++ ys = ys
306x:xs ++ ys = x : xs ++ ys 306x:xs ++ ys = x : xs ++ ys
@@ -407,11 +407,12 @@ rasterize
407 407
408rasterizePrimitives ctx is s = concat (map (rasterize is ctx) s) 408rasterizePrimitives ctx is s = concat (map (rasterize is ctx) s)
409 409
410data Image :: Nat -> Type -> Type where 410data Image :: Nat -> Type -> Type
411 ColorImage :: forall a d t color . (Num t, color ~ VecScalar d t) 411
412 => color -> Image a (Color color) 412ColorImage :: forall a d t color . (Num t, color ~ VecScalar d t)
413 DepthImage :: forall a . Float -> Image a (Depth Float) 413 => color -> Image a (Color color)
414 StencilImage :: forall a . Int -> Image a (Stencil Int) 414DepthImage :: forall a . Float -> Image a (Depth Float)
415StencilImage :: forall a . Int -> Image a (Stencil Int)
415 416
416type family SameLayerCounts a where 417type family SameLayerCounts a where
417 SameLayerCounts (Image n1 t1) = Unit 418 SameLayerCounts (Image n1 t1) = Unit
@@ -427,8 +428,8 @@ instance (DefaultFragOp a, DefaultFragOp b) => DefaultFragOps (FragmentOperation
427 defaultFragOps = -- (undefined @(), undefined) 428 defaultFragOps = -- (undefined @(), undefined)
428 (defaultFragOp @a @_, defaultFragOp @b @_) 429 (defaultFragOp @a @_, defaultFragOp @b @_)
429-} 430-}
430data FrameBuffer (n :: Nat) b where 431data FrameBuffer (n :: Nat) t
431 Accumulate :: FragOps' b -> FragmentStream n (RemSemantics b) -> FrameBuffer n b -> FrameBuffer n b 432Accumulate :: FragOps b -> FragmentStream n (RemSemantics b) -> FrameBuffer n b -> FrameBuffer n b
432 433
433type family TFFrameBuffer a where 434type family TFFrameBuffer a where
434 TFFrameBuffer (Image n1 t1) = FrameBuffer n1 t1 435 TFFrameBuffer (Image n1 t1) = FrameBuffer n1 t1