fix infinite loop when expanding buffers
This commit is contained in:
parent
5c90eee84a
commit
a859814fda
|
@ -59,11 +59,14 @@ instance Buffer IndexBuffer where
|
|||
unbind buf
|
||||
|
||||
write buf offset dat = do
|
||||
currentBufSize <- readTVarIO (iBufSize buf)
|
||||
whileM_
|
||||
(pure $ (fromIntegral offset + VS.length dat) *
|
||||
(do
|
||||
currentSize <- readTVarIO (iBufSize buf)
|
||||
pure $ (fromIntegral offset + VS.length dat) *
|
||||
sizeOf (undefined :: StoreType IndexBuffer)
|
||||
> fromIntegral currentBufSize) $ do
|
||||
> fromIntegral currentSize)
|
||||
$ do
|
||||
currentBufSize <- readTVarIO (iBufSize buf)
|
||||
allocaArray
|
||||
(fromIntegral currentBufSize `div`
|
||||
sizeOf (undefined :: StoreType IndexBuffer))
|
||||
|
|
|
@ -89,11 +89,14 @@ instance Buffer VertexBuffer where
|
|||
unbind buf
|
||||
|
||||
write buf offset dat = do
|
||||
currentBufSize <- readTVarIO (vBufSize buf)
|
||||
whileM_
|
||||
(pure $ (fromIntegral offset + VS.length dat) *
|
||||
(do
|
||||
currentSize <- readTVarIO (vBufSize buf)
|
||||
pure $ (fromIntegral offset + VS.length dat) *
|
||||
sizeOf (undefined :: StoreType VertexBuffer)
|
||||
> fromIntegral currentBufSize) $ do
|
||||
> fromIntegral currentSize)
|
||||
$ do
|
||||
currentBufSize <- readTVarIO (vBufSize buf)
|
||||
allocaArray
|
||||
(fromIntegral currentBufSize `div`
|
||||
sizeOf (undefined :: StoreType VertexBuffer))
|
||||
|
|
Loading…
Reference in New Issue