mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
- 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.
This commit is contained in:
parent
7ba6269450
commit
63ad7d99d1
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue