If a buffer is somehow 0 bytes, create it as at least 4 bytes

* This is harmless padding and will avoid some errors on creation.
This commit is contained in:
baldurk
2018-06-21 12:33:09 +01:00
parent 91ec7f6c81
commit 427f1fe0ac
+2 -1
View File
@@ -1079,7 +1079,8 @@ bool GLResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceId r
{
gl.glGenBuffers(1, &res.name);
gl.glBindBuffer(eGL_COPY_WRITE_BUFFER, res.name);
gl.glNamedBufferDataEXT(res.name, (GLsizeiptr)BufferContentsSize, NULL, eGL_STATIC_DRAW);
gl.glNamedBufferDataEXT(res.name, (GLsizeiptr)RDCMAX(BufferContentsSize, 4U), NULL,
eGL_STATIC_DRAW);
BufferContents = (byte *)gl.glMapNamedBufferEXT(res.name, eGL_WRITE_ONLY);
SetInitialContents(