summaryrefslogtreecommitdiff
path: root/testdata/bug/fragment_tuple5.wip.lc
blob: 874999109fc831aa98437da179244ed2f7844965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
makeFrame (projmat :: Mat 4 4 Float)
          (vertexstream :: PrimitiveStream Triangle ((Vec 4 Float)))

          = imageFrame (emptyDepthImage 1, emptyColorImage navy)
  `overlay` fragments
  where
    fragments =
          vertexstream
        & mapPrimitives (\((x)) -> (scale 0.5 (projmat *. x), x, x, x, x)) -- HERE: must support tuples up to 5
        & rasterizePrimitives (TriangleCtx CullNone PolygonFill NoOffset LastVertex) (Smooth,Smooth,Smooth,Smooth)
        & mapFragments (\(x,_,_,_) -> x)
        & accumulateWith (DepthOp Less True, ColorOp NoBlending (V4 True True True True))

main = renderFrame $
   makeFrame (Uniform "MVP")
             (fetch "stream4" (Attribute "position4"))