|
@@ -10806,7 +10806,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#ifndef OPENGLES // OpenGL ES doesn't have GL_TEXTURE_MAX_LEVEL.
|
|
#ifndef OPENGLES // OpenGL ES doesn't have GL_TEXTURE_MAX_LEVEL.
|
|
|
- if (_supports_texture_lod) {
|
|
|
|
|
|
|
+ if (is_at_least_gl_version(1, 2)) {
|
|
|
// By the time we get here, we have a pretty good prediction for
|
|
// By the time we get here, we have a pretty good prediction for
|
|
|
// the number of mipmaps we're going to have, so tell the GL that's
|
|
// the number of mipmaps we're going to have, so tell the GL that's
|
|
|
// all it's going to get.
|
|
// all it's going to get.
|
|
@@ -11263,7 +11263,7 @@ upload_texture_image(CLP(TextureContext) *gtc, bool needs_reload,
|
|
|
<< "No mipmap level " << n << " defined for " << tex->get_name()
|
|
<< "No mipmap level " << n << " defined for " << tex->get_name()
|
|
|
<< "\n";
|
|
<< "\n";
|
|
|
#ifndef OPENGLES
|
|
#ifndef OPENGLES
|
|
|
- if (_supports_texture_lod) {
|
|
|
|
|
|
|
+ if (is_at_least_gl_version(1, 2)) {
|
|
|
// Tell the GL we have no more mipmaps for it to use.
|
|
// Tell the GL we have no more mipmaps for it to use.
|
|
|
glTexParameteri(texture_target, GL_TEXTURE_MAX_LEVEL, n - mipmap_bias);
|
|
glTexParameteri(texture_target, GL_TEXTURE_MAX_LEVEL, n - mipmap_bias);
|
|
|
}
|
|
}
|
|
@@ -11444,7 +11444,7 @@ upload_simple_texture(CLP(TextureContext) *gtc) {
|
|
|
|
|
|
|
|
#ifndef OPENGLES
|
|
#ifndef OPENGLES
|
|
|
// Turn off mipmaps for the simple texture.
|
|
// Turn off mipmaps for the simple texture.
|
|
|
- if (tex->uses_mipmaps() && _supports_texture_lod) {
|
|
|
|
|
|
|
+ if (tex->uses_mipmaps() && is_at_least_gl_version(1, 2)) {
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
@@ -12079,7 +12079,7 @@ do_extract_texture_data(CLP(TextureContext) *gtc) {
|
|
|
GLint num_expected_levels = tex->get_expected_num_mipmap_levels();
|
|
GLint num_expected_levels = tex->get_expected_num_mipmap_levels();
|
|
|
GLint highest_level = num_expected_levels;
|
|
GLint highest_level = num_expected_levels;
|
|
|
#ifndef OPENGLES
|
|
#ifndef OPENGLES
|
|
|
- if (_supports_texture_lod) {
|
|
|
|
|
|
|
+ if (is_at_least_gl_version(1, 2)) {
|
|
|
glGetTexParameteriv(target, GL_TEXTURE_MAX_LEVEL, &highest_level);
|
|
glGetTexParameteriv(target, GL_TEXTURE_MAX_LEVEL, &highest_level);
|
|
|
highest_level = min(highest_level, num_expected_levels);
|
|
highest_level = min(highest_level, num_expected_levels);
|
|
|
}
|
|
}
|