summaryrefslogtreecommitdiff
path: root/lc
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-02-05 00:22:52 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-02-05 00:23:03 +0100
commitde0f0691a15c1551cf315274f89584594f89481c (patch)
treead265740fc3086bc525907098244a47bda6b5f66 /lc
parente0efd3ac952816038748e1841e6c096253f2e5b1 (diff)
set programmable point size with ProgramPointSize
Diffstat (limited to 'lc')
-rw-r--r--lc/Builtins.lc36
1 files changed, 19 insertions, 17 deletions
diff --git a/lc/Builtins.lc b/lc/Builtins.lc
index 4147e107..e123b4bd 100644
--- a/lc/Builtins.lc
+++ b/lc/Builtins.lc
@@ -220,13 +220,13 @@ data CullMode
220 | CullBack 220 | CullBack
221 | CullNone 221 | CullNone
222 222
223data PointSize 223data PointSize a
224 = PointSize Float 224 = PointSize Float
225 | ProgramPointSize 225 | ProgramPointSize (a -> Float)
226 226
227data PolygonMode 227data PolygonMode a
228 = PolygonFill 228 = PolygonFill
229 | PolygonPoint PointSize 229 | PolygonPoint (PointSize a)
230 | PolygonLine Float 230 | PolygonLine Float
231 231
232data PolygonOffset 232data PolygonOffset
@@ -256,10 +256,10 @@ primTexture :: () -> Vec 2 Float -> Vec 4 Float
256Uniform :: String -> t 256Uniform :: String -> t
257Attribute :: String -> t 257Attribute :: String -> t
258 258
259data RasterContext :: PrimitiveType -> Type where 259data RasterContext a :: PrimitiveType -> Type where
260 TriangleCtx :: CullMode -> PolygonMode -> PolygonOffset -> ProvokingVertex -> RasterContext Triangle 260 TriangleCtx :: CullMode -> PolygonMode a -> PolygonOffset -> ProvokingVertex -> RasterContext a Triangle
261 PointCtx :: PointSize -> Float -> PointSpriteCoordOrigin -> RasterContext Point 261 PointCtx :: PointSize a -> Float -> PointSpriteCoordOrigin -> RasterContext a Point
262 LineCtx :: Float -> ProvokingVertex -> RasterContext Line 262 LineCtx :: Float -> ProvokingVertex -> RasterContext a Line
263 263
264type family FTRepr' a where 264type family FTRepr' a where
265 -- TODO 265 -- TODO
@@ -344,9 +344,10 @@ type family RemSemantics a where
344 RemSemantics (Depth Float, Color a, Color b, Color c) = (a, b, c) 344 RemSemantics (Depth Float, Color a, Color b, Color c) = (a, b, c)
345 RemSemantics (Depth Float, Color a, Color b, Color c, Color d) = (a, b, c, d) 345 RemSemantics (Depth Float, Color a, Color b, Color c, Color d) = (a, b, c, d)
346 346
347-------------------
348
347data Vector (n :: Nat) t 349data Vector (n :: Nat) t
348 350
349 -- Render Operations
350data Fragment (l :: Nat) t 351data Fragment (l :: Nat) t
351 = Fragment (Vec 3 Float) (Vector l t) 352 = Fragment (Vec 3 Float) (Vector l t)
352 353
@@ -369,14 +370,15 @@ type family InterpolatedType a where
369 InterpolatedType (Interpolated a, Interpolated b, Interpolated c) = (a, b, c) 370 InterpolatedType (Interpolated a, Interpolated b, Interpolated c) = (a, b, c)
370 371
371rasterize 372rasterize
372 :: (b ~ InterpolatedType interpolation, a ~ JoinTupleType (Vec 4 Float) b) 373 :: ( b ~ InterpolatedType interpolation
373 => (a -> Float) -- point size 374 , a ~ JoinTupleType (Vec 4 Float) b )
374 -> interpolation -- tuple of Smooth & Flat 375 => interpolation -- tuple of Smooth & Flat
375 -> RasterContext x 376 -> RasterContext a x
376 -> Primitive a x -> FragmentStream 1 b 377 -> Primitive a x
377 378 -> FragmentStream 1 b
378rasterizePrimitives ctx is = concatMapStream (rasterize (\_ -> 1) is ctx) 379
379rasterizePrimitivesWithPointSize ctx ps is = concatMapStream (rasterize ps is ctx) 380rasterizePrimitives ctx is = concatMapStream (rasterize is ctx)
381--rasterizePrimitivesWithPointSize ctx ps is = concatMapStream (rasterize ps is ctx)
380 382
381checkFragment :: (a -> Bool) -> Fragment n a -> Bool 383checkFragment :: (a -> Bool) -> Fragment n a -> Bool
382 384