summaryrefslogtreecommitdiff
path: root/testdata/graphics-features/pickInt.lc
diff options
context:
space:
mode:
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)))