Render cleanup

This commit is contained in:
2023-03-24 00:14:25 +00:00
parent 9a66a09f96
commit 2bba3f7268
3 changed files with 106 additions and 91 deletions
+10
View File
@@ -1,8 +1,10 @@
module Shader.Bind (
bufferShaderLayers,
bufferPokedVBO,
bufferEBO,
) where
import Control.Lens
import Control.Monad.Primitive
import qualified Data.Vector.Fusion.Stream.Monadic as VFSM
import qualified Data.Vector.Mutable as MV
@@ -22,6 +24,14 @@ bufferPokedVBO theVBO numVs =
(fromIntegral $ floatSize * numVs * _vboVertexSize theVBO)
(_vboPtr theVBO)
bufferEBO :: EBO -> Int -> IO ()
bufferEBO ebo numis =
glNamedBufferSubData
(ebo ^. eboName)
0
(fromIntegral $ glushortSize * numis)
(ebo ^. eboPtr)
bufferShaderLayers :: MV.MVector (PrimState IO) (Shader, VBO) -> UMV.MVector (PrimState IO) Int -> IO ()
bufferShaderLayers shads counts = MV.imapM_ f shads
where