Fixed crash on AMD hardware (resolves #820 reported by AlexMax)

This commit is contained in:
ZZYZX 2022-11-23 18:43:51 +02:00
parent ba3e0437b3
commit 30548f1765

View file

@ -607,7 +607,11 @@ bool GLRenderDevice::SetVertexBufferData(VertexBuffer* ibuffer, void* data, int6
buffer->BufferStartIndex = buffer->BufferOffset / (format == VertexFormat::Flat ? VertexBuffer::FlatStride : VertexBuffer::WorldStride);
sharedbuf->NextPos += size;
glBufferSubData(GL_ARRAY_BUFFER, buffer->BufferOffset, size, data);
if (data)
{
glBufferSubData(GL_ARRAY_BUFFER, buffer->BufferOffset, size, data);
}
glBindBuffer(GL_ARRAY_BUFFER, oldbinding);
bool result = CheckGLError();
return result;