- removed the texture ID cache.

Although this initially helped, it was only because it partially covered up the issues from the real problem which was using the sampler properties of the texture offsets.
With that one fixed this cache became pointless.
This commit is contained in:
Christoph Oelckers 2019-10-19 10:40:47 +02:00
parent bc986b8054
commit 4a9f0248d7
2 changed files with 7 additions and 9 deletions

View File

@ -124,6 +124,10 @@ FHardwareTexture* GLInstance::LoadTexture(FTexture* tex, int textype, int palid)
bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int method, int sampleroverride, float xpanning, float ypanning, FTexture *det, float detscale, FTexture *glow) bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int method, int sampleroverride, float xpanning, float ypanning, FTexture *det, float detscale, FTexture *glow)
{ {
if (picnum == 3692)
{
int a = 0;
}
if (tex->GetWidth() <= 0 || tex->GetHeight() <= 0) return false; if (tex->GetWidth() <= 0 || tex->GetHeight() <= 0) return false;
int usepalette = fixpalette >= 1 ? fixpalette - 1 : curbasepal; int usepalette = fixpalette >= 1 ? fixpalette - 1 : curbasepal;
int usepalswap = fixpalswap >= 1 ? fixpalswap - 1 : palette; int usepalswap = fixpalswap >= 1 ? fixpalswap - 1 : palette;

View File

@ -245,15 +245,9 @@ void GLInstance::Draw(EDrawType type, size_t start, size_t count)
int GLInstance::GetTextureID() int GLInstance::GetTextureID()
{ {
// Generating large numbers of texture IDs piece by piece does not work well on modern NVidia drivers. uint32_t id = 0;
glGenTextures(1, &id);
if (currentindex == THCACHESIZE) return id;
{
currentindex = 0;
glGenTextures(THCACHESIZE, TextureHandleCache);
}
else currentindex++;
return TextureHandleCache[currentindex];
} }
FHardwareTexture* GLInstance::NewTexture() FHardwareTexture* GLInstance::NewTexture()