Continue adding mutability
This commit is contained in:
+29
-18
@@ -146,50 +146,61 @@ drawTextureOnFramebuffer fs fbo to = do
|
||||
drawShader fs 4
|
||||
|
||||
pokeBindFoldable
|
||||
:: PicShads VShader
|
||||
:: MV.MVector (PrimState IO) VShader
|
||||
-> UMV.MVector (PrimState IO) Int
|
||||
-> [Verx]
|
||||
-> IO ()
|
||||
pokeBindFoldable shads counts m = do
|
||||
shadV <- picShadToMV shads
|
||||
pokeBindFoldable shadV counts m = do
|
||||
pokeVerxs shadV counts m
|
||||
bindShader shadV counts
|
||||
--elist <- vToPicShad counts
|
||||
--return elist
|
||||
|
||||
zeroCounts :: PicShads Int
|
||||
zeroCounts = PicShads 0 0 0 0 0 0
|
||||
|
||||
pokeBindFoldableLayer
|
||||
:: RenderData
|
||||
:: MV.MVector (PrimState IO) VShader
|
||||
-> UMV.MVector (PrimState IO) Int
|
||||
-> Picture
|
||||
-> IO (IM.IntMap (PicShads Int))
|
||||
pokeBindFoldableLayer pdata m = do
|
||||
let shads = _pictureShaders pdata
|
||||
shadV <- picShadToMV shads
|
||||
counts <- UMV.replicate (6*6) 0
|
||||
pokeBindFoldableLayer shadV counts m = do
|
||||
slist'' <- pokeLayVerxs shadV counts m
|
||||
bindShaderLayers shadV counts
|
||||
return slist''
|
||||
|
||||
renderFoldable
|
||||
:: RenderData
|
||||
:: MV.MVector (PrimState IO) VShader
|
||||
-> [Verx]
|
||||
-> IO ()
|
||||
renderFoldable shadV struct = do
|
||||
counts <- UMV.replicate 6 0
|
||||
pokeBindFoldable shadV counts struct
|
||||
MV.imapM_ (drawShaderLay' 0 counts) shadV
|
||||
|
||||
renderFoldableTimed
|
||||
:: MV.MVector (PrimState IO) VShader
|
||||
-> [Verx]
|
||||
-> IO Word32
|
||||
renderFoldable pdata struct = do
|
||||
renderFoldableTimed shadV struct = do
|
||||
pokeStartTicks <- SDL.ticks
|
||||
let shads = _pictureShaders pdata
|
||||
counts <- UMV.replicate 6 0
|
||||
pokeBindFoldable shads counts struct
|
||||
s <- picShadToMV shads
|
||||
MV.imapM_ (drawShaderLay' 0 counts) s
|
||||
--sequence_ (drawShaderLay 0 <$> shads <*> count)
|
||||
pokeBindFoldable shadV counts struct
|
||||
MV.imapM_ (drawShaderLay' 0 counts) shadV
|
||||
pokeEndTicks <- SDL.ticks
|
||||
return $ pokeEndTicks - pokeStartTicks
|
||||
------------------------------end renderFoldable
|
||||
|
||||
renderLayer :: Int -> PicShads VShader -> IM.IntMap (PicShads Int) -> IO ()
|
||||
renderLayer i shads counts = sequence_ $ drawShaderLay i <$> shads <*> counts IM.! i
|
||||
renderLayer layer shads counts = sequence_ $ drawShaderLay layer <$> shads <*> counts IM.! layer
|
||||
|
||||
renderLayer'
|
||||
:: Int
|
||||
-> MV.MVector (PrimState IO) VShader
|
||||
-> UMV.MVector (PrimState IO) Int
|
||||
-> IO ()
|
||||
renderLayer' layer shads counts = do
|
||||
let layerCounts = UMV.slice (layer * 6) 6 counts
|
||||
MV.imapM_ (drawShaderLay' layer layerCounts) shads
|
||||
-- sequence_ $ drawShaderLay layer <$> shads <*> counts IM.! layer
|
||||
|
||||
pokeTwoOff
|
||||
:: Ptr Float
|
||||
|
||||
Reference in New Issue
Block a user