summaryrefslogtreecommitdiff
path: root/testdata/graphics-features/pickInt.lc
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2018-09-22 11:26:15 +0200
committerGitHub <noreply@github.com>2018-09-22 11:26:15 +0200
commit65749d86dcc41b7de09d96834411031064bccff6 (patch)
treeae38d45354c552c5ab09f54e29cb547c22c37b89 /testdata/graphics-features/pickInt.lc
parentf4ad4265e6b6aeedc018f80da4ab39e75b5e16e0 (diff)
parenta153afd1ed674c0a0b8b520b9e5c2b1449f84fb0 (diff)
Merge pull request #15 from deepfire/integer-image-capability
compValue: allow literal integers to be processed
Diffstat (limited to 'testdata/graphics-features/pickInt.lc')
-rw-r--r--testdata/graphics-features/pickInt.lc25
1 files changed, 25 insertions, 0 deletions
diff --git a/testdata/graphics-features/pickInt.lc b/testdata/graphics-features/pickInt.lc
new file mode 100644
index 00000000..3c2dba84
--- /dev/null
+++ b/testdata/graphics-features/pickInt.lc
@@ -0,0 +1,25 @@
1-- Tests:
2-- 1. Pipeline targeting a render texture (TextureOut), instead of a Screenout.
3-- 2. Integer color components for the output
4
5type FB = FrameBuffer 1 '[ 'Color (Vec 4 Int)]
6
7scene :: String -> FB -> FB
8scene name prevFB =
9 Accumulate ((ColorOp NoBlending (one :: Vec 4 Bool)))
10 (mapFragments (\(uv, rgba) -> ((rgba)))
11 $ rasterizePrimitives (TriangleCtx CullFront PolygonFill NoOffset LastVertex) (Flat, Flat)
12 $ mapPrimitives
13 (\(pos, color, id)->
14 ( (Uniform "viewProj" :: Mat 4 4 Float) *. (V4 pos%x pos%y 0 1)
15 , V2 0.0 0.0
16 , V4 0 0 0 id))
17 $ fetch name ( Attribute "position" :: Vec 3 Float
18 , Attribute "color" :: Vec 4 Float
19 , Attribute "id" :: Int))
20 prevFB
21
22main :: Output
23main = TextureOut (V2 800 600) $
24 scene "objects" $
25 FrameBuffer ((colorImage1 (V4 0 0 0 0)))