Hack fix bug when generating world with no chasms
Bug occured because we try to create an empty glNamedBufferStorage, instead just create a dummy storage with space for one element.
This commit is contained in:
@@ -30,7 +30,8 @@ postWorldLoad rdata cw = do
|
||||
glNamedBufferStorage newfloorbo (fromIntegral $ 8 * nfloorvxs * floatSize) floorptr 0
|
||||
nchasmvxs <- foldM (pokeChasm chptr) 0 (cw ^. uvWorld . cWorld . chasms)
|
||||
glBindBufferBase GL_SHADER_STORAGE_BUFFER 7 newchbo
|
||||
glNamedBufferStorage newchbo (fromIntegral $ 2 * nchasmvxs * floatSize) chptr 0
|
||||
glNamedBufferStorage newchbo (fromIntegral $ 2 * (max 1 nchasmvxs) * floatSize) chptr 0
|
||||
-- note the max 1, prevents trying to create empty buffer storage
|
||||
checkGLError "during postWorldLoad"
|
||||
return $
|
||||
cw & uvWorld . cWorld . numberFloorVerxs .~ nfloorvxs
|
||||
|
||||
Reference in New Issue
Block a user