Polymer: fix leak of GL query objects

In cases where performing occlusion queries for multiple red walls
leading to the same sector, we would sometimes leak a number of
query objects. This was apparently harmless on NVIDIA drivers, but
would leak tons of memory on ATI.

git-svn-id: https://svn.eduke32.com/eduke32@1993 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2011-08-28 04:42:27 +00:00
parent 304a2c9feb
commit c17818aa6e

View file

@ -1659,7 +1659,7 @@ static void polymer_displayrooms(int16_t dacursectnum)
bglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
} else
queryid[sec->wallptr + i] = 1;
queryid[sec->wallptr + i] = 0xFFFFFFFF;
}
}
@ -1729,6 +1729,11 @@ static void polymer_displayrooms(int16_t dacursectnum)
sectorqueue[back++] = wall[sec->wallptr + i].nextsector;
drawingstate[wall[sec->wallptr + i].nextsector] = 1;
}
} else if (queryid[sec->wallptr + i] &&
queryid[sec->wallptr + i] != 0xFFFFFFFF)
{
bglDeleteQueriesARB(1, &queryid[sec->wallptr + i]);
queryid[sec->wallptr + i] = 0;
}
}
while (--i >= 0);