From 30548f17653a86fbff21035df66ff76532919d05 Mon Sep 17 00:00:00 2001 From: ZZYZX Date: Wed, 23 Nov 2022 18:43:51 +0200 Subject: [PATCH] Fixed crash on AMD hardware (resolves #820 reported by AlexMax) --- Source/Native/OpenGL/GLRenderDevice.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Native/OpenGL/GLRenderDevice.cpp b/Source/Native/OpenGL/GLRenderDevice.cpp index 8d2c7c0d..77e8382f 100644 --- a/Source/Native/OpenGL/GLRenderDevice.cpp +++ b/Source/Native/OpenGL/GLRenderDevice.cpp @@ -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;