This commit is contained in:
2023-03-23 14:14:54 +00:00
parent 02ee4b01c9
commit ecd7a0fae0
6 changed files with 4 additions and 72 deletions
+3 -10
View File
@@ -1,8 +1,6 @@
module Shader.Bind (
bindShaderLayers,
--, bindShaderBuffers
bufferShaderLayers,
bufferPokedVBO,
bufferShaderVector,
) where
import Control.Monad.Primitive
@@ -24,8 +22,8 @@ bufferPokedVBO theVBO numVs =
(fromIntegral $ floatSize * numVs * _vboVertexSize theVBO)
(_vboPtr theVBO)
bindShaderLayers :: MV.MVector (PrimState IO) (Shader, VBO) -> UMV.MVector (PrimState IO) Int -> IO ()
bindShaderLayers shads counts = MV.imapM_ f shads
bufferShaderLayers :: MV.MVector (PrimState IO) (Shader, VBO) -> UMV.MVector (PrimState IO) Int -> IO ()
bufferShaderLayers shads counts = MV.imapM_ f shads
where
f i shad = do
let theVBO = snd shad
@@ -42,8 +40,3 @@ bindShaderLayers shads counts = MV.imapM_ f shads
glNamedBufferSubDataH :: GLuint -> GLintptr -> GLsizeiptr -> Ptr a -> IO ()
glNamedBufferSubDataH = glNamedBufferSubData
bufferShaderVector :: MV.MVector (PrimState IO) (Shader, VBO) -> UMV.MVector (PrimState IO) Int -> IO ()
bufferShaderVector shads counts = MV.imapM_ f shads
where
f i shad = UMV.read counts i >>= bufferPokedVBO (snd shad)