gl: Do not rely on driver statistics for s3TC textures; they are inconsistent.
This commit is contained in:
@@ -1557,17 +1557,6 @@ namespace gl
|
||||
m_depth = depth;
|
||||
m_mipmaps = mipmaps;
|
||||
|
||||
GLenum query_target = (target == GL_TEXTURE_CUBE_MAP) ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : target;
|
||||
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_COMPRESSED, (GLint*)&m_compressed);
|
||||
|
||||
if (m_compressed)
|
||||
{
|
||||
GLint compressed_size;
|
||||
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compressed_size);
|
||||
m_pitch = compressed_size / height;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (sized_format)
|
||||
{
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
@@ -1581,9 +1570,24 @@ namespace gl
|
||||
m_pitch = width * 4;
|
||||
break;
|
||||
}
|
||||
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
|
||||
{
|
||||
m_compressed = true;
|
||||
m_pitch = width / 2;
|
||||
break;
|
||||
}
|
||||
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
|
||||
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
|
||||
{
|
||||
m_compressed = true;
|
||||
m_pitch = width;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
GLenum query_target = (target == GL_TEXTURE_CUBE_MAP) ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : target;
|
||||
GLint r, g, b, a;
|
||||
|
||||
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_RED_SIZE, &r);
|
||||
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_GREEN_SIZE, &g);
|
||||
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_BLUE_SIZE, &b);
|
||||
@@ -1599,7 +1603,6 @@ namespace gl
|
||||
fmt::throw_exception("Unhandled GL format 0x%X" HERE, sized_format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_target = static_cast<texture::target>(target);
|
||||
m_internal_format = static_cast<internal_format>(sized_format);
|
||||
|
||||
Reference in New Issue
Block a user