Commit before attempting to stream worldSPic more effectively

This commit is contained in:
2022-07-04 11:04:09 +01:00
parent 7fa391eb6c
commit 1e32b05406
9 changed files with 51 additions and 44 deletions
+4 -2
View File
@@ -10,9 +10,9 @@ import Graphics.Rendering.OpenGL hiding (Line,translate,scale,imageHeight,Polygo
import Foreign hiding (rotate)
import qualified Data.Vector.Unboxed.Mutable as UMV
import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import Control.Monad.Primitive
import Control.Monad
import qualified Streaming.Prelude as S
bindArrayBuffers :: Int -> VBO -> IO ()
{-# INLINABLE bindArrayBuffers #-}
@@ -32,7 +32,9 @@ bindShaderLayers shads counts = MV.imapM_ f shads
let theVBO = _vaoVBO $ _shadVAO shad
stride = sum $ _vboAttribSizes theVBO
bindBuffer ArrayBuffer $= (Just . _vbo $ theVBO)
VS.mapM_ (g stride theVBO) $ VS.enumFromStepN 0 1 6 -- [0..5]
--VS.mapM_ (g stride theVBO) $ VS.enumFromStepN 0 1 6 -- [0..5]
S.mapM_ (g stride theVBO) $ S.each [0..5]
where
g stride theVBO lay = do
numVs <- UMV.unsafeRead counts $ lay * 6 + i