diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-02-05 00:22:52 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-02-05 00:23:03 +0100 |
commit | de0f0691a15c1551cf315274f89584594f89481c (patch) | |
tree | ad265740fc3086bc525907098244a47bda6b5f66 /lc | |
parent | e0efd3ac952816038748e1841e6c096253f2e5b1 (diff) |
set programmable point size with ProgramPointSize
Diffstat (limited to 'lc')
-rw-r--r-- | lc/Builtins.lc | 36 |
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 | ||
223 | data PointSize | 223 | data PointSize a |
224 | = PointSize Float | 224 | = PointSize Float |
225 | | ProgramPointSize | 225 | | ProgramPointSize (a -> Float) |
226 | 226 | ||
227 | data PolygonMode | 227 | data PolygonMode a |
228 | = PolygonFill | 228 | = PolygonFill |
229 | | PolygonPoint PointSize | 229 | | PolygonPoint (PointSize a) |
230 | | PolygonLine Float | 230 | | PolygonLine Float |
231 | 231 | ||
232 | data PolygonOffset | 232 | data PolygonOffset |
@@ -256,10 +256,10 @@ primTexture :: () -> Vec 2 Float -> Vec 4 Float | |||
256 | Uniform :: String -> t | 256 | Uniform :: String -> t |
257 | Attribute :: String -> t | 257 | Attribute :: String -> t |
258 | 258 | ||
259 | data RasterContext :: PrimitiveType -> Type where | 259 | data 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 | ||
264 | type family FTRepr' a where | 264 | type 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 | |||
347 | data Vector (n :: Nat) t | 349 | data Vector (n :: Nat) t |
348 | 350 | ||
349 | -- Render Operations | ||
350 | data Fragment (l :: Nat) t | 351 | data 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 | ||
371 | rasterize | 372 | rasterize |
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 | |
378 | rasterizePrimitives ctx is = concatMapStream (rasterize (\_ -> 1) is ctx) | 379 | |
379 | rasterizePrimitivesWithPointSize ctx ps is = concatMapStream (rasterize ps is ctx) | 380 | rasterizePrimitives ctx is = concatMapStream (rasterize is ctx) |
381 | --rasterizePrimitivesWithPointSize ctx ps is = concatMapStream (rasterize ps is ctx) | ||
380 | 382 | ||
381 | checkFragment :: (a -> Bool) -> Fragment n a -> Bool | 383 | checkFragment :: (a -> Bool) -> Fragment n a -> Bool |
382 | 384 | ||