Fix hardware mipmap generation for cube maps

I was getting a black image when enabling hardware mipmap generation on cubemaps. I believe the problem is that the base Texture class is hard coding GL_TEXTURE_2D when enabling mipmap generation, instead of using the target type from the derived class.
This commit is contained in:
flashk 2018-10-02 09:04:26 -07:00 committed by Robert Osfield
parent 114c818f2e
commit d4bbec4a0c

View File

@ -2752,7 +2752,7 @@ Texture::GenerateMipmapMode Texture::mipmapBeforeTexImage(const State& state, bo
if (useGenerateMipMap) return GENERATE_MIPMAP;
}
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexParameteri(getTextureTarget(), GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
return GENERATE_MIPMAP_TEX_PARAMETER;
#endif
}
@ -2775,7 +2775,7 @@ void Texture::mipmapAfterTexImage(State& state, GenerateMipmapMode beforeResult)
break;
}
case GENERATE_MIPMAP_TEX_PARAMETER:
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
glTexParameteri(getTextureTarget(), GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
break;
case GENERATE_MIPMAP_NONE:
break;