Start to move vbo objects to use DSA

This commit is contained in:
2023-03-09 13:17:43 +00:00
parent 9f37ed9944
commit f14d9bef60
5 changed files with 24 additions and 21 deletions
+3 -2
View File
@@ -14,11 +14,12 @@ import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Fusion.Stream.Monadic as VFSM
import Control.Monad.Primitive
import Control.Monad
import Graphics.GL.Core45
bindArrayBuffers :: Int -> VBO -> IO ()
{-# INLINABLE bindArrayBuffers #-}
bindArrayBuffers numVs theVBO = do
bindBuffer ArrayBuffer $= Just (_vbo theVBO)
glBindBuffer GL_ARRAY_BUFFER (_vboName theVBO)
bufferSubData
ArrayBuffer
WriteToBuffer
@@ -32,7 +33,7 @@ bindShaderLayers shads counts = MV.imapM_ f shads
f i shad = do
let theVBO = _vaoVBO $ _shadVAO' shad
stride = sum $ _vboAttribSizes theVBO
bindBuffer ArrayBuffer $= (Just . _vbo $ theVBO)
glBindBuffer GL_ARRAY_BUFFER (_vboName $ theVBO)
VFSM.mapM_ (g stride theVBO) $ VFSM.enumFromStepN 0 1 6 -- [0..5]
--S.mapM_ (g stride theVBO) $ S.each [0..5]