summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--lc/Prelude.lc5
-rw-r--r--testdata/Prelude.out415
-rw-r--r--testdata/editor-examples/LambdaCube2.out71
-rw-r--r--testdata/editor-examples/RecLC.lc1
-rw-r--r--testdata/editor-examples/RecLC.out69
6 files changed, 364 insertions, 199 deletions
diff --git a/Makefile b/Makefile
index d390efff..44cd956a 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
2all: 2all:
3 cabal install 3 cabal install
4 4
5LCDIR=~/.cabal/share/x86_64-linux-ghc-7.10.2/lambdacube-compiler-0.5.0.0/lc 5LCDIR=~/.cabal/share/x86_64-linux-ghc-7.10.3/lambdacube-compiler-0.5.0.0/lc
6 6
7repl: 7repl:
8 cd test && ghci -Wall -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-missing-signatures -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns -fno-warn-type-defaults -i../src -i../dist/build/autogen runTests.hs 8 cd test && ghci -Wall -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-missing-signatures -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns -fno-warn-type-defaults -i../src -i../dist/build/autogen runTests.hs
diff --git a/lc/Prelude.lc b/lc/Prelude.lc
index ce9ad9af..66060066 100644
--- a/lc/Prelude.lc
+++ b/lc/Prelude.lc
@@ -360,7 +360,10 @@ translateBefore4 :: Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float
360translateBefore4 v p4 = M44F r1 r2 r3 (ext0 u + r4) 360translateBefore4 v p4 = M44F r1 r2 r3 (ext0 u + r4)
361 where 361 where
362 ext0 a = V4 a%x a%y a%z 0 362 ext0 a = V4 a%x a%y a%z 0
363 (M44F r1 r2 r3 r4) = p4 363 r1 = p4 *. V4 1 0 0 0
364 r2 = p4 *. V4 0 1 0 0
365 r3 = p4 *. V4 0 0 1 0
366 r4 = p4 *. V4 0 0 0 1
364 u = v .* M33F r1%xyz r2%xyz r3%xyz 367 u = v .* M33F r1%xyz r2%xyz r3%xyz
365 368
366-- | Camera transformation matrix. 369-- | Camera transformation matrix.
diff --git a/testdata/Prelude.out b/testdata/Prelude.out
index c719a451..c6fa4e14 100644
--- a/testdata/Prelude.out
+++ b/testdata/Prelude.out
@@ -1414,17 +1414,17 @@ testdata/Prelude.lc 360:25-360:32 Vec 4 Float -> Vec 4 Float -> Vec 4 Float ->
1414testdata/Prelude.lc 360:25-360:35 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float 1414testdata/Prelude.lc 360:25-360:35 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float
1415testdata/Prelude.lc 360:25-360:38 Vec 4 Float -> Mat 4 4 Float 1415testdata/Prelude.lc 360:25-360:38 Vec 4 Float -> Mat 4 4 Float
1416testdata/Prelude.lc 360:25-360:52 Mat 4 4 Float 1416testdata/Prelude.lc 360:25-360:52 Mat 4 4 Float
1417testdata/Prelude.lc 360:25-364:38 Mat 4 4 Float -> Mat 4 4 Float | Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float 1417testdata/Prelude.lc 360:25-367:38 Mat 4 4 Float -> Mat 4 4 Float | Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float
1418testdata/Prelude.lc 360:30-360:32 VecS Float 4 1418testdata/Prelude.lc 360:30-360:32 Vec 4 Float
1419testdata/Prelude.lc 360:33-360:35 VecS Float 4 1419testdata/Prelude.lc 360:33-360:35 Vec 4 Float
1420testdata/Prelude.lc 360:36-360:38 VecS Float 4 1420testdata/Prelude.lc 360:36-360:38 Vec 4 Float
1421testdata/Prelude.lc 360:40-360:44 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 1421testdata/Prelude.lc 360:40-360:44 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4
1422testdata/Prelude.lc 360:40-360:46 VecS Float 4 1422testdata/Prelude.lc 360:40-360:46 VecS Float 4
1423testdata/Prelude.lc 360:40-360:48 VecS Float 4 -> VecS Float 4 1423testdata/Prelude.lc 360:40-360:48 VecS Float 4 -> VecS Float 4
1424testdata/Prelude.lc 360:40-360:51 VecS Float 4 1424testdata/Prelude.lc 360:40-360:51 VecS Float 4
1425testdata/Prelude.lc 360:45-360:46 Vec 3 Float 1425testdata/Prelude.lc 360:45-360:46 Vec 3 Float
1426testdata/Prelude.lc 360:47-360:48 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a 1426testdata/Prelude.lc 360:47-360:48 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a
1427testdata/Prelude.lc 360:49-360:51 VecS Float 4 1427testdata/Prelude.lc 360:49-360:51 Vec 4 Float
1428testdata/Prelude.lc 362:13-362:15 {a} -> a -> a -> a -> a -> VecS a 4 1428testdata/Prelude.lc 362:13-362:15 {a} -> a -> a -> a -> a -> VecS a 4
1429testdata/Prelude.lc 362:13-362:19 V1 -> V2 -> V3 -> VecS V4 4 1429testdata/Prelude.lc 362:13-362:19 V1 -> V2 -> V3 -> VecS V4 4
1430testdata/Prelude.lc 362:13-362:23 V1 -> V2 -> VecS V3 4 1430testdata/Prelude.lc 362:13-362:23 V1 -> V2 -> VecS V3 4
@@ -1437,187 +1437,228 @@ testdata/Prelude.lc 362:20-362:23 V1
1437testdata/Prelude.lc 362:24-362:25 VecS V3 V2 1437testdata/Prelude.lc 362:24-362:25 VecS V3 V2
1438testdata/Prelude.lc 362:24-362:27 V1 1438testdata/Prelude.lc 362:24-362:27 V1
1439testdata/Prelude.lc 362:28-362:29 V1 1439testdata/Prelude.lc 362:28-362:29 V1
1440testdata/Prelude.lc 363:5-363:9 V4 1440testdata/Prelude.lc 363:9-363:11 Mat 4 4 Float
1441testdata/Prelude.lc 363:5-363:12 VecS Float 4 1441testdata/Prelude.lc 363:9-363:14 VecS Float 4 -> Vec 4 Float
1442testdata/Prelude.lc 363:5-363:15 VecS Float 4 1442testdata/Prelude.lc 363:9-363:25 Vec 4 Float
1443testdata/Prelude.lc 363:5-363:18 VecS Float 4 1443testdata/Prelude.lc 363:12-363:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c
1444testdata/Prelude.lc 363:5-363:21 VecS Float 4 1444testdata/Prelude.lc 363:15-363:17 {a} -> a -> a -> a -> a -> VecS a 4
1445testdata/Prelude.lc 363:10-363:12 Vec 4 Float | Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 1445testdata/Prelude.lc 363:15-363:19 V1 -> V2 -> V3 -> VecS V4 4
1446testdata/Prelude.lc 363:10-363:21 Mat 4 4 Float 1446testdata/Prelude.lc 363:15-363:21 V2 -> V3 -> VecS V4 4
1447testdata/Prelude.lc 363:13-363:15 Vec 4 Float | Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 1447testdata/Prelude.lc 363:15-363:23 V2 -> VecS V3 4
1448testdata/Prelude.lc 363:16-363:18 Vec 4 Float | Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 1448testdata/Prelude.lc 363:15-363:25 VecS Float 4
1449testdata/Prelude.lc 363:19-363:21 Vec 4 Float | Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 | Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> V4 1449testdata/Prelude.lc 363:18-363:19 V1
1450testdata/Prelude.lc 363:25-363:27 Mat 4 4 Float 1450testdata/Prelude.lc 363:20-363:21 V1
1451testdata/Prelude.lc 364:8-364:9 Vec 3 Float 1451testdata/Prelude.lc 363:22-363:23 V1
1452testdata/Prelude.lc 364:8-364:12 Mat 3 V0 Float -> Vec V1 Float 1452testdata/Prelude.lc 363:24-363:25 V1
1453testdata/Prelude.lc 364:8-364:38 Vec 3 Float 1453testdata/Prelude.lc 364:9-364:11 Mat 4 4 Float
1454testdata/Prelude.lc 364:10-364:12 {a:Nat} -> {b} -> {c:Nat} -> VecS b a -> Mat a c b -> Vec c b 1454testdata/Prelude.lc 364:9-364:14 VecS Float 4 -> Vec 4 Float
1455testdata/Prelude.lc 364:13-364:17 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float 1455testdata/Prelude.lc 364:9-364:25 Vec 4 Float
1456testdata/Prelude.lc 364:13-364:24 Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float 1456testdata/Prelude.lc 364:12-364:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c
1457testdata/Prelude.lc 364:13-364:31 Vec 3 Float -> Mat 3 3 Float 1457testdata/Prelude.lc 364:15-364:17 {a} -> a -> a -> a -> a -> VecS a 4
1458testdata/Prelude.lc 364:13-364:38 Mat 3 3 Float 1458testdata/Prelude.lc 364:15-364:19 V1 -> V2 -> V3 -> VecS V4 4
1459testdata/Prelude.lc 364:18-364:20 VecS Float 4 1459testdata/Prelude.lc 364:15-364:21 V2 -> V3 -> VecS V4 4
1460testdata/Prelude.lc 364:18-364:24 VecS Float 3 1460testdata/Prelude.lc 364:15-364:23 V2 -> VecS V3 4
1461testdata/Prelude.lc 364:25-364:27 VecS Float 4 1461testdata/Prelude.lc 364:15-364:25 VecS Float 4
1462testdata/Prelude.lc 364:25-364:31 VecS Float 3 1462testdata/Prelude.lc 364:18-364:19 V1
1463testdata/Prelude.lc 364:32-364:34 VecS Float 4 1463testdata/Prelude.lc 364:20-364:21 V1
1464testdata/Prelude.lc 364:32-364:38 VecS Float 3 1464testdata/Prelude.lc 364:22-364:23 V1
1465testdata/Prelude.lc 367:11-367:14 Nat -> Type->Type 1465testdata/Prelude.lc 364:24-364:25 V1
1466testdata/Prelude.lc 367:11-367:16 Type->Type 1466testdata/Prelude.lc 365:9-365:11 Mat 4 4 Float
1467testdata/Prelude.lc 367:11-367:22 Type 1467testdata/Prelude.lc 365:9-365:14 VecS Float 4 -> Vec 4 Float
1468testdata/Prelude.lc 367:15-367:16 V1 1468testdata/Prelude.lc 365:9-365:25 Vec 4 Float
1469testdata/Prelude.lc 367:17-367:22 Type 1469testdata/Prelude.lc 365:12-365:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c
1470testdata/Prelude.lc 368:11-368:14 Nat -> Type->Type 1470testdata/Prelude.lc 365:15-365:17 {a} -> a -> a -> a -> a -> VecS a 4
1471testdata/Prelude.lc 368:11-368:16 Type->Type 1471testdata/Prelude.lc 365:15-365:19 V1 -> V2 -> V3 -> VecS V4 4
1472testdata/Prelude.lc 368:11-368:22 Type 1472testdata/Prelude.lc 365:15-365:21 V2 -> V3 -> VecS V4 4
1473testdata/Prelude.lc 368:11-370:24 Type 1473testdata/Prelude.lc 365:15-365:23 V2 -> VecS V3 4
1474testdata/Prelude.lc 368:15-368:16 V1 1474testdata/Prelude.lc 365:15-365:25 VecS Float 4
1475testdata/Prelude.lc 368:17-368:22 Type 1475testdata/Prelude.lc 365:18-365:19 V1
1476testdata/Prelude.lc 369:11-369:14 Nat -> Type->Type 1476testdata/Prelude.lc 365:20-365:21 V1
1477testdata/Prelude.lc 369:11-369:16 Type->Type 1477testdata/Prelude.lc 365:22-365:23 V1
1478testdata/Prelude.lc 369:11-369:22 Type 1478testdata/Prelude.lc 365:24-365:25 V1
1479testdata/Prelude.lc 369:11-370:24 Type 1479testdata/Prelude.lc 366:9-366:11 Mat 4 4 Float
1480testdata/Prelude.lc 369:15-369:16 V1 1480testdata/Prelude.lc 366:9-366:14 VecS Float 4 -> Vec 4 Float
1481testdata/Prelude.lc 369:17-369:22 Type 1481testdata/Prelude.lc 366:9-366:25 Vec 4 Float
1482testdata/Prelude.lc 370:11-370:14 Nat -> Nat -> Type->Type 1482testdata/Prelude.lc 366:12-366:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c
1483testdata/Prelude.lc 370:11-370:16 Nat -> Type->Type 1483testdata/Prelude.lc 366:15-366:17 {a} -> a -> a -> a -> a -> VecS a 4
1484testdata/Prelude.lc 370:11-370:18 Type->Type 1484testdata/Prelude.lc 366:15-366:19 V1 -> V2 -> V3 -> VecS V4 4
1485testdata/Prelude.lc 370:11-370:24 Type 1485testdata/Prelude.lc 366:15-366:21 V2 -> V3 -> VecS V4 4
1486testdata/Prelude.lc 366:15-366:23 V2 -> VecS V3 4
1487testdata/Prelude.lc 366:15-366:25 VecS Float 4
1488testdata/Prelude.lc 366:18-366:19 V1
1489testdata/Prelude.lc 366:20-366:21 V1
1490testdata/Prelude.lc 366:22-366:23 V1
1491testdata/Prelude.lc 366:24-366:25 V1
1492testdata/Prelude.lc 367:8-367:9 Vec 3 Float
1493testdata/Prelude.lc 367:8-367:12 Mat 3 V0 Float -> Vec V1 Float
1494testdata/Prelude.lc 367:8-367:38 Vec 3 Float
1495testdata/Prelude.lc 367:10-367:12 {a:Nat} -> {b} -> {c:Nat} -> VecS b a -> Mat a c b -> Vec c b
1496testdata/Prelude.lc 367:13-367:17 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float
1497testdata/Prelude.lc 367:13-367:24 Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float
1498testdata/Prelude.lc 367:13-367:31 Vec 3 Float -> Mat 3 3 Float
1499testdata/Prelude.lc 367:13-367:38 Mat 3 3 Float
1500testdata/Prelude.lc 367:18-367:20 Vec 4 Float
1501testdata/Prelude.lc 367:18-367:24 VecS Float 3
1502testdata/Prelude.lc 367:25-367:27 Vec 4 Float
1503testdata/Prelude.lc 367:25-367:31 VecS Float 3
1504testdata/Prelude.lc 367:32-367:34 Vec 4 Float
1505testdata/Prelude.lc 367:32-367:38 VecS Float 3
1506testdata/Prelude.lc 370:11-370:14 Nat -> Type->Type
1507testdata/Prelude.lc 370:11-370:16 Type->Type
1508testdata/Prelude.lc 370:11-370:22 Type
1486testdata/Prelude.lc 370:15-370:16 V1 1509testdata/Prelude.lc 370:15-370:16 V1
1487testdata/Prelude.lc 370:17-370:18 V1 1510testdata/Prelude.lc 370:17-370:22 Type
1488testdata/Prelude.lc 370:19-370:24 Type 1511testdata/Prelude.lc 371:11-371:14 Nat -> Type->Type
1489testdata/Prelude.lc 371:1-371:7 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float 1512testdata/Prelude.lc 371:11-371:16 Type->Type
1490testdata/Prelude.lc 371:24-371:40 Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float 1513testdata/Prelude.lc 371:11-371:22 Type
1491testdata/Prelude.lc 371:24-371:50 Mat 4 4 Float -> Mat 4 4 Float 1514testdata/Prelude.lc 371:11-373:24 Type
1492testdata/Prelude.lc 371:24-371:52 Mat 4 4 Float 1515testdata/Prelude.lc 371:15-371:16 V1
1493testdata/Prelude.lc 371:24-377:65 Vec 3 Float -> Mat 4 4 Float | Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float | Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float 1516testdata/Prelude.lc 371:17-371:22 Type
1494testdata/Prelude.lc 371:42-371:45 {a} -> {b : Signed (MatVecScalarElem a)} -> a->a 1517testdata/Prelude.lc 372:11-372:14 Nat -> Type->Type
1495testdata/Prelude.lc 371:42-371:49 VecS Float 3 1518testdata/Prelude.lc 372:11-372:16 Type->Type
1496testdata/Prelude.lc 371:46-371:49 Vec 3 Float 1519testdata/Prelude.lc 372:11-372:22 Type
1497testdata/Prelude.lc 371:51-371:52 Mat 4 4 Float 1520testdata/Prelude.lc 372:11-373:24 Type
1498testdata/Prelude.lc 373:14-373:16 {a} -> a -> a -> a -> a -> VecS a 4 1521testdata/Prelude.lc 372:15-372:16 V1
1499testdata/Prelude.lc 373:14-373:20 V1 -> V2 -> V3 -> VecS V4 4 1522testdata/Prelude.lc 372:17-372:22 Type
1500testdata/Prelude.lc 373:14-373:24 V1 -> V2 -> VecS V3 4 1523testdata/Prelude.lc 373:11-373:14 Nat -> Nat -> Type->Type
1501testdata/Prelude.lc 373:14-373:28 V1 -> VecS V2 4 1524testdata/Prelude.lc 373:11-373:16 Nat -> Type->Type
1502testdata/Prelude.lc 373:14-373:30 VecS V2 4 1525testdata/Prelude.lc 373:11-373:18 Type->Type
1503testdata/Prelude.lc 373:17-373:18 V4 1526testdata/Prelude.lc 373:11-373:24 Type
1504testdata/Prelude.lc 373:17-373:20 V1 1527testdata/Prelude.lc 373:15-373:16 V1
1505testdata/Prelude.lc 373:21-373:22 VecS V3 V2 1528testdata/Prelude.lc 373:17-373:18 V1
1506testdata/Prelude.lc 373:21-373:24 V1 1529testdata/Prelude.lc 373:19-373:24 Type
1507testdata/Prelude.lc 373:25-373:26 VecS V3 V2 1530testdata/Prelude.lc 374:1-374:7 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float
1508testdata/Prelude.lc 373:25-373:28 V1 1531testdata/Prelude.lc 374:24-374:40 Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float
1509testdata/Prelude.lc 373:29-373:30 V1 1532testdata/Prelude.lc 374:24-374:50 Mat 4 4 Float -> Mat 4 4 Float
1510testdata/Prelude.lc 374:9-374:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a 1533testdata/Prelude.lc 374:24-374:52 Mat 4 4 Float
1511testdata/Prelude.lc 374:9-374:20 VecScalar V0 Float -> VecScalar V1 Float 1534testdata/Prelude.lc 374:24-380:65 Vec 3 Float -> Mat 4 4 Float | Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float | Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float
1512testdata/Prelude.lc 374:9-374:33 VecScalar 3 Float 1535testdata/Prelude.lc 374:42-374:45 {a} -> {b : Signed (MatVecScalarElem a)} -> a->a
1513testdata/Prelude.lc 374:19-374:20 {a} -> {b} -> a->b -> a->b 1536testdata/Prelude.lc 374:42-374:49 VecS Float 3
1514testdata/Prelude.lc 374:21-374:24 Vec 3 Float 1537testdata/Prelude.lc 374:46-374:49 Vec 3 Float
1515testdata/Prelude.lc 374:21-374:26 VecS Float 3 -> VecS Float 3 1538testdata/Prelude.lc 374:51-374:52 Mat 4 4 Float
1516testdata/Prelude.lc 374:21-374:33 VecS Float 3 1539testdata/Prelude.lc 376:14-376:16 {a} -> a -> a -> a -> a -> VecS a 4
1517testdata/Prelude.lc 374:25-374:26 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a 1540testdata/Prelude.lc 376:14-376:20 V1 -> V2 -> V3 -> VecS V4 4
1518testdata/Prelude.lc 374:27-374:33 Vec 3 Float 1541testdata/Prelude.lc 376:14-376:24 V1 -> V2 -> VecS V3 4
1519testdata/Prelude.lc 375:9-375:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a 1542testdata/Prelude.lc 376:14-376:28 V1 -> VecS V2 4
1520testdata/Prelude.lc 375:9-375:20 VecScalar V0 Float -> VecScalar V1 Float 1543testdata/Prelude.lc 376:14-376:30 VecS V2 4
1521testdata/Prelude.lc 375:9-375:33 VecScalar 3 Float 1544testdata/Prelude.lc 376:17-376:18 V4
1522testdata/Prelude.lc 375:19-375:20 {a} -> {b} -> a->b -> a->b 1545testdata/Prelude.lc 376:17-376:20 V1
1523testdata/Prelude.lc 375:21-375:23 Vec 3 Float 1546testdata/Prelude.lc 376:21-376:22 VecS V3 V2
1524testdata/Prelude.lc 375:21-375:31 VecS Float 3 -> VecS Float 3 1547testdata/Prelude.lc 376:21-376:24 V1
1525testdata/Prelude.lc 375:21-375:33 VecS Float 3 1548testdata/Prelude.lc 376:25-376:26 VecS V3 V2
1526testdata/Prelude.lc 375:24-375:31 {a} -> {b : a ~ VecS Float 3} -> a -> a->a 1549testdata/Prelude.lc 376:25-376:28 V1
1527testdata/Prelude.lc 375:32-375:33 VecScalar 3 Float 1550testdata/Prelude.lc 376:29-376:30 V1
1528testdata/Prelude.lc 376:9-376:10 VecScalar 3 Float 1551testdata/Prelude.lc 377:9-377:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a
1529testdata/Prelude.lc 376:9-376:18 VecS Float 3 -> VecS Float 3 1552testdata/Prelude.lc 377:9-377:20 VecScalar V0 Float -> VecScalar V1 Float
1530testdata/Prelude.lc 376:9-376:20 VecS Float 3 1553testdata/Prelude.lc 377:9-377:33 VecScalar 3 Float
1531testdata/Prelude.lc 376:11-376:18 {a} -> {b : a ~ VecS Float 3} -> a -> a->a
1532testdata/Prelude.lc 376:19-376:20 VecScalar 3 Float
1533testdata/Prelude.lc 377:9-377:18 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> Mat b a c
1534testdata/Prelude.lc 377:9-377:20 Mat V2 V1 V0 -> Mat V2 V3 V1
1535testdata/Prelude.lc 377:9-377:65 Mat 4 4 Float
1536testdata/Prelude.lc 377:19-377:20 {a} -> {b} -> a->b -> a->b 1554testdata/Prelude.lc 377:19-377:20 {a} -> {b} -> a->b -> a->b
1537testdata/Prelude.lc 377:21-377:25 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float 1555testdata/Prelude.lc 377:21-377:24 Vec 3 Float
1538testdata/Prelude.lc 377:21-377:34 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float 1556testdata/Prelude.lc 377:21-377:26 VecS Float 3 -> VecS Float 3
1539testdata/Prelude.lc 377:21-377:43 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float 1557testdata/Prelude.lc 377:21-377:33 VecS Float 3
1540testdata/Prelude.lc 377:21-377:52 Vec 4 Float -> Mat 4 4 Float 1558testdata/Prelude.lc 377:25-377:26 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a
1541testdata/Prelude.lc 377:21-377:65 Mat 4 4 Float 1559testdata/Prelude.lc 377:27-377:33 Vec 3 Float
1542testdata/Prelude.lc 377:27-377:31 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 1560testdata/Prelude.lc 378:9-378:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a
1543testdata/Prelude.lc 377:27-377:33 VecS Float 4 1561testdata/Prelude.lc 378:9-378:20 VecScalar V0 Float -> VecScalar V1 Float
1544testdata/Prelude.lc 377:32-377:33 VecScalar 3 Float 1562testdata/Prelude.lc 378:9-378:33 VecScalar 3 Float
1545testdata/Prelude.lc 377:36-377:40 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 1563testdata/Prelude.lc 378:19-378:20 {a} -> {b} -> a->b -> a->b
1546testdata/Prelude.lc 377:36-377:42 VecS Float 4 1564testdata/Prelude.lc 378:21-378:23 Vec 3 Float
1547testdata/Prelude.lc 377:41-377:42 VecS Float 3 1565testdata/Prelude.lc 378:21-378:31 VecS Float 3 -> VecS Float 3
1548testdata/Prelude.lc 377:45-377:49 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 1566testdata/Prelude.lc 378:21-378:33 VecS Float 3
1549testdata/Prelude.lc 377:45-377:51 VecS Float 4 1567testdata/Prelude.lc 378:24-378:31 {a} -> {b : a ~ VecS Float 3} -> a -> a->a
1550testdata/Prelude.lc 377:50-377:51 VecScalar 3 Float 1568testdata/Prelude.lc 378:32-378:33 VecScalar 3 Float
1551testdata/Prelude.lc 377:54-377:56 {a} -> a -> a -> a -> a -> VecS a 4 1569testdata/Prelude.lc 379:9-379:10 VecScalar 3 Float
1552testdata/Prelude.lc 377:54-377:58 V1 -> V2 -> V3 -> VecS V4 4 1570testdata/Prelude.lc 379:9-379:18 VecS Float 3 -> VecS Float 3
1553testdata/Prelude.lc 377:54-377:60 V2 -> V3 -> VecS V4 4 1571testdata/Prelude.lc 379:9-379:20 VecS Float 3
1554testdata/Prelude.lc 377:54-377:62 V2 -> VecS V3 4 1572testdata/Prelude.lc 379:11-379:18 {a} -> {b : a ~ VecS Float 3} -> a -> a->a
1555testdata/Prelude.lc 377:54-377:64 VecS Float 4 1573testdata/Prelude.lc 379:19-379:20 VecScalar 3 Float
1556testdata/Prelude.lc 377:57-377:58 V1 1574testdata/Prelude.lc 380:9-380:18 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> Mat b a c
1557testdata/Prelude.lc 377:59-377:60 V1 1575testdata/Prelude.lc 380:9-380:20 Mat V2 V1 V0 -> Mat V2 V3 V1
1558testdata/Prelude.lc 377:61-377:62 V1 1576testdata/Prelude.lc 380:9-380:65 Mat 4 4 Float
1559testdata/Prelude.lc 377:63-377:64 V1 1577testdata/Prelude.lc 380:19-380:20 {a} -> {b} -> a->b -> a->b
1560testdata/Prelude.lc 380:1-380:6 Float -> VecS Float 4 -> VecS Float 4 1578testdata/Prelude.lc 380:21-380:25 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float
1561testdata/Prelude.lc 380:13-380:14 V3 1579testdata/Prelude.lc 380:21-380:34 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float
1562testdata/Prelude.lc 380:13-380:16 V2->V3 1580testdata/Prelude.lc 380:21-380:43 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float
1563testdata/Prelude.lc 380:13-380:29 VecS Float 4 1581testdata/Prelude.lc 380:21-380:52 Vec 4 Float -> Mat 4 4 Float
1564testdata/Prelude.lc 380:15-380:16 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a 1582testdata/Prelude.lc 380:21-380:65 Mat 4 4 Float
1565testdata/Prelude.lc 380:17-380:19 {a} -> a -> a -> a -> a -> VecS a 4 1583testdata/Prelude.lc 380:27-380:31 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4
1566testdata/Prelude.lc 380:17-380:21 V4 -> V5 -> V6 -> VecS V7 4 1584testdata/Prelude.lc 380:27-380:33 VecS Float 4
1567testdata/Prelude.lc 380:17-380:23 V4 -> V5 -> VecS V6 4 1585testdata/Prelude.lc 380:32-380:33 VecScalar 3 Float
1568testdata/Prelude.lc 380:17-380:25 V4 -> VecS V5 4 1586testdata/Prelude.lc 380:36-380:40 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4
1569testdata/Prelude.lc 380:17-380:29 VecS Float 4 1587testdata/Prelude.lc 380:36-380:42 VecS Float 4
1570testdata/Prelude.lc 380:20-380:21 V5 1588testdata/Prelude.lc 380:41-380:42 VecS Float 3
1571testdata/Prelude.lc 380:22-380:23 V4 1589testdata/Prelude.lc 380:45-380:49 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4
1572testdata/Prelude.lc 380:24-380:25 V4 1590testdata/Prelude.lc 380:45-380:51 VecS Float 4
1573testdata/Prelude.lc 380:26-380:29 Float 1591testdata/Prelude.lc 380:50-380:51 VecScalar 3 Float
1574testdata/Prelude.lc 382:11-382:16 Type 1592testdata/Prelude.lc 380:54-380:56 {a} -> a -> a -> a -> a -> VecS a 4
1575testdata/Prelude.lc 382:11-385:38 Float -> Float -> List Float | V0->V1 1593testdata/Prelude.lc 380:54-380:58 V1 -> V2 -> V3 -> VecS V4 4
1576testdata/Prelude.lc 382:20-382:25 Type 1594testdata/Prelude.lc 380:54-380:60 V2 -> V3 -> VecS V4 4
1577testdata/Prelude.lc 382:20-382:36 Type 1595testdata/Prelude.lc 380:54-380:62 V2 -> VecS V3 4
1578testdata/Prelude.lc 382:29-382:36 Type 1596testdata/Prelude.lc 380:54-380:64 VecS Float 4
1579testdata/Prelude.lc 382:30-382:35 Type 1597testdata/Prelude.lc 380:57-380:58 V1
1580testdata/Prelude.lc 383:1-383:7 Float -> Float -> List Float 1598testdata/Prelude.lc 380:59-380:60 V1
1581testdata/Prelude.lc 384:7-384:8 Float 1599testdata/Prelude.lc 380:61-380:62 V1
1582testdata/Prelude.lc 384:7-384:10 VecScalar 1 Float -> VecScalar 1 Bool 1600testdata/Prelude.lc 380:63-380:64 V1
1583testdata/Prelude.lc 384:7-384:12 VecScalar 1 Bool 1601testdata/Prelude.lc 383:1-383:6 Float -> VecS Float 4 -> VecS Float 4
1584testdata/Prelude.lc 384:7-385:38 Float -> Float -> List Float | Float -> List Float | List Float 1602testdata/Prelude.lc 383:13-383:14 V3
1585testdata/Prelude.lc 384:9-384:10 {a:Nat} -> {b} -> {c : Num b} -> VecScalar a b -> VecScalar a b -> VecScalar a Bool 1603testdata/Prelude.lc 383:13-383:16 V2->V3
1586testdata/Prelude.lc 384:11-384:12 Float 1604testdata/Prelude.lc 383:13-383:29 VecS Float 4
1587testdata/Prelude.lc 384:15-384:17 {a} -> List a 1605testdata/Prelude.lc 383:15-383:16 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a
1588testdata/Prelude.lc 384:15-385:38 Bool -> List Float 1606testdata/Prelude.lc 383:17-383:19 {a} -> a -> a -> a -> a -> VecS a 4
1589testdata/Prelude.lc 385:7-385:16 Bool 1607testdata/Prelude.lc 383:17-383:21 V4 -> V5 -> V6 -> VecS V7 4
1590testdata/Prelude.lc 385:7-385:38 List Float 1608testdata/Prelude.lc 383:17-383:23 V4 -> V5 -> VecS V6 4
1591testdata/Prelude.lc 385:19-385:20 Float 1609testdata/Prelude.lc 383:17-383:25 V4 -> VecS V5 4
1592testdata/Prelude.lc 385:19-385:21 List Float -> List Float 1610testdata/Prelude.lc 383:17-383:29 VecS Float 4
1593testdata/Prelude.lc 385:19-385:38 List Float 1611testdata/Prelude.lc 383:20-383:21 V5
1594testdata/Prelude.lc 385:20-385:21 {a} -> a -> List a -> List a 1612testdata/Prelude.lc 383:22-383:23 V4
1595testdata/Prelude.lc 385:22-385:28 Float -> Float -> List Float 1613testdata/Prelude.lc 383:24-383:25 V4
1596testdata/Prelude.lc 385:22-385:36 Float -> List Float 1614testdata/Prelude.lc 383:26-383:29 Float
1597testdata/Prelude.lc 385:22-385:38 List Float 1615testdata/Prelude.lc 385:11-385:16 Type
1598testdata/Prelude.lc 385:30-385:31 Float 1616testdata/Prelude.lc 385:11-388:38 Float -> Float -> List Float | V0->V1
1599testdata/Prelude.lc 385:30-385:33 Float->Float 1617testdata/Prelude.lc 385:20-385:25 Type
1600testdata/Prelude.lc 385:30-385:35 Float 1618testdata/Prelude.lc 385:20-385:36 Type
1601testdata/Prelude.lc 385:32-385:33 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a 1619testdata/Prelude.lc 385:29-385:36 Type
1602testdata/Prelude.lc 385:34-385:35 V1 1620testdata/Prelude.lc 385:30-385:35 Type
1603testdata/Prelude.lc 385:37-385:38 Float 1621testdata/Prelude.lc 386:1-386:7 Float -> Float -> List Float
1604testdata/Prelude.lc 387:9-387:24 Type 1622testdata/Prelude.lc 387:7-387:8 Float
1605testdata/Prelude.lc 387:9-389:30 V0->V1 | {a} -> List a -> Int->a 1623testdata/Prelude.lc 387:7-387:10 VecScalar 1 Float -> VecScalar 1 Bool
1606testdata/Prelude.lc 387:10-387:11 V1 1624testdata/Prelude.lc 387:7-387:12 VecScalar 1 Bool
1607testdata/Prelude.lc 387:16-387:19 Type 1625testdata/Prelude.lc 387:7-388:38 Float -> Float -> List Float | Float -> List Float | List Float
1608testdata/Prelude.lc 387:16-387:24 Type 1626testdata/Prelude.lc 387:9-387:10 {a:Nat} -> {b} -> {c : Num b} -> VecScalar a b -> VecScalar a b -> VecScalar a Bool
1609testdata/Prelude.lc 387:23-387:24 Type 1627testdata/Prelude.lc 387:11-387:12 Float
1610testdata/Prelude.lc 388:4-388:5 List V2 1628testdata/Prelude.lc 387:15-387:17 {a} -> List a
1611testdata/Prelude.lc 388:4-389:30 Int->V2 | List V0 -> Int->V2 | V2 1629testdata/Prelude.lc 387:15-388:38 Bool -> List Float
1612testdata/Prelude.lc 388:10-388:12 {a} -> List a -> Int->a 1630testdata/Prelude.lc 388:7-388:16 Bool
1613testdata/Prelude.lc 388:19-388:20 V3 1631testdata/Prelude.lc 388:7-388:38 List Float
1614testdata/Prelude.lc 388:19-389:30 Bool->V4 | List V2 -> V2 | V1 -> List V2 -> V2 | V2 1632testdata/Prelude.lc 388:19-388:20 Float
1615testdata/Prelude.lc 389:19-389:21 List V5 1633testdata/Prelude.lc 388:19-388:21 List Float -> List Float
1616testdata/Prelude.lc 389:19-389:24 Int->V5 1634testdata/Prelude.lc 388:19-388:38 List Float
1617testdata/Prelude.lc 389:19-389:30 V3 1635testdata/Prelude.lc 388:20-388:21 {a} -> a -> List a -> List a
1618testdata/Prelude.lc 389:22-389:24 {a} -> List a -> Int->a 1636testdata/Prelude.lc 388:22-388:28 Float -> Float -> List Float
1619testdata/Prelude.lc 389:26-389:27 Int 1637testdata/Prelude.lc 388:22-388:36 Float -> List Float
1620testdata/Prelude.lc 389:26-389:28 Int->Int 1638testdata/Prelude.lc 388:22-388:38 List Float
1621testdata/Prelude.lc 389:26-389:29 Int 1639testdata/Prelude.lc 388:30-388:31 Float
1622testdata/Prelude.lc 389:27-389:28 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a 1640testdata/Prelude.lc 388:30-388:33 Float->Float
1623testdata/Prelude.lc 389:28-389:29 V1 1641testdata/Prelude.lc 388:30-388:35 Float
1642testdata/Prelude.lc 388:32-388:33 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a
1643testdata/Prelude.lc 388:34-388:35 V1
1644testdata/Prelude.lc 388:37-388:38 Float
1645testdata/Prelude.lc 390:9-390:24 Type
1646testdata/Prelude.lc 390:9-392:30 V0->V1 | {a} -> List a -> Int->a
1647testdata/Prelude.lc 390:10-390:11 V1
1648testdata/Prelude.lc 390:16-390:19 Type
1649testdata/Prelude.lc 390:16-390:24 Type
1650testdata/Prelude.lc 390:23-390:24 Type
1651testdata/Prelude.lc 391:4-391:5 List V2
1652testdata/Prelude.lc 391:4-392:30 Int->V2 | List V0 -> Int->V2 | V2
1653testdata/Prelude.lc 391:10-391:12 {a} -> List a -> Int->a
1654testdata/Prelude.lc 391:19-391:20 V3
1655testdata/Prelude.lc 391:19-392:30 Bool->V4 | List V2 -> V2 | V1 -> List V2 -> V2 | V2
1656testdata/Prelude.lc 392:19-392:21 List V5
1657testdata/Prelude.lc 392:19-392:24 Int->V5
1658testdata/Prelude.lc 392:19-392:30 V3
1659testdata/Prelude.lc 392:22-392:24 {a} -> List a -> Int->a
1660testdata/Prelude.lc 392:26-392:27 Int
1661testdata/Prelude.lc 392:26-392:28 Int->Int
1662testdata/Prelude.lc 392:26-392:29 Int
1663testdata/Prelude.lc 392:27-392:28 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a
1664testdata/Prelude.lc 392:28-392:29 V1
diff --git a/testdata/editor-examples/LambdaCube2.out b/testdata/editor-examples/LambdaCube2.out
index 30fc82fe..59538757 100644
--- a/testdata/editor-examples/LambdaCube2.out
+++ b/testdata/editor-examples/LambdaCube2.out
@@ -15,8 +15,7 @@ Pipeline
15 ] 15 ]
16 , programs = 16 , programs =
17 [ Program 17 [ Program
18 { programUniforms = 18 { programUniforms = fromList [ ( "Time" , Float ) ]
19 fromList [ ( "MVP" , M44F ) , ( "Time" , Float ) ]
20 , programStreams = 19 , programStreams =
21 fromList 20 fromList
22 [ ( "vi1" , Parameter { name = "position4" , ty = V4F } ) ] 21 [ ( "vi1" , Parameter { name = "position4" , ty = V4F } ) ]
@@ -28,14 +27,76 @@ Pipeline
28 vec4 texture2D(sampler2D s,vec2 uv) { 27 vec4 texture2D(sampler2D s,vec2 uv) {
29 return texture(s,uv); 28 return texture(s,uv);
30 } 29 }
31 uniform mat4 MVP; 30 uniform float Time;
32 in vec4 vi1; 31 in vec4 vi1;
33 smooth out vec4 vo1; 32 smooth out vec4 vo1;
33 vec4 ext0_Float_3(vec3 z0) {
34 return vec4 ((z0).x,(z0).y,(z0).z,0.0);
35 }
36 vec3 neg_VecSFloat3(vec3 z0) {
37 return - (z0);
38 }
39 mat4 translateBefore4(vec3 z0,mat4 z1) {
40 return mat4 ((z1) * (vec4 (1.0,0.0,0.0,0.0))
41 ,(z1) * (vec4 (0.0,1.0,0.0,0.0))
42 ,(z1) * (vec4 (0.0,0.0,1.0,0.0))
43 ,(ext0_Float_3 ((z0) * (mat3
44 (((z1) * (vec4 (1.0,0.0,0.0,0.0))).xyz
45 ,((z1) * (vec4 (0.0,1.0,0.0,0.0))).xyz
46 ,((z1) * (vec4 (0.0,0.0,1.0,0.0))).xyz)))) + ((z1) * (vec4
47 (0.0,0.0,0.0,1.0))));
48 }
49 mat4 lookat(vec3 z0,vec3 z1,vec3 z2) {
50 return translateBefore4
51 (neg_VecSFloat3 (z0)
52 ,transpose (mat4
53 (ext0_Float_3 (normalize (cross (z2,normalize ((z0) - (z1)))))
54 ,ext0_Float_3 (cross (normalize ((z0) - (z1))
55 ,normalize (cross (z2,normalize ((z0) - (z1))))))
56 ,ext0_Float_3 (normalize ((z0) - (z1)))
57 ,vec4 (0.0,0.0,0.0,1.0))));
58 }
59 mat4 perspective(float z0,float z1,float z2,float z3) {
60 return mat4
61 (vec4 (((2.0) * (z0)) / (((z3) * ((z0) * (tan
62 ((z2) / (2.0))))) - ((0.0) - ((z3) * ((z0) * (tan
63 ((z2) / (2.0)))))))
64 ,0.0
65 ,(0.0) - ((((z3) * ((z0) * (tan
66 ((z2) / (2.0))))) + ((0.0) - ((z3) * ((z0) * (tan
67 ((z2) / (2.0))))))) / (((z3) * ((z0) * (tan
68 ((z2) / (2.0))))) - ((0.0) - ((z3) * ((z0) * (tan
69 ((z2) / (2.0))))))))
70 ,0.0)
71 ,vec4 (0.0
72 ,((2.0) * (z0)) / (((z0) * (tan
73 ((z2) / (2.0)))) - ((0.0) - ((z0) * (tan ((z2) / (2.0))))))
74 ,(((z0) * (tan ((z2) / (2.0)))) + ((0.0) - ((z0) * (tan
75 ((z2) / (2.0)))))) / (((z0) * (tan
76 ((z2) / (2.0)))) - ((0.0) - ((z0) * (tan ((z2) / (2.0))))))
77 ,0.0)
78 ,vec4 (0.0
79 ,0.0
80 ,(0.0) - (((z1) + (z0)) / ((z1) - (z0)))
81 ,(0.0) - ((((2.0) * (z1)) * (z0)) / ((z1) - (z0))))
82 ,vec4 (0.0,0.0,-1.0,0.0));
83 }
84 mat4 rotMatrixY(float z0) {
85 return mat4 (vec4 (cos (z0),0.0,(0.0) - (sin (z0)),0.0)
86 ,vec4 (0.0,1.0,0.0,0.0)
87 ,vec4 (sin (z0),0.0,cos (z0),0.0)
88 ,vec4 (0.0,0.0,0.0,1.0));
89 }
34 vec4 scale(float z0,vec4 z1) { 90 vec4 scale(float z0,vec4 z1) {
35 return (z1) * (vec4 (z0,z0,z0,1.0)); 91 return (z1) * (vec4 (z0,z0,z0,1.0));
36 } 92 }
37 void main() { 93 void main() {
38 gl_Position = scale (0.5,(MVP) * (vi1)); 94 gl_Position = scale (0.5
95 ,(((perspective (0.1,100.0,30.0,1.0)) * (lookat
96 (vec3 (3.0,1.3,0.3)
97 ,vec3 (0.0,0.0,0.0)
98 ,vec3 (0.0,1.0,0.0)))) * (rotMatrixY
99 ((0.1308996938995747) * (Time)))) * (vi1));
39 vo1 = vi1; 100 vo1 = vi1;
40 } 101 }
41 """ 102 """
@@ -69,7 +130,7 @@ Pipeline
69 [ Slot 130 [ Slot
70 { slotName = "stream4" 131 { slotName = "stream4"
71 , slotStreams = fromList [ ( "position4" , V4F ) ] 132 , slotStreams = fromList [ ( "position4" , V4F ) ]
72 , slotUniforms = fromList [ ( "MVP" , M44F ) , ( "Time" , Float ) ] 133 , slotUniforms = fromList [ ( "Time" , Float ) ]
73 , slotPrimitive = Triangles 134 , slotPrimitive = Triangles
74 , slotPrograms = [ 0 ] 135 , slotPrograms = [ 0 ]
75 } 136 }
diff --git a/testdata/editor-examples/RecLC.lc b/testdata/editor-examples/RecLC.lc
index 7c7f0d90..b8cfac19 100644
--- a/testdata/editor-examples/RecLC.lc
+++ b/testdata/editor-examples/RecLC.lc
@@ -5,7 +5,6 @@ import RecursiveTexture hiding (main)
5 5
6inner2 = 6inner2 =
7 makeFrame (Uniform "Time") 7 makeFrame (Uniform "Time")
8 (Uniform "MVP")
9 (fetch "stream4" (Attribute "position4")) 8 (fetch "stream4" (Attribute "position4"))
10 9
11main :: Output 10main :: Output
diff --git a/testdata/editor-examples/RecLC.out b/testdata/editor-examples/RecLC.out
index 8d679d2f..e8385948 100644
--- a/testdata/editor-examples/RecLC.out
+++ b/testdata/editor-examples/RecLC.out
@@ -120,8 +120,7 @@ Pipeline
120 ] 120 ]
121 , programs = 121 , programs =
122 [ Program 122 [ Program
123 { programUniforms = 123 { programUniforms = fromList [ ( "Time" , Float ) ]
124 fromList [ ( "MVP" , M44F ) , ( "Time" , Float ) ]
125 , programStreams = 124 , programStreams =
126 fromList 125 fromList
127 [ ( "vi1" , Parameter { name = "position4" , ty = V4F } ) ] 126 [ ( "vi1" , Parameter { name = "position4" , ty = V4F } ) ]
@@ -133,14 +132,76 @@ Pipeline
133 vec4 texture2D(sampler2D s,vec2 uv) { 132 vec4 texture2D(sampler2D s,vec2 uv) {
134 return texture(s,uv); 133 return texture(s,uv);
135 } 134 }
136 uniform mat4 MVP; 135 uniform float Time;
137 in vec4 vi1; 136 in vec4 vi1;
138 smooth out vec4 vo1; 137 smooth out vec4 vo1;
138 vec4 ext0_Float_3(vec3 z0) {
139 return vec4 ((z0).x,(z0).y,(z0).z,0.0);
140 }
141 vec3 neg_VecSFloat3(vec3 z0) {
142 return - (z0);
143 }
144 mat4 translateBefore4(vec3 z0,mat4 z1) {
145 return mat4 ((z1) * (vec4 (1.0,0.0,0.0,0.0))
146 ,(z1) * (vec4 (0.0,1.0,0.0,0.0))
147 ,(z1) * (vec4 (0.0,0.0,1.0,0.0))
148 ,(ext0_Float_3 ((z0) * (mat3
149 (((z1) * (vec4 (1.0,0.0,0.0,0.0))).xyz
150 ,((z1) * (vec4 (0.0,1.0,0.0,0.0))).xyz
151 ,((z1) * (vec4 (0.0,0.0,1.0,0.0))).xyz)))) + ((z1) * (vec4
152 (0.0,0.0,0.0,1.0))));
153 }
154 mat4 lookat(vec3 z0,vec3 z1,vec3 z2) {
155 return translateBefore4
156 (neg_VecSFloat3 (z0)
157 ,transpose (mat4
158 (ext0_Float_3 (normalize (cross (z2,normalize ((z0) - (z1)))))
159 ,ext0_Float_3 (cross (normalize ((z0) - (z1))
160 ,normalize (cross (z2,normalize ((z0) - (z1))))))
161 ,ext0_Float_3 (normalize ((z0) - (z1)))
162 ,vec4 (0.0,0.0,0.0,1.0))));
163 }
164 mat4 perspective(float z0,float z1,float z2,float z3) {
165 return mat4
166 (vec4 (((2.0) * (z0)) / (((z3) * ((z0) * (tan
167 ((z2) / (2.0))))) - ((0.0) - ((z3) * ((z0) * (tan
168 ((z2) / (2.0)))))))
169 ,0.0
170 ,(0.0) - ((((z3) * ((z0) * (tan
171 ((z2) / (2.0))))) + ((0.0) - ((z3) * ((z0) * (tan
172 ((z2) / (2.0))))))) / (((z3) * ((z0) * (tan
173 ((z2) / (2.0))))) - ((0.0) - ((z3) * ((z0) * (tan
174 ((z2) / (2.0))))))))
175 ,0.0)
176 ,vec4 (0.0
177 ,((2.0) * (z0)) / (((z0) * (tan
178 ((z2) / (2.0)))) - ((0.0) - ((z0) * (tan ((z2) / (2.0))))))
179 ,(((z0) * (tan ((z2) / (2.0)))) + ((0.0) - ((z0) * (tan
180 ((z2) / (2.0)))))) / (((z0) * (tan
181 ((z2) / (2.0)))) - ((0.0) - ((z0) * (tan ((z2) / (2.0))))))
182 ,0.0)
183 ,vec4 (0.0
184 ,0.0
185 ,(0.0) - (((z1) + (z0)) / ((z1) - (z0)))
186 ,(0.0) - ((((2.0) * (z1)) * (z0)) / ((z1) - (z0))))
187 ,vec4 (0.0,0.0,-1.0,0.0));
188 }
189 mat4 rotMatrixY(float z0) {
190 return mat4 (vec4 (cos (z0),0.0,(0.0) - (sin (z0)),0.0)
191 ,vec4 (0.0,1.0,0.0,0.0)
192 ,vec4 (sin (z0),0.0,cos (z0),0.0)
193 ,vec4 (0.0,0.0,0.0,1.0));
194 }
139 vec4 scale(float z0,vec4 z1) { 195 vec4 scale(float z0,vec4 z1) {
140 return (z1) * (vec4 (z0,z0,z0,1.0)); 196 return (z1) * (vec4 (z0,z0,z0,1.0));
141 } 197 }
142 void main() { 198 void main() {
143 gl_Position = scale (0.5,(MVP) * (vi1)); 199 gl_Position = scale (0.5
200 ,(((perspective (0.1,100.0,30.0,1.0)) * (lookat
201 (vec3 (3.0,1.3,0.3)
202 ,vec3 (0.0,0.0,0.0)
203 ,vec3 (0.0,1.0,0.0)))) * (rotMatrixY
204 ((0.1308996938995747) * (Time)))) * (vi1));
144 vo1 = vi1; 205 vo1 = vi1;
145 } 206 }
146 """ 207 """