From a578ff5d06991e70262e1fa516dd4582c0fb0e92 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Jan 2015 13:13:54 +0100 Subject: [PATCH] - fixed a problem with some older AMD drivers: Normally calling glBindBufferBase should imply a call to glBindBuffer, but on these drivers it was never done, which resulted in the light uniform buffer never being created... --- src/gl/dynlights/gl_lightbuffer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gl/dynlights/gl_lightbuffer.cpp b/src/gl/dynlights/gl_lightbuffer.cpp index 979cbff77..4fd3b985a 100644 --- a/src/gl/dynlights/gl_lightbuffer.cpp +++ b/src/gl/dynlights/gl_lightbuffer.cpp @@ -70,6 +70,7 @@ FLightBuffer::FLightBuffer() glGenBuffers(1, &mBufferId); glBindBufferBase(mBufferType, LIGHTBUF_BINDINGPOINT, mBufferId); + glBindBuffer(mBufferType, mBufferId); // Note: Some older AMD drivers don't do that in glBindBufferBase, as they should. if (gl.flags & RFL_BUFFER_STORAGE) { glBufferStorage(mBufferType, mByteSize, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); @@ -144,6 +145,7 @@ int FLightBuffer::UploadLights(FDynLightData &data) // create and bind the new buffer, bind the old one to a copy target (too bad that DSA is not yet supported well enough to omit this crap.) glGenBuffers(1, &newbuffer); glBindBufferBase(mBufferType, LIGHTBUF_BINDINGPOINT, newbuffer); + glBindBuffer(mBufferType, newbuffer); // Note: Some older AMD drivers don't do that in glBindBufferBase, as they should. glBindBuffer(GL_COPY_READ_BUFFER, mBufferId); // create the new buffer's storage (twice as large as the old one)