diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | lc/Prelude.lc | 5 | ||||
-rw-r--r-- | testdata/Prelude.out | 415 | ||||
-rw-r--r-- | testdata/editor-examples/LambdaCube2.out | 71 | ||||
-rw-r--r-- | testdata/editor-examples/RecLC.lc | 1 | ||||
-rw-r--r-- | testdata/editor-examples/RecLC.out | 69 |
6 files changed, 364 insertions, 199 deletions
@@ -2,7 +2,7 @@ | |||
2 | all: | 2 | all: |
3 | cabal install | 3 | cabal install |
4 | 4 | ||
5 | LCDIR=~/.cabal/share/x86_64-linux-ghc-7.10.2/lambdacube-compiler-0.5.0.0/lc | 5 | LCDIR=~/.cabal/share/x86_64-linux-ghc-7.10.3/lambdacube-compiler-0.5.0.0/lc |
6 | 6 | ||
7 | repl: | 7 | repl: |
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 | |||
360 | translateBefore4 v p4 = M44F r1 r2 r3 (ext0 u + r4) | 360 | translateBefore4 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 -> | |||
1414 | testdata/Prelude.lc 360:25-360:35 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float | 1414 | testdata/Prelude.lc 360:25-360:35 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float |
1415 | testdata/Prelude.lc 360:25-360:38 Vec 4 Float -> Mat 4 4 Float | 1415 | testdata/Prelude.lc 360:25-360:38 Vec 4 Float -> Mat 4 4 Float |
1416 | testdata/Prelude.lc 360:25-360:52 Mat 4 4 Float | 1416 | testdata/Prelude.lc 360:25-360:52 Mat 4 4 Float |
1417 | testdata/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 | 1417 | testdata/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 |
1418 | testdata/Prelude.lc 360:30-360:32 VecS Float 4 | 1418 | testdata/Prelude.lc 360:30-360:32 Vec 4 Float |
1419 | testdata/Prelude.lc 360:33-360:35 VecS Float 4 | 1419 | testdata/Prelude.lc 360:33-360:35 Vec 4 Float |
1420 | testdata/Prelude.lc 360:36-360:38 VecS Float 4 | 1420 | testdata/Prelude.lc 360:36-360:38 Vec 4 Float |
1421 | testdata/Prelude.lc 360:40-360:44 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 | 1421 | testdata/Prelude.lc 360:40-360:44 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 |
1422 | testdata/Prelude.lc 360:40-360:46 VecS Float 4 | 1422 | testdata/Prelude.lc 360:40-360:46 VecS Float 4 |
1423 | testdata/Prelude.lc 360:40-360:48 VecS Float 4 -> VecS Float 4 | 1423 | testdata/Prelude.lc 360:40-360:48 VecS Float 4 -> VecS Float 4 |
1424 | testdata/Prelude.lc 360:40-360:51 VecS Float 4 | 1424 | testdata/Prelude.lc 360:40-360:51 VecS Float 4 |
1425 | testdata/Prelude.lc 360:45-360:46 Vec 3 Float | 1425 | testdata/Prelude.lc 360:45-360:46 Vec 3 Float |
1426 | testdata/Prelude.lc 360:47-360:48 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | 1426 | testdata/Prelude.lc 360:47-360:48 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a |
1427 | testdata/Prelude.lc 360:49-360:51 VecS Float 4 | 1427 | testdata/Prelude.lc 360:49-360:51 Vec 4 Float |
1428 | testdata/Prelude.lc 362:13-362:15 {a} -> a -> a -> a -> a -> VecS a 4 | 1428 | testdata/Prelude.lc 362:13-362:15 {a} -> a -> a -> a -> a -> VecS a 4 |
1429 | testdata/Prelude.lc 362:13-362:19 V1 -> V2 -> V3 -> VecS V4 4 | 1429 | testdata/Prelude.lc 362:13-362:19 V1 -> V2 -> V3 -> VecS V4 4 |
1430 | testdata/Prelude.lc 362:13-362:23 V1 -> V2 -> VecS V3 4 | 1430 | testdata/Prelude.lc 362:13-362:23 V1 -> V2 -> VecS V3 4 |
@@ -1437,187 +1437,228 @@ testdata/Prelude.lc 362:20-362:23 V1 | |||
1437 | testdata/Prelude.lc 362:24-362:25 VecS V3 V2 | 1437 | testdata/Prelude.lc 362:24-362:25 VecS V3 V2 |
1438 | testdata/Prelude.lc 362:24-362:27 V1 | 1438 | testdata/Prelude.lc 362:24-362:27 V1 |
1439 | testdata/Prelude.lc 362:28-362:29 V1 | 1439 | testdata/Prelude.lc 362:28-362:29 V1 |
1440 | testdata/Prelude.lc 363:5-363:9 V4 | 1440 | testdata/Prelude.lc 363:9-363:11 Mat 4 4 Float |
1441 | testdata/Prelude.lc 363:5-363:12 VecS Float 4 | 1441 | testdata/Prelude.lc 363:9-363:14 VecS Float 4 -> Vec 4 Float |
1442 | testdata/Prelude.lc 363:5-363:15 VecS Float 4 | 1442 | testdata/Prelude.lc 363:9-363:25 Vec 4 Float |
1443 | testdata/Prelude.lc 363:5-363:18 VecS Float 4 | 1443 | testdata/Prelude.lc 363:12-363:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c |
1444 | testdata/Prelude.lc 363:5-363:21 VecS Float 4 | 1444 | testdata/Prelude.lc 363:15-363:17 {a} -> a -> a -> a -> a -> VecS a 4 |
1445 | testdata/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 | 1445 | testdata/Prelude.lc 363:15-363:19 V1 -> V2 -> V3 -> VecS V4 4 |
1446 | testdata/Prelude.lc 363:10-363:21 Mat 4 4 Float | 1446 | testdata/Prelude.lc 363:15-363:21 V2 -> V3 -> VecS V4 4 |
1447 | testdata/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 | 1447 | testdata/Prelude.lc 363:15-363:23 V2 -> VecS V3 4 |
1448 | testdata/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 | 1448 | testdata/Prelude.lc 363:15-363:25 VecS Float 4 |
1449 | testdata/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 | 1449 | testdata/Prelude.lc 363:18-363:19 V1 |
1450 | testdata/Prelude.lc 363:25-363:27 Mat 4 4 Float | 1450 | testdata/Prelude.lc 363:20-363:21 V1 |
1451 | testdata/Prelude.lc 364:8-364:9 Vec 3 Float | 1451 | testdata/Prelude.lc 363:22-363:23 V1 |
1452 | testdata/Prelude.lc 364:8-364:12 Mat 3 V0 Float -> Vec V1 Float | 1452 | testdata/Prelude.lc 363:24-363:25 V1 |
1453 | testdata/Prelude.lc 364:8-364:38 Vec 3 Float | 1453 | testdata/Prelude.lc 364:9-364:11 Mat 4 4 Float |
1454 | testdata/Prelude.lc 364:10-364:12 {a:Nat} -> {b} -> {c:Nat} -> VecS b a -> Mat a c b -> Vec c b | 1454 | testdata/Prelude.lc 364:9-364:14 VecS Float 4 -> Vec 4 Float |
1455 | testdata/Prelude.lc 364:13-364:17 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float | 1455 | testdata/Prelude.lc 364:9-364:25 Vec 4 Float |
1456 | testdata/Prelude.lc 364:13-364:24 Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float | 1456 | testdata/Prelude.lc 364:12-364:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c |
1457 | testdata/Prelude.lc 364:13-364:31 Vec 3 Float -> Mat 3 3 Float | 1457 | testdata/Prelude.lc 364:15-364:17 {a} -> a -> a -> a -> a -> VecS a 4 |
1458 | testdata/Prelude.lc 364:13-364:38 Mat 3 3 Float | 1458 | testdata/Prelude.lc 364:15-364:19 V1 -> V2 -> V3 -> VecS V4 4 |
1459 | testdata/Prelude.lc 364:18-364:20 VecS Float 4 | 1459 | testdata/Prelude.lc 364:15-364:21 V2 -> V3 -> VecS V4 4 |
1460 | testdata/Prelude.lc 364:18-364:24 VecS Float 3 | 1460 | testdata/Prelude.lc 364:15-364:23 V2 -> VecS V3 4 |
1461 | testdata/Prelude.lc 364:25-364:27 VecS Float 4 | 1461 | testdata/Prelude.lc 364:15-364:25 VecS Float 4 |
1462 | testdata/Prelude.lc 364:25-364:31 VecS Float 3 | 1462 | testdata/Prelude.lc 364:18-364:19 V1 |
1463 | testdata/Prelude.lc 364:32-364:34 VecS Float 4 | 1463 | testdata/Prelude.lc 364:20-364:21 V1 |
1464 | testdata/Prelude.lc 364:32-364:38 VecS Float 3 | 1464 | testdata/Prelude.lc 364:22-364:23 V1 |
1465 | testdata/Prelude.lc 367:11-367:14 Nat -> Type->Type | 1465 | testdata/Prelude.lc 364:24-364:25 V1 |
1466 | testdata/Prelude.lc 367:11-367:16 Type->Type | 1466 | testdata/Prelude.lc 365:9-365:11 Mat 4 4 Float |
1467 | testdata/Prelude.lc 367:11-367:22 Type | 1467 | testdata/Prelude.lc 365:9-365:14 VecS Float 4 -> Vec 4 Float |
1468 | testdata/Prelude.lc 367:15-367:16 V1 | 1468 | testdata/Prelude.lc 365:9-365:25 Vec 4 Float |
1469 | testdata/Prelude.lc 367:17-367:22 Type | 1469 | testdata/Prelude.lc 365:12-365:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c |
1470 | testdata/Prelude.lc 368:11-368:14 Nat -> Type->Type | 1470 | testdata/Prelude.lc 365:15-365:17 {a} -> a -> a -> a -> a -> VecS a 4 |
1471 | testdata/Prelude.lc 368:11-368:16 Type->Type | 1471 | testdata/Prelude.lc 365:15-365:19 V1 -> V2 -> V3 -> VecS V4 4 |
1472 | testdata/Prelude.lc 368:11-368:22 Type | 1472 | testdata/Prelude.lc 365:15-365:21 V2 -> V3 -> VecS V4 4 |
1473 | testdata/Prelude.lc 368:11-370:24 Type | 1473 | testdata/Prelude.lc 365:15-365:23 V2 -> VecS V3 4 |
1474 | testdata/Prelude.lc 368:15-368:16 V1 | 1474 | testdata/Prelude.lc 365:15-365:25 VecS Float 4 |
1475 | testdata/Prelude.lc 368:17-368:22 Type | 1475 | testdata/Prelude.lc 365:18-365:19 V1 |
1476 | testdata/Prelude.lc 369:11-369:14 Nat -> Type->Type | 1476 | testdata/Prelude.lc 365:20-365:21 V1 |
1477 | testdata/Prelude.lc 369:11-369:16 Type->Type | 1477 | testdata/Prelude.lc 365:22-365:23 V1 |
1478 | testdata/Prelude.lc 369:11-369:22 Type | 1478 | testdata/Prelude.lc 365:24-365:25 V1 |
1479 | testdata/Prelude.lc 369:11-370:24 Type | 1479 | testdata/Prelude.lc 366:9-366:11 Mat 4 4 Float |
1480 | testdata/Prelude.lc 369:15-369:16 V1 | 1480 | testdata/Prelude.lc 366:9-366:14 VecS Float 4 -> Vec 4 Float |
1481 | testdata/Prelude.lc 369:17-369:22 Type | 1481 | testdata/Prelude.lc 366:9-366:25 Vec 4 Float |
1482 | testdata/Prelude.lc 370:11-370:14 Nat -> Nat -> Type->Type | 1482 | testdata/Prelude.lc 366:12-366:14 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> VecS c b -> Vec a c |
1483 | testdata/Prelude.lc 370:11-370:16 Nat -> Type->Type | 1483 | testdata/Prelude.lc 366:15-366:17 {a} -> a -> a -> a -> a -> VecS a 4 |
1484 | testdata/Prelude.lc 370:11-370:18 Type->Type | 1484 | testdata/Prelude.lc 366:15-366:19 V1 -> V2 -> V3 -> VecS V4 4 |
1485 | testdata/Prelude.lc 370:11-370:24 Type | 1485 | testdata/Prelude.lc 366:15-366:21 V2 -> V3 -> VecS V4 4 |
1486 | testdata/Prelude.lc 366:15-366:23 V2 -> VecS V3 4 | ||
1487 | testdata/Prelude.lc 366:15-366:25 VecS Float 4 | ||
1488 | testdata/Prelude.lc 366:18-366:19 V1 | ||
1489 | testdata/Prelude.lc 366:20-366:21 V1 | ||
1490 | testdata/Prelude.lc 366:22-366:23 V1 | ||
1491 | testdata/Prelude.lc 366:24-366:25 V1 | ||
1492 | testdata/Prelude.lc 367:8-367:9 Vec 3 Float | ||
1493 | testdata/Prelude.lc 367:8-367:12 Mat 3 V0 Float -> Vec V1 Float | ||
1494 | testdata/Prelude.lc 367:8-367:38 Vec 3 Float | ||
1495 | testdata/Prelude.lc 367:10-367:12 {a:Nat} -> {b} -> {c:Nat} -> VecS b a -> Mat a c b -> Vec c b | ||
1496 | testdata/Prelude.lc 367:13-367:17 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float | ||
1497 | testdata/Prelude.lc 367:13-367:24 Vec 3 Float -> Vec 3 Float -> Mat 3 3 Float | ||
1498 | testdata/Prelude.lc 367:13-367:31 Vec 3 Float -> Mat 3 3 Float | ||
1499 | testdata/Prelude.lc 367:13-367:38 Mat 3 3 Float | ||
1500 | testdata/Prelude.lc 367:18-367:20 Vec 4 Float | ||
1501 | testdata/Prelude.lc 367:18-367:24 VecS Float 3 | ||
1502 | testdata/Prelude.lc 367:25-367:27 Vec 4 Float | ||
1503 | testdata/Prelude.lc 367:25-367:31 VecS Float 3 | ||
1504 | testdata/Prelude.lc 367:32-367:34 Vec 4 Float | ||
1505 | testdata/Prelude.lc 367:32-367:38 VecS Float 3 | ||
1506 | testdata/Prelude.lc 370:11-370:14 Nat -> Type->Type | ||
1507 | testdata/Prelude.lc 370:11-370:16 Type->Type | ||
1508 | testdata/Prelude.lc 370:11-370:22 Type | ||
1486 | testdata/Prelude.lc 370:15-370:16 V1 | 1509 | testdata/Prelude.lc 370:15-370:16 V1 |
1487 | testdata/Prelude.lc 370:17-370:18 V1 | 1510 | testdata/Prelude.lc 370:17-370:22 Type |
1488 | testdata/Prelude.lc 370:19-370:24 Type | 1511 | testdata/Prelude.lc 371:11-371:14 Nat -> Type->Type |
1489 | testdata/Prelude.lc 371:1-371:7 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float | 1512 | testdata/Prelude.lc 371:11-371:16 Type->Type |
1490 | testdata/Prelude.lc 371:24-371:40 Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float | 1513 | testdata/Prelude.lc 371:11-371:22 Type |
1491 | testdata/Prelude.lc 371:24-371:50 Mat 4 4 Float -> Mat 4 4 Float | 1514 | testdata/Prelude.lc 371:11-373:24 Type |
1492 | testdata/Prelude.lc 371:24-371:52 Mat 4 4 Float | 1515 | testdata/Prelude.lc 371:15-371:16 V1 |
1493 | testdata/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 | 1516 | testdata/Prelude.lc 371:17-371:22 Type |
1494 | testdata/Prelude.lc 371:42-371:45 {a} -> {b : Signed (MatVecScalarElem a)} -> a->a | 1517 | testdata/Prelude.lc 372:11-372:14 Nat -> Type->Type |
1495 | testdata/Prelude.lc 371:42-371:49 VecS Float 3 | 1518 | testdata/Prelude.lc 372:11-372:16 Type->Type |
1496 | testdata/Prelude.lc 371:46-371:49 Vec 3 Float | 1519 | testdata/Prelude.lc 372:11-372:22 Type |
1497 | testdata/Prelude.lc 371:51-371:52 Mat 4 4 Float | 1520 | testdata/Prelude.lc 372:11-373:24 Type |
1498 | testdata/Prelude.lc 373:14-373:16 {a} -> a -> a -> a -> a -> VecS a 4 | 1521 | testdata/Prelude.lc 372:15-372:16 V1 |
1499 | testdata/Prelude.lc 373:14-373:20 V1 -> V2 -> V3 -> VecS V4 4 | 1522 | testdata/Prelude.lc 372:17-372:22 Type |
1500 | testdata/Prelude.lc 373:14-373:24 V1 -> V2 -> VecS V3 4 | 1523 | testdata/Prelude.lc 373:11-373:14 Nat -> Nat -> Type->Type |
1501 | testdata/Prelude.lc 373:14-373:28 V1 -> VecS V2 4 | 1524 | testdata/Prelude.lc 373:11-373:16 Nat -> Type->Type |
1502 | testdata/Prelude.lc 373:14-373:30 VecS V2 4 | 1525 | testdata/Prelude.lc 373:11-373:18 Type->Type |
1503 | testdata/Prelude.lc 373:17-373:18 V4 | 1526 | testdata/Prelude.lc 373:11-373:24 Type |
1504 | testdata/Prelude.lc 373:17-373:20 V1 | 1527 | testdata/Prelude.lc 373:15-373:16 V1 |
1505 | testdata/Prelude.lc 373:21-373:22 VecS V3 V2 | 1528 | testdata/Prelude.lc 373:17-373:18 V1 |
1506 | testdata/Prelude.lc 373:21-373:24 V1 | 1529 | testdata/Prelude.lc 373:19-373:24 Type |
1507 | testdata/Prelude.lc 373:25-373:26 VecS V3 V2 | 1530 | testdata/Prelude.lc 374:1-374:7 Vec 3 Float -> Vec 3 Float -> Vec 3 Float -> Mat 4 4 Float |
1508 | testdata/Prelude.lc 373:25-373:28 V1 | 1531 | testdata/Prelude.lc 374:24-374:40 Vec 3 Float -> Mat 4 4 Float -> Mat 4 4 Float |
1509 | testdata/Prelude.lc 373:29-373:30 V1 | 1532 | testdata/Prelude.lc 374:24-374:50 Mat 4 4 Float -> Mat 4 4 Float |
1510 | testdata/Prelude.lc 374:9-374:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a | 1533 | testdata/Prelude.lc 374:24-374:52 Mat 4 4 Float |
1511 | testdata/Prelude.lc 374:9-374:20 VecScalar V0 Float -> VecScalar V1 Float | 1534 | testdata/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 |
1512 | testdata/Prelude.lc 374:9-374:33 VecScalar 3 Float | 1535 | testdata/Prelude.lc 374:42-374:45 {a} -> {b : Signed (MatVecScalarElem a)} -> a->a |
1513 | testdata/Prelude.lc 374:19-374:20 {a} -> {b} -> a->b -> a->b | 1536 | testdata/Prelude.lc 374:42-374:49 VecS Float 3 |
1514 | testdata/Prelude.lc 374:21-374:24 Vec 3 Float | 1537 | testdata/Prelude.lc 374:46-374:49 Vec 3 Float |
1515 | testdata/Prelude.lc 374:21-374:26 VecS Float 3 -> VecS Float 3 | 1538 | testdata/Prelude.lc 374:51-374:52 Mat 4 4 Float |
1516 | testdata/Prelude.lc 374:21-374:33 VecS Float 3 | 1539 | testdata/Prelude.lc 376:14-376:16 {a} -> a -> a -> a -> a -> VecS a 4 |
1517 | testdata/Prelude.lc 374:25-374:26 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | 1540 | testdata/Prelude.lc 376:14-376:20 V1 -> V2 -> V3 -> VecS V4 4 |
1518 | testdata/Prelude.lc 374:27-374:33 Vec 3 Float | 1541 | testdata/Prelude.lc 376:14-376:24 V1 -> V2 -> VecS V3 4 |
1519 | testdata/Prelude.lc 375:9-375:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a | 1542 | testdata/Prelude.lc 376:14-376:28 V1 -> VecS V2 4 |
1520 | testdata/Prelude.lc 375:9-375:20 VecScalar V0 Float -> VecScalar V1 Float | 1543 | testdata/Prelude.lc 376:14-376:30 VecS V2 4 |
1521 | testdata/Prelude.lc 375:9-375:33 VecScalar 3 Float | 1544 | testdata/Prelude.lc 376:17-376:18 V4 |
1522 | testdata/Prelude.lc 375:19-375:20 {a} -> {b} -> a->b -> a->b | 1545 | testdata/Prelude.lc 376:17-376:20 V1 |
1523 | testdata/Prelude.lc 375:21-375:23 Vec 3 Float | 1546 | testdata/Prelude.lc 376:21-376:22 VecS V3 V2 |
1524 | testdata/Prelude.lc 375:21-375:31 VecS Float 3 -> VecS Float 3 | 1547 | testdata/Prelude.lc 376:21-376:24 V1 |
1525 | testdata/Prelude.lc 375:21-375:33 VecS Float 3 | 1548 | testdata/Prelude.lc 376:25-376:26 VecS V3 V2 |
1526 | testdata/Prelude.lc 375:24-375:31 {a} -> {b : a ~ VecS Float 3} -> a -> a->a | 1549 | testdata/Prelude.lc 376:25-376:28 V1 |
1527 | testdata/Prelude.lc 375:32-375:33 VecScalar 3 Float | 1550 | testdata/Prelude.lc 376:29-376:30 V1 |
1528 | testdata/Prelude.lc 376:9-376:10 VecScalar 3 Float | 1551 | testdata/Prelude.lc 377:9-377:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a |
1529 | testdata/Prelude.lc 376:9-376:18 VecS Float 3 -> VecS Float 3 | 1552 | testdata/Prelude.lc 377:9-377:20 VecScalar V0 Float -> VecScalar V1 Float |
1530 | testdata/Prelude.lc 376:9-376:20 VecS Float 3 | 1553 | testdata/Prelude.lc 377:9-377:33 VecScalar 3 Float |
1531 | testdata/Prelude.lc 376:11-376:18 {a} -> {b : a ~ VecS Float 3} -> a -> a->a | ||
1532 | testdata/Prelude.lc 376:19-376:20 VecScalar 3 Float | ||
1533 | testdata/Prelude.lc 377:9-377:18 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> Mat b a c | ||
1534 | testdata/Prelude.lc 377:9-377:20 Mat V2 V1 V0 -> Mat V2 V3 V1 | ||
1535 | testdata/Prelude.lc 377:9-377:65 Mat 4 4 Float | ||
1536 | testdata/Prelude.lc 377:19-377:20 {a} -> {b} -> a->b -> a->b | 1554 | testdata/Prelude.lc 377:19-377:20 {a} -> {b} -> a->b -> a->b |
1537 | testdata/Prelude.lc 377:21-377:25 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float | 1555 | testdata/Prelude.lc 377:21-377:24 Vec 3 Float |
1538 | testdata/Prelude.lc 377:21-377:34 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float | 1556 | testdata/Prelude.lc 377:21-377:26 VecS Float 3 -> VecS Float 3 |
1539 | testdata/Prelude.lc 377:21-377:43 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float | 1557 | testdata/Prelude.lc 377:21-377:33 VecS Float 3 |
1540 | testdata/Prelude.lc 377:21-377:52 Vec 4 Float -> Mat 4 4 Float | 1558 | testdata/Prelude.lc 377:25-377:26 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a |
1541 | testdata/Prelude.lc 377:21-377:65 Mat 4 4 Float | 1559 | testdata/Prelude.lc 377:27-377:33 Vec 3 Float |
1542 | testdata/Prelude.lc 377:27-377:31 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 | 1560 | testdata/Prelude.lc 378:9-378:18 {a} -> {b:Nat} -> {c : a ~ VecScalar b Float} -> a->a |
1543 | testdata/Prelude.lc 377:27-377:33 VecS Float 4 | 1561 | testdata/Prelude.lc 378:9-378:20 VecScalar V0 Float -> VecScalar V1 Float |
1544 | testdata/Prelude.lc 377:32-377:33 VecScalar 3 Float | 1562 | testdata/Prelude.lc 378:9-378:33 VecScalar 3 Float |
1545 | testdata/Prelude.lc 377:36-377:40 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 | 1563 | testdata/Prelude.lc 378:19-378:20 {a} -> {b} -> a->b -> a->b |
1546 | testdata/Prelude.lc 377:36-377:42 VecS Float 4 | 1564 | testdata/Prelude.lc 378:21-378:23 Vec 3 Float |
1547 | testdata/Prelude.lc 377:41-377:42 VecS Float 3 | 1565 | testdata/Prelude.lc 378:21-378:31 VecS Float 3 -> VecS Float 3 |
1548 | testdata/Prelude.lc 377:45-377:49 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 | 1566 | testdata/Prelude.lc 378:21-378:33 VecS Float 3 |
1549 | testdata/Prelude.lc 377:45-377:51 VecS Float 4 | 1567 | testdata/Prelude.lc 378:24-378:31 {a} -> {b : a ~ VecS Float 3} -> a -> a->a |
1550 | testdata/Prelude.lc 377:50-377:51 VecScalar 3 Float | 1568 | testdata/Prelude.lc 378:32-378:33 VecScalar 3 Float |
1551 | testdata/Prelude.lc 377:54-377:56 {a} -> a -> a -> a -> a -> VecS a 4 | 1569 | testdata/Prelude.lc 379:9-379:10 VecScalar 3 Float |
1552 | testdata/Prelude.lc 377:54-377:58 V1 -> V2 -> V3 -> VecS V4 4 | 1570 | testdata/Prelude.lc 379:9-379:18 VecS Float 3 -> VecS Float 3 |
1553 | testdata/Prelude.lc 377:54-377:60 V2 -> V3 -> VecS V4 4 | 1571 | testdata/Prelude.lc 379:9-379:20 VecS Float 3 |
1554 | testdata/Prelude.lc 377:54-377:62 V2 -> VecS V3 4 | 1572 | testdata/Prelude.lc 379:11-379:18 {a} -> {b : a ~ VecS Float 3} -> a -> a->a |
1555 | testdata/Prelude.lc 377:54-377:64 VecS Float 4 | 1573 | testdata/Prelude.lc 379:19-379:20 VecScalar 3 Float |
1556 | testdata/Prelude.lc 377:57-377:58 V1 | 1574 | testdata/Prelude.lc 380:9-380:18 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> Mat b a c |
1557 | testdata/Prelude.lc 377:59-377:60 V1 | 1575 | testdata/Prelude.lc 380:9-380:20 Mat V2 V1 V0 -> Mat V2 V3 V1 |
1558 | testdata/Prelude.lc 377:61-377:62 V1 | 1576 | testdata/Prelude.lc 380:9-380:65 Mat 4 4 Float |
1559 | testdata/Prelude.lc 377:63-377:64 V1 | 1577 | testdata/Prelude.lc 380:19-380:20 {a} -> {b} -> a->b -> a->b |
1560 | testdata/Prelude.lc 380:1-380:6 Float -> VecS Float 4 -> VecS Float 4 | 1578 | testdata/Prelude.lc 380:21-380:25 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float |
1561 | testdata/Prelude.lc 380:13-380:14 V3 | 1579 | testdata/Prelude.lc 380:21-380:34 Vec 4 Float -> Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float |
1562 | testdata/Prelude.lc 380:13-380:16 V2->V3 | 1580 | testdata/Prelude.lc 380:21-380:43 Vec 4 Float -> Vec 4 Float -> Mat 4 4 Float |
1563 | testdata/Prelude.lc 380:13-380:29 VecS Float 4 | 1581 | testdata/Prelude.lc 380:21-380:52 Vec 4 Float -> Mat 4 4 Float |
1564 | testdata/Prelude.lc 380:15-380:16 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | 1582 | testdata/Prelude.lc 380:21-380:65 Mat 4 4 Float |
1565 | testdata/Prelude.lc 380:17-380:19 {a} -> a -> a -> a -> a -> VecS a 4 | 1583 | testdata/Prelude.lc 380:27-380:31 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 |
1566 | testdata/Prelude.lc 380:17-380:21 V4 -> V5 -> V6 -> VecS V7 4 | 1584 | testdata/Prelude.lc 380:27-380:33 VecS Float 4 |
1567 | testdata/Prelude.lc 380:17-380:23 V4 -> V5 -> VecS V6 4 | 1585 | testdata/Prelude.lc 380:32-380:33 VecScalar 3 Float |
1568 | testdata/Prelude.lc 380:17-380:25 V4 -> VecS V5 4 | 1586 | testdata/Prelude.lc 380:36-380:40 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 |
1569 | testdata/Prelude.lc 380:17-380:29 VecS Float 4 | 1587 | testdata/Prelude.lc 380:36-380:42 VecS Float 4 |
1570 | testdata/Prelude.lc 380:20-380:21 V5 | 1588 | testdata/Prelude.lc 380:41-380:42 VecS Float 3 |
1571 | testdata/Prelude.lc 380:22-380:23 V4 | 1589 | testdata/Prelude.lc 380:45-380:49 {a} -> {b:Nat} -> {c : Num a} -> VecS a b -> VecS a 4 |
1572 | testdata/Prelude.lc 380:24-380:25 V4 | 1590 | testdata/Prelude.lc 380:45-380:51 VecS Float 4 |
1573 | testdata/Prelude.lc 380:26-380:29 Float | 1591 | testdata/Prelude.lc 380:50-380:51 VecScalar 3 Float |
1574 | testdata/Prelude.lc 382:11-382:16 Type | 1592 | testdata/Prelude.lc 380:54-380:56 {a} -> a -> a -> a -> a -> VecS a 4 |
1575 | testdata/Prelude.lc 382:11-385:38 Float -> Float -> List Float | V0->V1 | 1593 | testdata/Prelude.lc 380:54-380:58 V1 -> V2 -> V3 -> VecS V4 4 |
1576 | testdata/Prelude.lc 382:20-382:25 Type | 1594 | testdata/Prelude.lc 380:54-380:60 V2 -> V3 -> VecS V4 4 |
1577 | testdata/Prelude.lc 382:20-382:36 Type | 1595 | testdata/Prelude.lc 380:54-380:62 V2 -> VecS V3 4 |
1578 | testdata/Prelude.lc 382:29-382:36 Type | 1596 | testdata/Prelude.lc 380:54-380:64 VecS Float 4 |
1579 | testdata/Prelude.lc 382:30-382:35 Type | 1597 | testdata/Prelude.lc 380:57-380:58 V1 |
1580 | testdata/Prelude.lc 383:1-383:7 Float -> Float -> List Float | 1598 | testdata/Prelude.lc 380:59-380:60 V1 |
1581 | testdata/Prelude.lc 384:7-384:8 Float | 1599 | testdata/Prelude.lc 380:61-380:62 V1 |
1582 | testdata/Prelude.lc 384:7-384:10 VecScalar 1 Float -> VecScalar 1 Bool | 1600 | testdata/Prelude.lc 380:63-380:64 V1 |
1583 | testdata/Prelude.lc 384:7-384:12 VecScalar 1 Bool | 1601 | testdata/Prelude.lc 383:1-383:6 Float -> VecS Float 4 -> VecS Float 4 |
1584 | testdata/Prelude.lc 384:7-385:38 Float -> Float -> List Float | Float -> List Float | List Float | 1602 | testdata/Prelude.lc 383:13-383:14 V3 |
1585 | testdata/Prelude.lc 384:9-384:10 {a:Nat} -> {b} -> {c : Num b} -> VecScalar a b -> VecScalar a b -> VecScalar a Bool | 1603 | testdata/Prelude.lc 383:13-383:16 V2->V3 |
1586 | testdata/Prelude.lc 384:11-384:12 Float | 1604 | testdata/Prelude.lc 383:13-383:29 VecS Float 4 |
1587 | testdata/Prelude.lc 384:15-384:17 {a} -> List a | 1605 | testdata/Prelude.lc 383:15-383:16 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a |
1588 | testdata/Prelude.lc 384:15-385:38 Bool -> List Float | 1606 | testdata/Prelude.lc 383:17-383:19 {a} -> a -> a -> a -> a -> VecS a 4 |
1589 | testdata/Prelude.lc 385:7-385:16 Bool | 1607 | testdata/Prelude.lc 383:17-383:21 V4 -> V5 -> V6 -> VecS V7 4 |
1590 | testdata/Prelude.lc 385:7-385:38 List Float | 1608 | testdata/Prelude.lc 383:17-383:23 V4 -> V5 -> VecS V6 4 |
1591 | testdata/Prelude.lc 385:19-385:20 Float | 1609 | testdata/Prelude.lc 383:17-383:25 V4 -> VecS V5 4 |
1592 | testdata/Prelude.lc 385:19-385:21 List Float -> List Float | 1610 | testdata/Prelude.lc 383:17-383:29 VecS Float 4 |
1593 | testdata/Prelude.lc 385:19-385:38 List Float | 1611 | testdata/Prelude.lc 383:20-383:21 V5 |
1594 | testdata/Prelude.lc 385:20-385:21 {a} -> a -> List a -> List a | 1612 | testdata/Prelude.lc 383:22-383:23 V4 |
1595 | testdata/Prelude.lc 385:22-385:28 Float -> Float -> List Float | 1613 | testdata/Prelude.lc 383:24-383:25 V4 |
1596 | testdata/Prelude.lc 385:22-385:36 Float -> List Float | 1614 | testdata/Prelude.lc 383:26-383:29 Float |
1597 | testdata/Prelude.lc 385:22-385:38 List Float | 1615 | testdata/Prelude.lc 385:11-385:16 Type |
1598 | testdata/Prelude.lc 385:30-385:31 Float | 1616 | testdata/Prelude.lc 385:11-388:38 Float -> Float -> List Float | V0->V1 |
1599 | testdata/Prelude.lc 385:30-385:33 Float->Float | 1617 | testdata/Prelude.lc 385:20-385:25 Type |
1600 | testdata/Prelude.lc 385:30-385:35 Float | 1618 | testdata/Prelude.lc 385:20-385:36 Type |
1601 | testdata/Prelude.lc 385:32-385:33 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | 1619 | testdata/Prelude.lc 385:29-385:36 Type |
1602 | testdata/Prelude.lc 385:34-385:35 V1 | 1620 | testdata/Prelude.lc 385:30-385:35 Type |
1603 | testdata/Prelude.lc 385:37-385:38 Float | 1621 | testdata/Prelude.lc 386:1-386:7 Float -> Float -> List Float |
1604 | testdata/Prelude.lc 387:9-387:24 Type | 1622 | testdata/Prelude.lc 387:7-387:8 Float |
1605 | testdata/Prelude.lc 387:9-389:30 V0->V1 | {a} -> List a -> Int->a | 1623 | testdata/Prelude.lc 387:7-387:10 VecScalar 1 Float -> VecScalar 1 Bool |
1606 | testdata/Prelude.lc 387:10-387:11 V1 | 1624 | testdata/Prelude.lc 387:7-387:12 VecScalar 1 Bool |
1607 | testdata/Prelude.lc 387:16-387:19 Type | 1625 | testdata/Prelude.lc 387:7-388:38 Float -> Float -> List Float | Float -> List Float | List Float |
1608 | testdata/Prelude.lc 387:16-387:24 Type | 1626 | testdata/Prelude.lc 387:9-387:10 {a:Nat} -> {b} -> {c : Num b} -> VecScalar a b -> VecScalar a b -> VecScalar a Bool |
1609 | testdata/Prelude.lc 387:23-387:24 Type | 1627 | testdata/Prelude.lc 387:11-387:12 Float |
1610 | testdata/Prelude.lc 388:4-388:5 List V2 | 1628 | testdata/Prelude.lc 387:15-387:17 {a} -> List a |
1611 | testdata/Prelude.lc 388:4-389:30 Int->V2 | List V0 -> Int->V2 | V2 | 1629 | testdata/Prelude.lc 387:15-388:38 Bool -> List Float |
1612 | testdata/Prelude.lc 388:10-388:12 {a} -> List a -> Int->a | 1630 | testdata/Prelude.lc 388:7-388:16 Bool |
1613 | testdata/Prelude.lc 388:19-388:20 V3 | 1631 | testdata/Prelude.lc 388:7-388:38 List Float |
1614 | testdata/Prelude.lc 388:19-389:30 Bool->V4 | List V2 -> V2 | V1 -> List V2 -> V2 | V2 | 1632 | testdata/Prelude.lc 388:19-388:20 Float |
1615 | testdata/Prelude.lc 389:19-389:21 List V5 | 1633 | testdata/Prelude.lc 388:19-388:21 List Float -> List Float |
1616 | testdata/Prelude.lc 389:19-389:24 Int->V5 | 1634 | testdata/Prelude.lc 388:19-388:38 List Float |
1617 | testdata/Prelude.lc 389:19-389:30 V3 | 1635 | testdata/Prelude.lc 388:20-388:21 {a} -> a -> List a -> List a |
1618 | testdata/Prelude.lc 389:22-389:24 {a} -> List a -> Int->a | 1636 | testdata/Prelude.lc 388:22-388:28 Float -> Float -> List Float |
1619 | testdata/Prelude.lc 389:26-389:27 Int | 1637 | testdata/Prelude.lc 388:22-388:36 Float -> List Float |
1620 | testdata/Prelude.lc 389:26-389:28 Int->Int | 1638 | testdata/Prelude.lc 388:22-388:38 List Float |
1621 | testdata/Prelude.lc 389:26-389:29 Int | 1639 | testdata/Prelude.lc 388:30-388:31 Float |
1622 | testdata/Prelude.lc 389:27-389:28 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | 1640 | testdata/Prelude.lc 388:30-388:33 Float->Float |
1623 | testdata/Prelude.lc 389:28-389:29 V1 | 1641 | testdata/Prelude.lc 388:30-388:35 Float |
1642 | testdata/Prelude.lc 388:32-388:33 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | ||
1643 | testdata/Prelude.lc 388:34-388:35 V1 | ||
1644 | testdata/Prelude.lc 388:37-388:38 Float | ||
1645 | testdata/Prelude.lc 390:9-390:24 Type | ||
1646 | testdata/Prelude.lc 390:9-392:30 V0->V1 | {a} -> List a -> Int->a | ||
1647 | testdata/Prelude.lc 390:10-390:11 V1 | ||
1648 | testdata/Prelude.lc 390:16-390:19 Type | ||
1649 | testdata/Prelude.lc 390:16-390:24 Type | ||
1650 | testdata/Prelude.lc 390:23-390:24 Type | ||
1651 | testdata/Prelude.lc 391:4-391:5 List V2 | ||
1652 | testdata/Prelude.lc 391:4-392:30 Int->V2 | List V0 -> Int->V2 | V2 | ||
1653 | testdata/Prelude.lc 391:10-391:12 {a} -> List a -> Int->a | ||
1654 | testdata/Prelude.lc 391:19-391:20 V3 | ||
1655 | testdata/Prelude.lc 391:19-392:30 Bool->V4 | List V2 -> V2 | V1 -> List V2 -> V2 | V2 | ||
1656 | testdata/Prelude.lc 392:19-392:21 List V5 | ||
1657 | testdata/Prelude.lc 392:19-392:24 Int->V5 | ||
1658 | testdata/Prelude.lc 392:19-392:30 V3 | ||
1659 | testdata/Prelude.lc 392:22-392:24 {a} -> List a -> Int->a | ||
1660 | testdata/Prelude.lc 392:26-392:27 Int | ||
1661 | testdata/Prelude.lc 392:26-392:28 Int->Int | ||
1662 | testdata/Prelude.lc 392:26-392:29 Int | ||
1663 | testdata/Prelude.lc 392:27-392:28 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | ||
1664 | testdata/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 | ||
6 | inner2 = | 6 | inner2 = |
7 | makeFrame (Uniform "Time") | 7 | makeFrame (Uniform "Time") |
8 | (Uniform "MVP") | ||
9 | (fetch "stream4" (Attribute "position4")) | 8 | (fetch "stream4" (Attribute "position4")) |
10 | 9 | ||
11 | main :: Output | 10 | main :: 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 | """ |