From 63ad7d99d1d4ce7d0db48ed707e6542d50b0fcf6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 4 Aug 2016 12:55:21 +0200 Subject: [PATCH] - fixed: The dynamic light buffer's behavior needs to obey the gl.lightmethod variable, and not depend on presence of persistently mapped buffers. Since there is a command line switch to revert to the lower behavior it can well be that they do not match. --- src/gl/dynlights/gl_lightbuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gl/dynlights/gl_lightbuffer.cpp b/src/gl/dynlights/gl_lightbuffer.cpp index 4fd3b985a..604b6f9a2 100644 --- a/src/gl/dynlights/gl_lightbuffer.cpp +++ b/src/gl/dynlights/gl_lightbuffer.cpp @@ -71,7 +71,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) + if (gl.lightmethod == LM_DIRECT) { glBufferStorage(mBufferType, mByteSize, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); mBufferPointer = (float*)glMapBufferRange(mBufferType, 0, mByteSize, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); @@ -151,7 +151,7 @@ int FLightBuffer::UploadLights(FDynLightData &data) // create the new buffer's storage (twice as large as the old one) mBufferSize *= 2; mByteSize *= 2; - if (gl.flags & RFL_BUFFER_STORAGE) + if (gl.lightmethod == LM_DIRECT) { glBufferStorage(mBufferType, mByteSize, NULL, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); mBufferPointer = (float*)glMapBufferRange(mBufferType, 0, mByteSize, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); @@ -190,7 +190,7 @@ int FLightBuffer::UploadLights(FDynLightData &data) void FLightBuffer::Begin() { - if (!(gl.flags & RFL_BUFFER_STORAGE)) + if (gl.lightmethod == LM_DEFERRED) { glBindBuffer(mBufferType, mBufferId); mBufferPointer = (float*)glMapBufferRange(mBufferType, 0, mByteSize, GL_MAP_WRITE_BIT); @@ -199,7 +199,7 @@ void FLightBuffer::Begin() void FLightBuffer::Finish() { - if (!(gl.flags & RFL_BUFFER_STORAGE)) + if (gl.lightmethod == LM_DEFERRED) { glBindBuffer(mBufferType, mBufferId); glUnmapBuffer(mBufferType);