diff options
Diffstat (limited to 'lc/Builtins.lc')
-rw-r--r-- | lc/Builtins.lc | 27 |
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 | -} |
298 | type family FragOps' a where | 298 | type 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 |
306 | x:xs ++ ys = x : xs ++ ys | 306 | x:xs ++ ys = x : xs ++ ys |
@@ -407,11 +407,12 @@ rasterize | |||
407 | 407 | ||
408 | rasterizePrimitives ctx is s = concat (map (rasterize is ctx) s) | 408 | rasterizePrimitives ctx is s = concat (map (rasterize is ctx) s) |
409 | 409 | ||
410 | data Image :: Nat -> Type -> Type where | 410 | data Image :: Nat -> Type -> Type |
411 | ColorImage :: forall a d t color . (Num t, color ~ VecScalar d t) | 411 | |
412 | => color -> Image a (Color color) | 412 | ColorImage :: 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) | 414 | DepthImage :: forall a . Float -> Image a (Depth Float) |
415 | StencilImage :: forall a . Int -> Image a (Stencil Int) | ||
415 | 416 | ||
416 | type family SameLayerCounts a where | 417 | type 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 | -} |
430 | data FrameBuffer (n :: Nat) b where | 431 | data FrameBuffer (n :: Nat) t |
431 | Accumulate :: FragOps' b -> FragmentStream n (RemSemantics b) -> FrameBuffer n b -> FrameBuffer n b | 432 | Accumulate :: FragOps b -> FragmentStream n (RemSemantics b) -> FrameBuffer n b -> FrameBuffer n b |
432 | 433 | ||
433 | type family TFFrameBuffer a where | 434 | type family TFFrameBuffer a where |
434 | TFFrameBuffer (Image n1 t1) = FrameBuffer n1 t1 | 435 | TFFrameBuffer (Image n1 t1) = FrameBuffer n1 t1 |