Use mutable vectors to store shape vertex counts

This commit is contained in:
2021-09-24 15:22:16 +01:00
parent 7da1a8bc45
commit a0340eb024
2 changed files with 52 additions and 31 deletions
+6 -1
View File
@@ -45,8 +45,9 @@ doDrawing pdata w = do
-- bind as much data into vbos as feasible at this point
-- pictures setup
layerCounts <- UMV.replicate (6*6) 0
shapeCounts <- UMV.replicate 3 (0 :: Int)
-- attempt to do this poking in parallel
(nWalls,(nShapeVs,nIndices,nSilIndices)) <- MP.bindM3 (\ _ a b -> return (a,b))
nWalls <- MP.bindM3 (\ _ a _ -> return a)
-- pictures poking
( pokeBindFoldableLayer shadV layerCounts $ worldPictures w )
-- poke wall points and colors
@@ -55,8 +56,12 @@ doDrawing pdata w = do
(_vboPtr $ _vaoVBO $ _shadVAO $ _shapeShader pdata)
(_eboPtr $ _shapeEBO pdata)
(_eboPtr $ _silhouetteEBO pdata)
shapeCounts
$ worldShape w
)
nShapeVs <- UMV.read shapeCounts 0
nIndices <- UMV.read shapeCounts 1
nSilIndices <- UMV.read shapeCounts 2
-- bind wall points, silhouette data, surface geometry
uncurry bindShaderBuffers $ unzip
[ ( _wallTextureShader pdata, nWalls)