From 4a9f0248d7bb1a0d9e88018c2fb2c504f518d36b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 Oct 2019 10:40:47 +0200 Subject: [PATCH] - 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. --- source/build/src/texcache.cpp | 4 ++++ source/glbackend/glbackend.cpp | 12 +++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/source/build/src/texcache.cpp b/source/build/src/texcache.cpp index f4822d373..f7f527f61 100644 --- a/source/build/src/texcache.cpp +++ b/source/build/src/texcache.cpp @@ -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) { + if (picnum == 3692) + { + int a = 0; + } if (tex->GetWidth() <= 0 || tex->GetHeight() <= 0) return false; int usepalette = fixpalette >= 1 ? fixpalette - 1 : curbasepal; int usepalswap = fixpalswap >= 1 ? fixpalswap - 1 : palette; diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index efc2ac10e..333e926f4 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -245,15 +245,9 @@ void GLInstance::Draw(EDrawType type, size_t start, size_t count) int GLInstance::GetTextureID() { - // Generating large numbers of texture IDs piece by piece does not work well on modern NVidia drivers. - - if (currentindex == THCACHESIZE) - { - currentindex = 0; - glGenTextures(THCACHESIZE, TextureHandleCache); - } - else currentindex++; - return TextureHandleCache[currentindex]; + uint32_t id = 0; + glGenTextures(1, &id); + return id; } FHardwareTexture* GLInstance::NewTexture()