glGenerateMipmap honors base/max level
This commit is contained in:
committed by
Mathias Agopian
parent
8f42e1a812
commit
28c8f6818e
@@ -1759,7 +1759,6 @@ void OpenGLDriver::generateMipmaps(Driver::TextureHandle th) {
|
||||
// color-renderable and filterable (i.e.: doesn't work for depth)
|
||||
bindTexture(MAX_TEXTURE_UNITS - 1, t->gl.target, t, t->gl.targetIndex);
|
||||
activeTexture(MAX_TEXTURE_UNITS - 1);
|
||||
glGenerateMipmap(t->gl.target);
|
||||
|
||||
t->gl.baseLevel = 0;
|
||||
t->gl.maxLevel = static_cast<uint8_t>(t->levels - 1);
|
||||
@@ -1767,6 +1766,8 @@ void OpenGLDriver::generateMipmaps(Driver::TextureHandle th) {
|
||||
glTexParameteri(t->gl.target, GL_TEXTURE_BASE_LEVEL, t->gl.baseLevel);
|
||||
glTexParameteri(t->gl.target, GL_TEXTURE_MAX_LEVEL, t->gl.maxLevel);
|
||||
|
||||
glGenerateMipmap(t->gl.target);
|
||||
|
||||
CHECK_GL_ERROR(utils::slog.e)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user