Polymost: workaround for texcache expecting all mipmap levels to be available

git-svn-id: https://svn.eduke32.com/eduke32@6675 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2018-02-19 06:11:44 +00:00
parent dc7e727f0c
commit 9001ec60a0

View file

@ -1256,8 +1256,10 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt,
miplevel = r_downsize;
// don't use mipmaps if mipmapping is disabled
if (glfiltermodes[gltexfiltermode].min == GL_NEAREST ||
glfiltermodes[gltexfiltermode].min == GL_LINEAR)
//POGO: until the texcacheheader can be updated, generate the mipmaps texcache expects if it's enabled
if (!glusetexcache &&
(glfiltermodes[gltexfiltermode].min == GL_NEAREST ||
glfiltermodes[gltexfiltermode].min == GL_LINEAR))
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
@ -1273,8 +1275,9 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t texfmt,
0);
// don't generate mipmaps if we're not going to use them
if (glfiltermodes[gltexfiltermode].min == GL_NEAREST ||
glfiltermodes[gltexfiltermode].min == GL_LINEAR)
if (!glusetexcache &&
(glfiltermodes[gltexfiltermode].min == GL_NEAREST ||
glfiltermodes[gltexfiltermode].min == GL_LINEAR))
{
return;
}