Reduce rendertype down to vertex information

This commit is contained in:
2021-07-27 13:35:43 +02:00
parent d27c5e7ff4
commit ae84f44824
14 changed files with 225 additions and 189 deletions
+24 -24
View File
@@ -155,8 +155,8 @@ renderShader shad dat = do
pokeBindFoldableLayer
:: Foldable f
=> RenderData
-> f (Int,RenderType)
-> IO (IM.IntMap [(FullShader,Int)])
-> f Verx
-> IO (IM.IntMap [(VShader,Int)])
pokeBindFoldableLayer pdata m = do
let slist = (,) <$> [0..6] <*> _pictureShaders pdata
@@ -164,28 +164,28 @@ pokeBindFoldableLayer pdata m = do
bindShaderLayer slist is
return $ IM.fromListWith (++) $ zipWith (\(i,fs) n -> (i,[(fs,n)])) slist is
renderFoldable
:: Foldable f
=> RenderData
-> f RenderType
-> IO Word32
renderFoldable pdata struct = do
pokeStartTicks <- SDL.ticks
let slist = _pictureShaders pdata
-- poke data, returns list buffer sizes for each shader
is <- F.foldM (traverse pokeShader slist) struct
-- the idea of binding many buffers at once, rather than interweaving with draw
-- calls, is to prevent opengl from waiting for a draw call to finish
-- before it performs another state change
bindShaderBuffers slist is
zipWithM_ drawShader slist is
pokeEndTicks <- SDL.ticks
return $ pokeEndTicks - pokeStartTicks
--renderFoldable
-- :: Foldable f
-- => RenderData
-- -> f RenderType
-- -> IO Word32
--renderFoldable pdata struct = do
-- pokeStartTicks <- SDL.ticks
--
-- let slist = _pictureShaders pdata
--
---- poke data, returns list buffer sizes for each shader
-- is <- F.foldM (traverse pokeShader slist) struct
--
---- the idea of binding many buffers at once, rather than interweaving with draw
---- calls, is to prevent opengl from waiting for a draw call to finish
---- before it performs another state change
-- bindShaderBuffers slist is
--
-- zipWithM_ drawShader slist is
--
-- pokeEndTicks <- SDL.ticks
-- return $ pokeEndTicks - pokeStartTicks
------------------------------end renderFoldable
pokeTwoOff